EN

Game servers

How to Create an S&box Server

Complete guide to install a dedicated S&box server on a VPS or dedicated Linux server: SteamCMD, dedicated user, systemd service, console, updates, backup and troubleshooting.

8 min read, updated on 18 November 2026

On this page

This guide explains how to install a dedicated S&box server on your VPS or dedicated Linux server, run it with a dedicated user and a systemd service, then administer it and keep it up to date.

Order a Server

To host your S&box server, HostMyServers offers several options:

Prerequisites

  • SSH access as root or user with sudo privileges
  • 64-bit x86-64 Linux system: Debian 13 or Ubuntu 24.04
  • Active firewall: nftables (recommended), iptables or ufw (use only one firewall tool at a time)
  • Outbound Internet access to Steam, required at startup
  • Ports 27015 UDP and 27016 UDP accessible
  • The S&box game on Steam, on each player's computer

Required Configuration

Facepunch does not publish a minimum configuration for the dedicated server. The values below are rough estimates to get started: actual consumption mainly depends on the loaded game and the number of players.

Component To get started Recommended
RAM 4 GB 8 GB and more
CPU 2 x86-64 cores 4 cores or more, high frequency
Storage 20 GB SSD 40 GB NVMe SSD

The server files take up about 4.5 GB. Add to that the games and maps downloaded at startup.

System Update

Terminal
sudo apt update && sudo apt upgrade -y

Then check the system version:

Terminal
grep PRETTY_NAME /etc/os-release

Installing Dependencies

The server ships with its own .NET environment: you do not need to install it. It does need a few system libraries, though, and SteamCMD requires lib32gcc-s1.

On Debian 13:

Terminal
sudo apt install -y ca-certificates curl tar screen cron lib32gcc-s1 libfontconfig1 libuuid1 libssl3t64 libicu76

On Ubuntu 24.04:

Terminal
sudo apt install -y ca-certificates curl tar screen cron lib32gcc-s1 libfontconfig1 libuuid1 libssl3t64 libicu74

Creating a Dedicated User

The server must never run as root. Create a dedicated user:

Terminal
sudo adduser --disabled-password --gecos "" sbox

Ports Used

Port Protocol Usage Parameter
27015 UDP Game +port
27016 UDP Queries (player count, current map) +net_query_port

These are the engine's default values. By default, players go through Steam's relay: the server's IP address is not shared with them. Facepunch's documentation does not say whether these ports are still required with the relay, so open them as a precaution.

S&box has no administration port to open: the server console is only accessible from your SSH session.

Firewall Configuration

With UFW

Terminal
sudo ufw allow 27015/udp
sudo ufw allow 27016/udp
sudo ufw reload

With iptables

Terminal
sudo iptables -A INPUT -p udp --dport 27015 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 27016 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Saving the rules across reboots requires the iptables-persistent package.

With nftables

These commands use the inet filter table and the input chain, present by default in /etc/nftables.conf on Debian.

Terminal
sudo nft add rule inet filter input udp dport 27015 accept
sudo nft add rule inet filter input udp dport 27016 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf

Installing SteamCMD

Log in as the sbox user, then create the directories and download SteamCMD:

Terminal
sudo -iu sbox
mkdir -p ~/steamcmd ~/sbox-server ~/logs ~/.steam/sdk64
cd ~/steamcmd
curl -sqL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xzf -

Downloading the S&box Server

Start the server installation (application ID 1892930), still as the sbox user:

Terminal
./steamcmd.sh +force_install_dir /home/sbox/sbox-server +login anonymous +app_update 1892930 validate +quit

When it finishes, the message Success! App '1892930' fully installed. is displayed. If the command stops with an error, run it again: SteamCMD resumes where it left off.

Linking the Steam Client

The server must find steamclient.so to initialize Steamworks. Create the link to the file provided by SteamCMD:

Terminal
ln -sf /home/sbox/steamcmd/linux64/steamclient.so /home/sbox/.steam/sdk64/steamclient.so
ls -lL /home/sbox/.steam/sdk64/steamclient.so

Launch Script

Create the launch script:

Terminal
nano ~/start.sh
Terminal
#!/bin/bash
cd /home/sbox/sbox-server || exit 1

exec ./sbox-server \
    +game facepunch.sandbox facepunch.flatgrass \
    +hostname "My S&box Server" \
    +port 27015 \
    +net_query_port 27016

Make it executable:

Terminal
chmod 700 ~/start.sh

Main Parameters

Parameter Description
+game <game> [map] Game to load and, optionally, a map. These identifiers are those of the packages published on sbox.game
+hostname <name> Server name shown to players
+port <port> Server port
+net_query_port <port> Information query port
+net_game_server_token <token> Optional: Steam server token, which keeps the same Steam ID from one startup to the next

Keeping the Same Steam ID (optional)

Without a token, the server gets a new Steam ID on every startup. To keep it:

  1. Open the Steam game server management page.
  2. Create a token for application 590830 (S&box).
  3. Add this line to start.sh, ending the previous line with \:
Terminal
    +net_game_server_token YOUR_TOKEN

First Launch

Start the server manually to check that it boots, still as the sbox user:

Terminal
~/start.sh

The first startup downloads the game and the map, which can take several minutes. Once the game has loaded, type status in the console to display the server state and the lobby ID. Then type quit to stop it, and exit the sbox user's session:

Terminal
exit

Configuration as systemd Service

The server console needs a terminal to receive your commands. The service therefore runs the server inside a screen session, which keeps the console accessible and lets you save its output to a file.

Create Service File

Terminal
sudo nano /etc/systemd/system/sbox.service

File content:

