Steamcmd allow you to create server for games that use the steam api.
2.8K
Steamcmd allow you to create server for games that use the steam api. Basically, it download the game in CLI.
You can use Docker or Docker Swarm to use this image.
You first need to create a volume to persiste the game data. In this example, we will install the gmod server.
docker volume create steam_gmod
Now, you have your gmod volume you can start the server by running this command :
docker run -it --rm -v steam_gmod:/steam \
-e INSTALL_APPS=4020,232330,220 \
--restart always \
--name gmod-server
--entrypoint /entrypoint.sh \
-p 27015:27015 \
nocturlab/steamcmd \
/steam/4020/srcds_run -game garrysmod \
-norestart \
-port 27015 \
-console \
-secure \
+maxplayers 16 \
+hostname "My Sandbox Server" \
+gamemode sandbox \
+map gm_construct \
+host_workshop_collection **** \
+authkey **** \
+sv_setsteamaccount ****
To explain what it does, it's pretty simple.
The docker swarm work in the same way. But you need to create a stackfile.
To start, you first need to have a swarm cluster running, if not, you can just initialisate one using this command :
docker swarm init
Now, you can create the stackfile, I'll name it steam.yml. It will contain the deployment definition of our containers in the YAML format.
Here the template file you can use :
# file: steam.yml
version: "3.7"
services:
gmod:
image: nocturlab/steamcmd
environment:
INSTALL_APPS: 4020,232330,220
ports:
- 27015:27015
volumes:
- gmod:/steam
command: /steam/4020/srcds_run -game garrysmod -norestart -port 27015 -console -secure +maxplayers 16 +hostname "My Sandbox Server" +gamemode sandbox +map gm_construct +host_workshop_collection **** +authkey **** +sv_setsteamaccount ****
stdin_open: true
tty: true
deploy:
replicas: 1
volumes:
gmod:
You can see the same options as the docker solution.
So refer to that section if you want to know how to configure it.
stdin_open: true and tty: true allow you to access to the console.volumes: map at the buttom of the file allow you create new storages. Storage as used in services volumes: array.To run your server, you just have to run this command :
docker stack deploy -c steam.yml steam
The last steam of this command is your stack name. You can customise it but it need to be unique on your cluster.
All ressources created in your stack will be prefix by the stack name, here steam. for example for the volume gmod : steam_gmod
To access and edit your server files, you will find it only in root user (so use sudo -s) and in the directory /var/lib/docker/volumes/steam_gmod/4020/
Content type
Image
Digest
Size
177.1 MB
Last updated
almost 5 years ago
docker pull nocturlab/steamcmd