Dockerfile for a basic Team Fortress 2 server
  • Dockerfile 79.6%
  • Shell 20.4%
Find a file
2025-12-14 20:49:43 +01:00
.forgejo/workflows ci 2025-06-15 23:51:10 +02:00
clean.sh update base image 2023-07-13 23:27:19 +02:00
Dockerfile fix attempts 2025-12-13 20:55:16 +01:00
LICENSE add license 2020-05-08 19:13:50 +02:00
README.md remove unused maps 2016-01-16 15:50:34 +01:00
tf.sh remove steamcmd script from launch 2025-12-14 20:49:43 +01:00
tf2_ds.txt don't validate 2025-12-14 20:48:05 +01:00
update.sh update base image 2023-07-13 23:27:19 +02:00

Team Fortress 2 + Docker

Basic Team Fortress 2 server

docker pull spiretf/docker-tf2-server

Maps

In order to reduce the image size this image has most of the maps removed, you'll probably want to add aditional maps to a derived image, install mapdownloader or use spiretf/docker-comp-server (comes with mapdownloader) instead.

Details:

By default image is build with enabled autoupdate feature (take a look at tf.sh file). You can create new Dockerfile based on that image (FROM spiretf/docker-tf2-server) and customize it with plugins, configs, CMD and ENTRYPOINT instructions.

# Run image with default options (CMD in Dockerfile)
docker run -d -p 27015:27015/udp spiretf/docker-tf2-server

# Run image with custom options
docker run -d -p 27015:27015/udp spiretf/docker-tf2-server +sv_pure 2 +map pl_badwater.bsp +maxplayers 32

# Run image with custom config
docker run -d -p 27015:27015/udp -v ~/server.cfg:/home/tf2/hlserver/tf2/tf/cfg/server.cfg:ro spiretf/docker-tf2-server