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
- @detiam for maintaining a working fork for the Steam websocket client
Docker Hub: https://hub.docker.com/r/pfeiffermax/rust-game-server
GitHub Repository: https://github.com/max-pfeiffer/rust-game-server-docker
Since v1.1.0 I provide an Oxide variant of this image. The automation checks for a new Oxide release on GitHub every night and builds a new image based on the latest version of my Rust Docker image.
The tag of these images is prefixed with oxide-build. So look out for these
tags on Docker Hub if you want to run Rust with Oxide.
There is also a latest-oxide tag, so you can use this to always run an up-to-date Docker image with Oxide.
This image aims to be a solid base to run any plugin. So please drop me a line if you are missing any Debian package for a plugin.
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.
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 28016With 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 upYou can also run the Rust server in the background with option -d:
docker compose up -dAnd show the logs, option -f follows the logs:
docker compose logs -fIf 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)
> If you want to deploy to a production (Linux) server, have a look at the docker compose production example documentation.
This repository contains Docker configurations for running a Rust game server.
The docker-compose.yaml in the root directory is optimized for deployment on Coolify.
- Easy deployment: Just point Coolify to this repository
- Automatic environment variable handling: Uses Coolify's predefined variables
- Traefik integration: Web-based RCON interface accessible through Coolify's reverse proxy
- Direct port access: Game server UDP port (28015) is exposed directly
The configuration uses hardcoded values for stability but can be customized in Coolify UI:
SERVER_NAME: Name of your Rust server (default: RustServer)RCON_PASSWORD: Password for RCON access (default: rustpassword)
The deployment leverages Coolify's predefined variables:
COOLIFY_FQDN: Used for the Traefik host ruleCOOLIFY_URLandCOOLIFY_RESOURCE_UUID: Available to the application
You can also use Coolify's shared variables by defining them in:
- Team settings: Use as
${team.VARIABLE_NAME} - Project settings: Use as
${project.VARIABLE_NAME} - Environment settings: Use as
${environment.VARIABLE_NAME}
- In Coolify, create a new "Docker Compose" resource
- Connect to this Git repository (use the root directory)
- Configure any custom environment variables if needed
- Deploy the resource
- Make sure the following ports are accessible from the internet:
- 28015/UDP: The main Rust game server port
- 28016/TCP: RCON interface port (if accessing directly, not through the web interface)
- The game server (UDP port 28015) is exposed directly and not through the reverse proxy
- The RCON web interface is accessible through Coolify's Traefik proxy using the
COOLIFY_FQDN - If your server is behind NAT, make sure to forward port 28015/UDP to your server
- Logs are stored in a
./logsdirectory that will be automatically created - Server data is persisted in a Docker volume
- The RCON web interface is enabled by default (set by
+rcon.web 1)
If you need additional Docker options, you can add them in the Coolify UI under "Custom Docker Options", such as:
--ulimit nofile=1000000:1000000
For more detailed examples and configurations, see the examples/ directory.