To host a Soldier of Fortune II server on Linux, install the SoF2 Linux dedicated server files (v1.03) on a VPS, add the 32-bit system libraries the old program needs, copy in your server.cfg and mods, then start sof2ded with +set dedicated 2 +exec server.cfg. Open UDP port 20100 in the firewall, and run it as a systemd service so it restarts by itself.
What you need
- A small Linux VPS: one core and 512 MB–1 GB of memory is plenty. Debian and Ubuntu are the easiest, and the commands below use them.
- The SoF2 Linux dedicated server for v1.03.
- Your game’s
basefolder files, because the server needs the game’s maps and data. - Your mod’s server files, if you’ll run RoCmod or another mod.
Set up the server
- Create a user for the server, so it never runs as root:
sudo adduser --disabled-password sof2 - Install the 32-bit libraries. The server program is a 32-bit build from the early 2000s:
sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install libc6:i386 libstdc++6:i386 - Upload the server files to
/home/sof2/server/: the dedicated program, thebasefolder, and any mod folder. - Make the program executable:
chmod +x /home/sof2/server/sof2ded - Write
server.cfginbaseor your mod’s folder. See the server.cfg guide. - Test it: run the start command below as the
sof2user and join from your PC.
The start command
cd /home/sof2/server
./sof2ded +set dedicated 2 +set net_port 20100 +set fs_game rocmod +exec server.cfg
Leave out +set fs_game rocmod for the plain game. Linux file names are case-sensitive, so the folder and file names in your commands must match exactly.
Run it as a service
Create /etc/systemd/system/sof2.service:
[Unit]
Description=Soldier of Fortune II server
After=network-online.target
[Service]
User=sof2
WorkingDirectory=/home/sof2/server
ExecStart=/home/sof2/server/sof2ded +set dedicated 2 +set net_port 20100 +set fs_game rocmod +exec server.cfg
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Then start it and make it start at boot:
sudo systemctl daemon-reload
sudo systemctl enable --now sof2
sudo systemctl status sof2
Read the server’s output with journalctl -u sof2 -f. If you’d rather see a live console, run the command inside screen or tmux instead.
Open the port
sudo ufw allow 20100/udp
Some VPS providers also have a firewall in their control panel. Open UDP 20100 there too.
Several servers on one VPS
Give each server its own port (20100, 20101…), its own config file and its own service file. To offer multi-protocol cross play, run a v1.00 server and a v1.03 server on two ports. See versions explained.
Troubleshooting
- “No such file or directory” when the file exists: the 32-bit libraries are missing. Install them as in step 2.
- Players can’t connect: check the firewall, and that the server is listening:
ss -ulpn | grep 20100 - Server not in the list: see how to get your server listed.
Frequently asked questions
Can a SoF2 server run on Linux?
Yes, with the Linux dedicated server build of the game. Most long-running SoF2 servers run on Linux VPSs.
Why does the server need 32-bit libraries?
The server program was built for 32-bit Linux in the early 2000s. Modern 64-bit systems run it fine once the 32-bit C libraries are installed.
How much does a SoF2 server cost to run?
The smallest VPS plans from most providers are enough.
