Skip to content

Instantly share code, notes, and snippets.

@Fraeven
Last active March 22, 2025 16:10
Show Gist options
  • Save Fraeven/701e08cc6c6b7ebd85bff2b916243f42 to your computer and use it in GitHub Desktop.
Save Fraeven/701e08cc6c6b7ebd85bff2b916243f42 to your computer and use it in GitHub Desktop.
How to setup a Linux server for Open Fortress

Last Updated 2025-03-22

Open Fortress Linux Dedicated Server Setup Guide

Prerequisites

Install dependencies.

Debian / Ubuntu < 24.04LTS (RECOMMENDED)

sudo dpkg --add-architecture i386; \
sudo apt update; \
sudo apt install \
  p7zip \
  lib32gcc-s1 \
  libstdc++6 \
  libstdc++6:i386 \
  libncurses5:i386 \
  libtinfo5:i386 \
  libcurl4-gnutls-dev:i386 \
  screen \
  libsdl2-2.0-0:i386 \
  libxinerama-dev \
  libxcursor-dev \
  libpango-1.0-0 \
  libpangocairo-1.0-0

Ubuntu 24.04LTS

sudo dpkg --add-architecture i386; \
sudo apt update; \
sudo apt install \
  p7zip \
  lib32gcc-s1 \
  libstdc++6 \
  libstdc++6:i386 \
  libcurl4-gnutls-dev:i386 \
  screen \
  libsdl2-2.0-0:i386 \
  libxinerama-dev \
  libxcursor-dev \
  libpango-1.0-0 \
  libpangocairo-1.0-0

wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_i386.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_i386.deb

sudo dpkg -i libtinfo5_6.4-2_amd64.deb
sudo dpkg -i libncurses5_6.4-2_amd64.deb

# If dpkg reports broken dependencies, execute:
sudo apt --fix-broken install

Arch Linux

sudo pacman -Syy \
  p7zip \
  lib32-gcc-libs \
  gcc-libs \
  lib32-ncurses \
  lib32-libcurl-gnutls \
  screen \
  libxinerama \
  libxcursor \
  pango

RHEL/Red Hat (May now be missing some required dependencies, your mileage may vary)

sudo yum install \
  p7zip \
  p7zip-plugins \
  libgcc.x86_64 \
  libgcc.i686 \
  glibc.i686 \
  libstdc++.x86_64 \
  libstdc++.i686 \
  ncurses-libs.i686 \
  libcurl.i686 \
  screen

Base Server Install Instructions

DO NOT RUN AS ROOT/USE THE USER 'ROOT'!! YOU HAVE BEEN WARNED!!!

# Go to home directory if not already there.
cd ~ 

mkdir ofserver && cd ofserver

curl -O https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz

tar xvzf steamcmd_linux.tar.gz

# Run the application and once its done updating quit out of it.
./steamcmd.sh +quit

tee -a fullupdate.txt <<EOF
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir ./tf2d
app_update 232250
force_install_dir ./sdk
app_update 244310 -beta previous2021
quit
EOF

# Validate the contents; should look like above without the EOF at the end.
cat fullupdate.txt 

./steamcmd.sh +runscript fullupdate.txt +quit

# Download beans (the OF updater/installer, then use it to install the game files)
curl -L https://beans.adastral.net/beans -o beans && chmod +x ./beans
./beans --no-pause install --location ./sdk

cd ./sdk/bin

rm libstdc++.so.6

ln -s datacache_srv.so datacache.so
ln -s dedicated_srv.so dedicated.so
ln -s engine_srv.so engine.so
ln -s materialsystem_srv.so materialsystem.so
ln -s replay_srv.so replay.so
ln -s scenefilecache_srv.so scenefilecache.so
ln -s shaderapiempty_srv.so shaderapiempty.so
ln -s soundemittersystem_srv.so soundemittersystem.so
ln -s studiorender_srv.so studiorender.so
ln -s vphysics_srv.so vphysics.so

cd ../open_fortress/bin
ln -s server.so server_srv.so

cd ..
cp gameinfo_template.txt gameinfo.txt
nano gameinfo.txt

# Next, edit this file to the correct location for tf2 and hl2. 
# Line 112 to 120 should be edited to match the **ABSOLUTE** path to the tf2 and hl2 folders you just installed. 
# Below is an example if your username on the server machine is bryson.

game				"/home/brysondev/ofserver/tf2d/tf/tf2_misc.vpk"
game				"/home/brysondev/ofserver/tf2d/tf/tf2_sound_misc.vpk"
game				"/home/brysondev/ofserver/tf2d/tf/tf2_sound_vo_english.vpk"
game				"/home/brysondev/ofserver/tf2d/tf/tf2_textures.vpk"
game				"/home/brysondev/ofserver/tf2d/tf"

game				"/home/brysondev/ofserver/tf2d/hl2/hl2_textures.vpk"
game				"/home/brysondev/ofserver/tf2d/hl2/hl2_sound_vo_english.vpk"
game				"/home/brysondev/ofserver/tf2d/hl2/hl2_sound_misc.vpk"

