Linux Basics for Game Server Hosting

If you host a game server on a VPS or dedicated server, you will inevitably work with Linux. Most game servers run on Ubuntu or Debian. In this article, you learn the basic commands you need.

Connecting via SSH

SSH (Secure Shell) is how you log into your server. On Windows, use PuTTY or the built-in SSH client in PowerShell/Terminal:

ssh user@your-server-ip

On macOS and Linux, this works directly in the terminal.

Navigation and file management

pwd                   Show current directory
ls                    List files
ls -la                List files with details and hidden files
cd /path/to/dir       Go to a directory
cd ..                 Go up one directory
mkdir new-folder      Create a new directory
cp file copy          Copy a file
mv file /target/      Move or rename a file
rm file               Delete a file
rm -rf folder/        Delete a folder and everything in it (careful!)

Editing files

Nano is the easiest text editor:

nano file.txt         Open a file for editing
Ctrl+O                Save
Ctrl+X                Close

For larger files or config edits, nano is sufficient. Experienced users prefer vim.

Managing processes

ps aux                Show all running processes
top                   Real-time process overview (press q to quit)
htop                  Better process overview (must be installed)
kill [PID]            Stop a process by its process ID
killall [name]        Stop all processes with that name

Screen: background processes

Screen lets you run processes that continue after you close the SSH connection:

screen -S gameserver  Create a new screen session
                      (start your game server here)
Ctrl+A, D             Detach from the session (server keeps running)
screen -r gameserver  Reattach to the session
screen -ls            List all screen sessions

Alternative: tmux offers similar functionality with more options.

Downloading files

wget [URL]            Download a file from the internet
curl -O [URL]         Alternative to wget
unzip file.zip        Extract a zip file
tar -xzf archive.tar.gz  Extract a tar.gz

System information

df -h                 Show disk usage
free -h               Show RAM usage
uname -a              Show system information
uptime                Show how long the server has been running

Installing packages (Ubuntu/Debian)

apt update            Update the package list
apt upgrade           Install available updates
apt install [package] Install a package
apt remove [package]  Remove a package

Permissions and ownership

chmod 755 file        Set file permissions (rwxr-xr-x)
chmod +x script.sh    Make a script executable
chown user:group file Change the owner of a file

Common combinations for game servers

# Start game server in screen
screen -S mc
java -Xmx4G -Xms4G -jar server.jar nogui
Ctrl+A, D

# Watch server log
tail -f /path/to/logs/latest.log

# Upload server files via SFTP
# Use FileZilla or WinSCP

Which Linux distribution is best for game servers?

Ubuntu 22.04 LTS or Debian 12 are the most popular choices. Both are stable, well-documented, and have large communities. Ubuntu is slightly more user-friendly, Debian slightly more stable.

Should I install a GUI on my server?

No. A GUI (graphical interface) wastes RAM and CPU that your server could use. Everything you need can be done via the command line. If you want a visual management interface, use a web panel like Pterodactyl.

How do I upload files to my server?

Use SFTP (SSH File Transfer Protocol) with a program like FileZilla or WinSCP. Connect with the same credentials as SSH (IP, user, password/key, port).

Get started with a VPS at HostValues and learn Linux in practice.


Still stuck? Open a support ticket and our team will help you out.

Back to the blog