Sign inSign up

pl4nty/tf2-docker-server

By pl4nty

•Updated over 6 years ago

Dockerfiles for automatically building TF2 gameservers

Image
2

50K+

pl4nty/tf2-docker-server repository overview

Docker Build Status Docker Stars Docker Pulls

⁠What is Team Fortress 2?

Nine distinct classes provide a broad range of tactical abilities and personalities. Constantly updated with new game modes, maps, equipment and, most importantly, hats! This Docker image contains the dedicated server of the game.

logo

⁠How to use this image

⁠Hosting a simple game server

Running on the host interface (recommended):

$ docker run -d --net=host --name=tf2-dedicated -e SRCDS_TOKEN={YOURTOKEN} cm2network/tf2

Running multiple instances (increment SRCDS_PORT and SRCDS_TV_PORT):

$ docker run -d --net=host -e SRCDS_PORT=27016 -e SRCDS_TV_PORT=27021 -e SRCDS_TOKEN={YOURTOKEN} --name=tf2-dedicated2 cm2network/tf2

SRCDS_TOKEN is required to be listed & reachable; https://steamcommunity.com/dev/managegameservers⁠

It's also recommended to use "--cpuset-cpus=" to limit the game server to a specific core & thread.
The container will automatically update the game on startup, so if there is a game update just restart the container.

⁠Configuration

⁠Environment Variables

Feel free to overwrite these environment variables, using -e (--env):

SRCDS_RCONPW="changeme" (value can be overwritten by tf/cfg/server.cfg) 
SRCDS_PW="changeme" (value can be overwritten by tf/cfg/server.cfg) 
SRCDS_PORT=27015
SRCDS_TV_PORT=27020
SRCDS_FPSMAX=300
SRCDS_TICKRATE=66
SRCDS_MAXPLAYERS=14
SRCDS_REGION=3

⁠Config

The config files can be found in the following directory: /home/steam/tf2-dedicated/tf/cfg

If you want to learn more about configuring a TF2 server check this documentation⁠.

⁠Image Variants:

The tf2 images come in three flavors, each designed for a specific use case.

⁠tf2:latest

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is a bare-minimum TF2 dedicated server containing no 3rd party plugins.

⁠tf2:metamod

This is a specialized image. It contains the plugin environment Metamod:Source⁠ which can be found in the addons directory. You can find additional plugins here⁠.

⁠tf2:sourcemod

This is another specialized image. It contains both Metamod:Source⁠ and the popular server plugin SourceMod⁠ which can be found in the addons directory. SourceMod⁠ supports a wide variety of additional plugins that can be found here⁠.

Tag summary

Content type

Image

Digest

Size

4.5 GB

Last updated

over 6 years ago

docker pull pl4nty/tf2-docker-server