CyberNex
CyberNex
services
Back to Tutorials
VPS & Dedicated11 min readJune 24, 2026

Linux VPS Setup Guide — From Zero to Production

Initial Connection and User Setup

After ordering your VPS, you'll receive: IP address, root username, and root password. Connect via SSH: 'ssh root@YOUR_IP' (Linux/macOS terminal) or PuTTY (Windows). On first login, change the root password: 'passwd'. Create a non-root user: 'adduser yourname', then grant sudo: 'usermod -aG sudo yourname'. Log out and test SSH access with the new user. From now on, always work as the non-root user with 'sudo' for admin commands.

System Updates and Essential Packages

Update the package list: 'sudo apt update' (Ubuntu/Debian) or 'sudo dnf check-update' (Rocky/Alma). Upgrade all packages: 'sudo apt upgrade -y' or 'sudo dnf upgrade -y'. Install essentials: 'sudo apt install -y curl wget git unzip htop ufw screen tmux build-essential software-properties-common'. These tools will be used throughout your server setup. Reboot if the kernel was updated: 'sudo reboot'.

Firewall Configuration with UFW

Enable UFW: 'sudo ufw enable'. Allow SSH first — never enable a firewall without allowing SSH: 'sudo ufw allow 22/tcp'. Allow game server ports: Minecraft default (25565), FiveM (30120 + 30110), Rust (28015 + 28016), CS2 (27015), TeamSpeak (9987, 30033, 10011). Use specific ports: 'sudo ufw allow 25565/tcp'. Verify with 'sudo ufw status verbose'. Always test that you can still SSH in after configuring the firewall.

Installing Java for Minecraft Servers

Minecraft requires Java. Install OpenJDK 21 (latest LTS): 'sudo apt install -y openjdk-21-jdk-headless' (Ubuntu) or 'sudo dnf install -y java-21-openjdk-headless' (Rocky). Verify: 'java -version'. For older Minecraft versions (1.16 and below), install Java 17: 'sudo apt install -y openjdk-17-jdk-headless'. Use update-alternatives to switch between Java versions: 'sudo update-alternatives --config java'. Create a dedicated user for each game server: 'sudo adduser minecraft'.

Setting Up a Game Server as a Systemd Service

Running game servers as systemd services ensures they start on boot, restart on crash, and log to journald. Create a service file: 'sudo nano /etc/systemd/system/minecraft.service'. Example: '[Unit] Description=Minecraft Server After=network.target [Service] Type=simple User=minecraft WorkingDirectory=/home/minecraft/server ExecStart=/usr/bin/java -Xmx4G -Xms4G -jar server.jar nogui Restart=on-failure RestartSec=10 [Install] WantedBy=multi-user.target'. Enable: 'sudo systemctl enable minecraft'. Start: 'sudo systemctl start minecraft'. Check logs: 'sudo journalctl -u minecraft -f'.

Automated Backups with restic or rsync

Game server data is irreplaceable — automate backups. Simple approach: rsync the server folder to a backup location daily via cron. Advanced: use restic for encrypted, deduplicated backups to cloud storage (Backblaze B2, S3). Install restic: 'sudo apt install restic'. Create a backup script: restic backup /home/minecraft/server and schedule it: '0 2 * * * /home/minecraft/backup.sh'. Test restoration before you need it — the most common backup failure is never having tested restore.

Related Hosting Services
// Frequently Asked Questions

FAQ

Was this guide helpful?

Join our Discord for more guides and direct help from our engineering team.

// Initialize Deployment

Deploy your server in 60 seconds

Get your Minecraft, FiveM, Rust, or CS2 server running on our global infrastructure before your coffee gets cold. Starting at € 3.50/month with instant provisioning, 17 Tbit DDoS protection, and 24/7 engineer support.

Linux VPS Setup Guide — From Zero to Production | CyberNex | CyberNex