# Now, create a file in the `open_fortress/cfg` dir called `server.cfg` and add the following, 
# or google a server.cfg creator.


// Changes your servers name visible in the server browser.
hostname "My Epic Gaming Server"

// Sets your RCON password to allow for remote console command execution on the server.
// DO NOT SHARE THIS! This grants anyone who has the password control over your server!
rcon_password "thisPasswordShouldBeVeryLongAnd_c0mpl1c4t3d!@#$"
// Set to 1 to make your server LAN-only. Keep at 0 otherwise.
sv_lan 0

// Time per map in the rotation, in minutes. 0 to never rotate the map on a timer.
mp_timelimit 10
// Maximum number of rounds to play per map before forcing a mapchange
mp_maxrounds 1
// Maximum number of kills needed to win the round in Deathmatch.
mp_fraglimit 50

// Allow clients to upload customization files (e.g. sprays)
sv_allowupload 1
// Allow clients to download files (e.g. sprays, custom maps, custom content, etc.)
sv_allowdownload 1
// Maximum allowed file size for uploading in MB (Optional)
net_maxfilesize 15


cd ~/ofserver/sdk

# Edit this as you see fit, this is just a boilerplate.
tee -a startserver.sh <<EOF
#!/bin/sh
./srcds_run -console -game open_fortress -port 27015 +ip "0.0.0.0" -nohltv -timeout 0 +maxplayers 24 +map dm_crossfire +sv_cheats 0 -autoupdate -steam_dir ~/ofserver/ -steamcmd_script ~/ofserver/fullupdate.txt
EOF
chmod +x startserver.sh

# With the script above made, you can simple run the following command to have it run in a screen session.
screen -dmS ofserver ./startserver.sh

# To access the console, do the following:
screen -r

# To exit, do:
# CTRL+A + d
# This will detach you from the screen session.

Installing SourceMod

Follow general install instructions at https://wiki.alliedmods.net/Installing_SourceMod_(simple).

SourceMod would be installed in the addons directory under /home/<user>/ofserver/sdk/open_fortress

Install the Open-Fortress-Tools plugin, including the provided gamedata in the repo.

Dockerized Open Fortress

NOTE 2025-02-23: This Dockerfile is out of date and does not work with the current version of the installer.

If you would like to run an Open Fortress server using Docker, there is a maintained Docker repo by NotSoApex here: https://github.com/NotQuiteApex/Docker-OpenFortressServer

Running with a linux server on Windows via WSL2

  1. Install a linux distribution using wsl.
  2. Follow the normal setup guide from the start of this file. (NOTE: Do not install the server to a mounted directory like /mnt/c. Use /home or some other directory. Otherwise the game will likely fail to mount.)
  3. To expose the server from wsl to your host we'll use a utility called sudppipe. Download sudppipe.exe. Unzip and save it somewhere in Windows where you can find later.
  4. In the same directory as sudppipe, create a file named forward.bat with the following contents. Make sure to change the SET port=27015 line to match the port your server is running on if not 27015.
@ECHO off

SET port=27015

FOR /F "tokens=* USEBACKQ" %%F IN (`wsl hostname -I`) DO (
SET ip=%%F
)
%~dp0/sudppipe.exe -q -b 0.0.0.0 %ip% %port% %port%
  1. Make sure to add a public firewall exception for sudppipe or a generic rule allowing any program on port 27015 (or whatever port you are running the server on). Ensure you have a rule for both TCP and UDP.
  2. After starting the server from within wsl, run forward.bat to forward the port to your host.

Troubleshooting

  • Server is failing to load and segfault crashes!

    • If your server is failing to load and then displays a segment fault crash. You might have forgot to symbolically link your server.so file. To do so just do. ln -s ~/ofserver/sdk/open_fortress/bin/server.so ~/ofserver/sdk open_fortress/bin/server_srv.so
  • ./srcds_run line 324 18491 Segmentation fault $HL_CMD

    • You shouldn't be getting this error on Open Fortress, and this can only popup on RHEL-based distributions (Fedora, CentOS). Triple check that you have libcurl.i686 installed, and run the following commands: ln -s /usr/lib/libcurl.so.4 /usr/lib/libcurl-gnutls.so.4
  • dlopen failed trying to load: /home/ubuntu/.steam/sdk32/steamclient.so

    • This should be safe to ignore and shouldn't crash, but if you feel better not seeing the error, link over the binary to that path. ln -s ~/ofserver/linux32/steamclient.so ~/.steam/sdk32/
  • If your server displays messages such as below, you may be missing the steam_appid.txt file in your sdk directory. Create the file with the value 243750.

*       Unable to load Steam support library.*
*       Unable to load Steam support library.*
*       This server will operate in LAN mode only.*
*       This server will operate in LAN mode only.*

For other issues feel free to contact fraeven or other members of the development team in the #server-hosting-troubleshooting channel of the OF Discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment