rust-game-server-docker

Docker container providing a Rust dedicated game server

MIT License

Stars
0

Rust Dedicated Game Server - Docker Image

This Docker image provides a Rust dedicated game server.

Facepunch releases an update for Rust monthly every first Thursday. Also, there are irregular updates every now and then. Each update requires players and servers to update their versions of the game.

Therefore, an automation checks the Rust release branch every night. If a new release was published by Facepunch, a new Docker image will be built with this new version. Just use the latest tag and you will always have an up-to-date Docker image.

Kudus to @jonakoudijs for providing the Steamcmd Docker image which is used here.

Docker Hub: https://hub.docker.com/r/pfeiffermax/rust-game-server

GitHub Repository: https://github.com/max-pfeiffer/rust-game-server-docker

Usage

Configuration

You can append all server configuration options as commands when running RustDedicated binary. Use the regular syntax like +server.ip 0.0.0.0 or -logfile.

As the Rust server is running in the Docker container as a stateless application, you want to have all stateful server data (map, config, blueprints etc.) stored in a Docker volume which is persisted outside of the container. This can be configured with +server.identity: you can specify the directory where this data is stored. You need to make sure that this directory is mounted on a Docker Volume.

This is especially important because you need to update the Rust server Docker image every month when Facepunch releases a new software update. When you use a Docker volume to store the +server.identity, all the data is still intact.

Check out the docker compose and the docker compose production examples to learn about the details.

Docker Run

For testing purposes, you can fire up a Docker container like this:

docker run -it --publish 28015:28015/udp --publish 28016:28016/tcp pfeiffermax/rust-game-server:latest +server.ip 0.0.0.0 +server.port 28015 +rcon.ip 0.0.0.0 +rcon.port 28016

Docker Compose

With docker compose you have your own Rust server up and running in no-time. For this, just clone this repo (or just copy and paste the compose.yaml file to your machine) and run the server with Docker compose like this:

git clone https://github.com/max-pfeiffer/rust-game-server-docker.git
cd rust-game-server-docker/examples/docker-compose
docker compose up

You can also run the Rust server in the background with option -d:

docker compose up -d

And show the logs, option -f follows the logs:

docker compose logs -f

If you want to connect to Rust server console via RCON use the CLI client:

docker compose run -it --rm rcon-cli
[+] Creating 1/0
 ✔ Container rust-server  Running                                                                                                                                             0.0s 
Waiting commands for rust-server:28016 (or type :q to exit)
> 

Production Deployment

If you want to deploy to a production (Linux) server, have a look at the docker compose production example documentation.

Additional Information Sources