This README provides instructions for bringing up an ET Legacy server locally using Docker Compose, connecting to the server from another installed copy of ET Legacy, and configuring the server using environment variables.
- Docker and Docker Compose installed on your local machine.
- A working installation of ET Legacy on your local machine or another client machine. You can download ET Legacy from the official website. Note: The installers are recommended over the archives for ease of use.
-
A working sample
envfile: has been providedUpdate the
envfile with your desired settings (optional). For example:ET_HOSTNAME=LOCAL DEV ET ET_REFEREEPASSWORD=Start123! ET_RCONPASSWORD=Start123!
-
Template Configuration File: The
etl_server.cfg.templatefile contains placeholders for environment variables. To add more, you would add a variable to your env file and then add an entry to template file. For example:// Server settings set sv_hostname "${ET_HOSTNAME}" set rconpassword "${ET_RCONPASSWORD}" set refereePassword "${ET_REFEREEPASSWORD}"
-
Run Docker Compose: Bring up the server using Docker Compose:
docker-compose up
This command will build the Docker image (if necessary) and start the ET Legacy server in a detached mode.
-
Check the Server IP: To connect to the server, you need to know the IP address that Docker is listening on. You can find this by running:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' wolfenstein-et-server-1
-
Open ET Legacy: Start ET Legacy on your local machine.
-
Connect to the Server: Use the following command to connect to the running Docker server:
./etl.x86_64 +connect <docker_ip>
Replace
<docker_ip>with the IP address you retrieved in Step 3.2.Example:
./etl.x86_64 +connect 192.168.1.100
These variables are defined in env and applied to etl_server.cfg using envsubst.
-
Stopping the Server: To stop the server, use:
docker-compose down # or ctrl+c if running in the foreground -
Viewing Logs: To view the server logs:
docker-compose logs -f
Substitute Environment Variables: envsubst is used to generate the final configuration file as part of start.sh: that is run when the container starts. This allows you to define environment variables in the env file and have them automatically applied to the configuration file. For example, the following command:
```bash
envsubst < etl_server.cfg.template > etl_server.cfg
```
This command replaces placeholders in etl_server.cfg.template with actual values from your .env file and creates etl_server.cfg.
The game uses a .etlegacy folder stored in the root user's home directory to store configuration files, logs, and other data. This folder is mounted as a volume in the base of the repo folder to persist data across container restarts. If you want to reset the server to its default state, you can delete the .etlegacy folder in repo folder as a super user.
- Unable to Connect:
- Ensure your firewall allows traffic on the appropriate port (
27960by default) and that you're using the correct IP address. - Are you trying to use
localhost? If so, you may need to use the Docker host IP instead. You can find the IP with the docker command listed above
- Ensure your firewall allows traffic on the appropriate port (
- RCON Commands Not Working:
-Double-check the
rconpasswordinetl_server.cfgand ensure it matches what you’re using in-game. Also before trying to us an rcon command ensure that you authenticate in the console with/rconpassword <rconpassword>.- docker exec into the container and cat the etmain/etl_server.cfg file to ensure the rconpassword is set correctly in the file.
You now have a locally running ET Legacy server that you can connect to from any ET Legacy client. The server is fully configurable via environment variables, allowing for easy customization and deployment.