Configuration
[Unit]
Description=S&box Dedicated Server
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=sbox
Group=sbox
WorkingDirectory=/home/sbox
Environment=TERM=xterm
ExecStart=/usr/bin/screen -DmS sbox -L -Logfile /home/sbox/logs/console.log /home/sbox/start.sh
ExecStop=/bin/sh -c '/usr/bin/screen -S sbox -p 0 -X stuff "quit^M"; while kill -0 $MAINPID 2>/dev/null; do sleep 1; done'
Restart=always
RestartSec=20
TimeoutStopSec=60
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target

Enable and Start Service

Terminal
sudo systemctl daemon-reload
sudo systemctl enable sbox.service
sudo systemctl start sbox.service

Management Commands

Terminal
# Check status
sudo systemctl status sbox.service

# Stop server
sudo systemctl stop sbox.service

# Restart server
sudo systemctl restart sbox.service

# Follow the console output
sudo tail -f /home/sbox/logs/console.log

Using the Server Console

To send a command without opening the console, then read the result:

Terminal
sudo -u sbox screen -S sbox -p 0 -X stuff "status^M"
sleep 12
sudo tail -n 30 /home/sbox/logs/console.log

The output file is written about every ten seconds, hence the pause.

To open the console live:

Terminal
sudo -u sbox script -qc "screen -r sbox" /dev/null

To leave it without stopping the server: Ctrl+A then D.

Connecting to the Server

  1. Get the lobby ID with the status command in the server console.
  2. Launch S&box and open the game console.
  3. Type the following command, replacing the number with your ID, without the steamid: prefix:
Text
connect 1234567890

Administration

These commands are typed in the server console:

Command Description
status Shows the server state and the lobby ID
game <game> [map] Loads a game, optionally with a map
hostname <name> Changes the server name
kick <id> Kicks a player, by name or Steam ID
find <text> Searches for a command or a variable
quit Stops the server

Server Update

The client and the server must remain compatible: update the server as soon as a new version of S&box is released.

Terminal
sudo systemctl stop sbox.service
sudo -iu sbox /home/sbox/steamcmd/steamcmd.sh +force_install_dir /home/sbox/sbox-server +login anonymous +app_update 1892930 validate +quit
sudo systemctl start sbox.service

Automatic Backup

The server folder can be reinstalled at any time with SteamCMD. You only need to keep the launch script and the config and data folders, if they exist.

Backup Script

Terminal
sudo nano /home/sbox/backup.sh
Terminal
#!/bin/bash
BACKUP_DIR="/home/sbox/backups"
SERVER_DIR="/home/sbox/sbox-server"
DATE=$(date +%Y-%m-%d_%H-%M-%S)

mkdir -p "$BACKUP_DIR"
chmod 700 "$BACKUP_DIR"

# Folders to keep, if they exist
ITEMS=()
for DIR in config data; do
    [ -e "$SERVER_DIR/$DIR" ] && ITEMS+=("$DIR")
done

tar -czf "$BACKUP_DIR/sbox_$DATE.tar.gz" -C /home/sbox start.sh -C "$SERVER_DIR" "${ITEMS[@]}"

# Delete backups older than 7 days
find "$BACKUP_DIR" -name "sbox_*.tar.gz" -mtime +7 -delete

echo "Backup completed: sbox_$DATE.tar.gz"
Terminal
sudo chown sbox:sbox /home/sbox/backup.sh
sudo chmod 700 /home/sbox/backup.sh

Schedule Backup

Terminal
sudo crontab -u sbox -e

Add:

Text
# Backup every day at 5 am
0 5 * * * /home/sbox/backup.sh

Regularly copy these archives off the server: a backup kept on the same machine does not protect you from a failure of that machine.

Troubleshooting

GLIBC_2.38 not found or GLIBCXX_3.4.31 not found Error

Your system is too old. The message may also take this form:

Text
Failed to load native library 'libengine2.so'. Error Code: 0/126

Reinstall the machine with Debian 13 or Ubuntu 24.04. Replacing only these libraries on Debian 12 or Ubuntu 22.04 risks breaking the system.

libfontconfig.so.1 or Couldn't find a valid ICU package Error

A dependency is missing: run the installation command that matches your system again, in the "Installing Dependencies" section.

steamclient.so Error

Check that the link exists and points to a real file:

Terminal
sudo -u sbox ls -lL /home/sbox/.steam/sdk64/steamclient.so

If it is missing, recreate it as described in "Linking the Steam Client".

Unable to log on to Steam in a reasonable time!

The server could not connect to Steam in time, and loading the game then fails with Unable to download package. Check the machine's outbound Internet access, then restart the service: the server does not retry this loading on its own.

Terminal
sudo systemctl restart sbox.service

Crash at Startup Despite a Compatible System

For example, an X509_INFO_free error on libengine2.so. First update the server, then check the project's reports. If the problem comes from the public version, you can try the staging branch in a separate folder, keeping in mind that not all players may be able to join it:

Terminal
sudo systemctl stop sbox.service
sudo -iu sbox /home/sbox/steamcmd/steamcmd.sh +force_install_dir /home/sbox/sbox-staging +login anonymous +app_update 1892930 -beta staging validate +quit

Then replace /home/sbox/sbox-server with /home/sbox/sbox-staging in start.sh, and restart the service.

Not Connected Message on the Player Side

No lobby was created. Check that the game is loaded with status. If you are developing your own game, its code must create the lobby.

state is 0x202 Error in SteamCMD

There is not enough disk space. Check it with df -h, free up some space, then run the command again.

The console.log File Gets Too Big

Empty it without stopping the server:

Terminal
sudo truncate -s 0 /home/sbox/logs/console.log