Blog VPS 4 min read

Install a game server on a Linux VPS: method and pitfalls

Host a game server on a Linux VPS: SteamCMD, LinuxGSM or Pterodactyl, firewall, systemd service, backups. And when a turnkey game server offer is simpler.

On this page
  1. VPS or game server offer?
  2. 1. Prepare the VPS
  3. 2. Install a Steam game with SteamCMD
  4. 3. Open the port
  5. 4. Run the server as a service
  6. 5. Tools that simplify things
  7. 6. Backups
  8. Classic pitfalls
  9. Frequently asked questions

On a Linux VPS, you install a game server in three steps: download the server (SteamCMD for Steam games, or the game's official file), open its port in the firewall, then run it as a service that restarts on its own. Tools such as LinuxGSM or a Pterodactyl panel automate all of this. It is more flexible than a game server offer, but you become the system administrator.

VPS or game server offer?

VPSGame server offer
FreedomTotal (root)That of the panel
Several games on one machineYesOne server per offer
System updates, securityYour responsibilityManaged
Mod catalogue, versions in one clickTo install yourselfIncluded
Free trialNo3 days on the entry Eco offer

If you want a single server and want to play straight away, a game server offer is simpler. The VPS becomes worthwhile for running several servers, a site and a bot together, or for learning.

1. Prepare the VPS

  1. Connect over SSH: see connect via SSH.
  2. Update the system: apt update && apt upgrade -y.
  3. Create a dedicated user for the game, never root: adduser jeux. See create a non-root user.
  4. Enable the firewall while keeping SSH open: see configure the UFW firewall.

2. Install a Steam game with SteamCMD

Example with Valheim (server application ID 896660) on Debian or Ubuntu:

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd
su - jeux
steamcmd +force_install_dir ~/valheim +login anonymous +app_update 896660 validate +quit

Each game has its own server application ID and launch options: check its official documentation.

3. Open the port

sudo ufw allow 2456:2457/udp

Open only the game's ports (UDP and/or TCP depending on the game), and never the RCON port to the whole Internet.

4. Run the server as a service

A systemd service restarts the server if it crashes and when the VPS restarts. File /etc/systemd/system/valheim.service:

[Unit]
Description=Serveur Valheim
After=network-online.target

[Service]
User=jeux
WorkingDirectory=/home/jeux/valheim
ExecStart=/home/jeux/valheim/valheim_server.x86_64 -name "MonServeur" -port 2456 -world "Monde" -password "motdepasse"
Restart=on-failure

[Install]
WantedBy=multi-user.target

Then sudo systemctl daemon-reload && sudo systemctl enable --now valheim.

5. Tools that simplify things

  • LinuxGSM: scripts ready for more than a hundred games (installation, updates, backups, monitoring) in a few commands.
  • Pterodactyl: a complete web panel, with each server isolated in a container. Heavier to install, but convenient for managing several servers or for friends.

6. Backups

On a VPS, nobody backs up for you. Schedule a regular copy of the worlds (cron + tar), and keep one off the VPS (your PC, external storage). Storage VPS plans are made for this.

Classic pitfalls

  • Running the server as root: a flaw in the game then gives control of the whole VPS.
  • Too little memory: a 2 GB VPS will not run ARK or a large modpack. Check the game's requirements beforehand.
  • Forgetting game updates: players cannot connect after a patch until the server is up to date.
  • RCON or admin ports open to everyone.

Frequently asked questions

Which VPS for a game server? A KVM VPS with enough memory for the game and 1 to 2 GB of margin for the system. For several servers, add up their requirements.

Does DDoS protection cover a VPS? Yes, Anti-DDoS is included on our VPS plans as on game servers.

To choose: KVM VPS, Pterodactyl VPS, or directly a turnkey game server.

By Équipe Artaun