Skip to content

GameServerManagers/docker-gameserver

Repository files navigation

LinuxGSM Game Server Docker Image

LinuxGSM
Docker Pulls GitHub Workflow Status Codacy grade SteamCMD MIT License

About

LinuxGSM is a command-line tool for quick, simple deployment and management of Linux dedicated game servers. This container image builds weekly and is available on Docker Hub as well as GitHub Container Registry.

Tags

For a list of available game servers visit linuxgsm.com or the serverlist.csv. For all tags see the tags list on Docker Hub.

Usage

docker-compose

Here is an example docker-compose configuration for the "csgoserver" using the image gameservermanagers/gameserver:csgo. Please note that the ports may vary depending on the specific game server. More docker-compose examples are available here.

version: '3.4'
services:
  linuxgsm-csgo:
    image: gameservermanagers/gameserver:csgo
    # image: ghcr.io/gameservermanagers/gameserver:csgo
    container_name: csgoserver
    volumes:
      - /path/to/csgoserver:/data
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/udp"
      - "27005:27005/udp"
    restart: unless-stopped

Docker CLI

Alternatively, you can use the Docker CLI to run the container:

docker run -d \
  --name csgoserver \
  -v /path/to/csgoserver:/data \
  -p 27015:27015 \
  -p 27020:27020/udp \
  -p 27005:27005/udp \
  --restart unless-stopped \
  gameservermanagers/gameserver:csgo

First Run

Before the first run, make sure to edit the docker-compose.yml file by changing the image tag and container_name to match your chosen game server. Upon the initial run, LinuxGSM will install the selected server and start running. The game server details will be displayed once the installation is complete.

Game Server Ports

Each game server has specific port requirements. Therefore, after the initial run, you need to configure the appropriate ports in your docker-compose file. The required ports will be outputted after the installation process and every time the Docker container is started. Automation for this process is planned for the future.

There are future plans to auto generate ports in the examples for you.

Volumes

There are two types of persistent storage with Docker: volumes and bind mounts, both of which are compatible with this container. For more information on the differences between the two, please refer to the Docker documentation.

Some game servers store files outside of the serverfiles directory, within other parts of the home directory. The data directory serves as the home directory for the LinuxGSM user and stores all game server files. Make sure to mount this directory to a persistent storage location.

LinuxGSM User

This container uses gosu to run gameservers as the linuxgsm user instead of root. If you are using a bind mount for the data directory, ensure that the permissions are appropriately set.

Run LinuxGSM commands

You can execute LinuxGSM commands within the container using the docker exec command. Here's an example to run the ./csgoserver details command as the linuxgsm user:

docker exec -it --user linuxgsm csgoserver ./csgoserver details