This project is based on the work of HoshinoRei.
This repository contains the necessary files to run a Left 4 Dead 2 server using Docker.
host.txt
: Contains information displayed in the top right corner of the server.motd.txt
: Contains the message of the day displayed on the server's main page.addons
: Directory for server plugins.cfg
: Directory for server configuration files.server.cfg
: Main server configuration file. Thehostname
parameter in this file sets the server name.
- Docker CE installed
- Docker Compose installed
-
Clone the repository:
git clone https://github.com/yourusername/l4d2-docker-dev.git cd l4d2-docker-dev
-
Start the server using Docker Compose:
docker-compose up -d
-
To stop the server:
docker-compose down
-
Clone the repository:
git clone https://github.com/yourusername/l4d2-docker-dev.git cd l4d2-docker-dev
-
Build the Docker image:
docker build -t l4d2server .
-
Run the container:
docker run -d --name l4d2server -p 27015:27015 -p 27015:27015/udp -v $(pwd)/addons:/home/steam/l4d2server/left4dead2/addons -v $(pwd)/cfg/server.cfg:/home/steam/l4d2server/left4dead2/cfg/server.cfg:ro -v $(pwd)/host.txt:/home/steam/l4d2server/left4dead2/host.txt:ro -v $(pwd)/motd.txt:/home/steam/l4d2server/left4dead2/motd.txt:ro 24workers/l4d2server:latest -secure +exec server.cfg -port 27015 -tickrate 100
-
To stop the container:
docker stop l4d2server docker rm l4d2server