Skip to content
Linux & VPS

Essential Linux Commands for Game Server Admins

9 min read Updated 12 June 2026 ESAGAMES Team

You don't need to be a sysadmin to run a game server on a VPS — just a handful of commands. Here's the practical cheat sheet, grouped by what you'll actually do.

If you only memorise a handful, make it these — they cover ninety percent of day-to-day game-server admin on a VPS:

CommandWhat it does
ls -lahList files with sizes, including hidden ones
tail -f logs/latest.logWatch a log update live
screen -S nameKeep a server running after you disconnect
htopLive view of CPU, RAM and processes
systemctl restart myserverRestart a service
df -hCheck free disk space
ss -tlnpSee what's listening on which port
chown -R user:user dir/Fix file ownership

The rest of this cheat sheet groups every command by the job you're doing.

Moving around & files

pwd                 # where am I?
ls -lah             # list files, sizes, hidden ones
cd /home/gameuser   # change directory
nano server.cfg     # edit a file (Ctrl+O save, Ctrl+X exit)
tail -f logs/latest.log   # watch a log live

Keeping a server running: screen / tmux

If you start a server over SSH and close the terminal, it stops. screen (or tmux) keeps it alive in a detachable session:

screen -S mc            # new session named 'mc'
# start your server here, then press Ctrl+A then D to detach
screen -r mc           # re-attach later
screen -ls             # list sessions
Detach, don't exit

Inside screen, Ctrl+A then D detaches and leaves the server running. Typing exit or closing the window kills it. This trips up almost every new admin.

Managing processes

htop                       # live process viewer
ps aux | grep srcds        # find a running game server
kill 12345                 # stop a process by PID
kill -9 12345               # force-stop if it won't die

Services (systemd)

systemctl status myserver  # is it running?
systemctl restart myserver # restart it
systemctl enable myserver  # auto-start on boot
journalctl -u myserver -f  # follow its logs

Permissions & ownership

chmod +x start.sh          # make a script runnable
chown -R gameuser:gameuser server/   # fix ownership

Disk, network & updates

df -h                      # disk space
ss -tlnp                   # what's listening on which port
ufw allow 27015/udp        # open a game port (ufw)
apt update && apt upgrade   # update (Debian/Ubuntu)
Master screen, systemctl and tail -f and you can run almost any game server from the command line with confidence.

Networking & diagnostics commands

  • curl ifconfig.me — show your server's public IP, useful when sharing an ip:port with players.
  • ss -tlnp — see exactly which process is listening on which port, the fastest way to debug "port already in use".
  • traceroute host — trace the network path to a host, useful when diagnosing lag or packet loss.
  • dig +short domain — check DNS resolution quickly without the noise of a full dig output.
  • ping -c 4 host — a quick four-packet check that a host is reachable at all.

Log files worth knowing

  • /var/log/syslog or /var/log/messages — the general system log, first stop for anything not covered by a service's own log.
  • journalctl -xe — recent systemd errors with extra context, the fastest way to see why a service failed to start.
  • dmesg -T — kernel messages with human-readable timestamps, useful after an OOM kill, a crash, or a hardware/driver issue.

Good habits that prevent most Linux headaches

  • Always try screen -r or tmux attach before assuming a server died — it may just be detached, not gone.
  • Check df -h before every big update or backup so a full disk doesn't stop it halfway through.
  • Keep a personal text file of your frequently-used commands and server-specific paths — you will forget them.
  • Double-check the target of any destructive command (rm, kill -9) before hitting enter, especially over a slow SSH session.

Related guides

For a deeper dive on resource monitoring, see how to check CPU, RAM and disk usage. To lock a VPS down properly, read how to secure a Linux VPS and how to set up a firewall with ufw. If a scheduled task silently isn't running, check cron job not running.

Prefer a panel over a terminal?

Our managed game hosting gives you a clean web panel — console, files and restarts — no Linux needed.

See game hosting
FAQ

Frequently asked questions

How do I keep my server running after I close SSH?

Run it inside a screen or tmux session. Start the session, launch the server, then detach (Ctrl+A then D in screen). The server keeps running and you can re-attach anytime.

What's the difference between kill and kill -9?

kill sends a polite request to shut down, letting the process save and clean up. kill -9 force-terminates it immediately — use it only when a process is frozen and won't stop normally.

Do I need to learn Linux to host a game server?

Not necessarily. Managed game hosting with a control panel needs no command line. But a few Linux basics help a lot if you run your own VPS.

What's the quickest way to see what's listening on a port?

Run ss -tlnp. It lists every listening TCP port with the process behind it, which instantly tells you if a game server is running and on the right port, or if something else is already using it.

How do I check DNS resolution from the command line?

Use dig +short yourdomain.com — it returns just the resolved IP with none of the extra output, quick to eyeball or use in a script.

What log should I check first after a crash?

Start with journalctl -xe for systemd services, or dmesg -T if you suspect the kernel killed a process (for example after an out-of-memory event). Both give more context than a bare service log.

Is tmux better than screen for keeping a game server alive?

Both work the same way for this purpose — detach and reattach a session. tmux is more actively developed and has nicer window/pane splitting, but screen is preinstalled almost everywhere, so either is a fine choice.

Further reading

Go deeper on this

Guides and explainers that pair with this fix — from our guides and blog.

Knowledge base

Related articles

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.