From Bare Metal to Building Worlds
Ubuntu
What Is a Dedicated Game Server (and Why Do You Need One)?
A dedicated game server is a specialized, standalone application running on hardware specifically set aside for hosting, rather than running in the background of the same personal computer a player is using to play the game. Unlike standard peer-to-peer hosting where the multiplayer world ceases to exist the moment the host logs off a dedicated server remains online 24/7. This persistent environment means your friends and community members can log in, gather resources, and progress at any time of day, completely independent of your personal gaming schedule or PC status.
For Minecraft, a dedicated server acts as the heavy-lifting central hub for your block-building universe. It handles all the complex background calculations, such as mob spawning, intricate redstone logic, chunk generation, and player data synchronization, which frees up the players' local computers to focus purely on rendering the graphics. Hosting Minecraft on dedicated hardware allows you to bypass the restrictive limitations of standard paid realms; it gives you the ultimate freedom to install massive custom modpacks, utilize performance-enhancing server software like PaperMC, and support dozens of concurrent players without suffering from severe lag or performance bottlenecks.
Similarly, a Valheim dedicated server provides a persistent, always-online Viking purgatory for you and your clan. Valheim's complex physics engine, smoke displacement, and structural integrity calculations can become incredibly taxing on a standard PC, particularly when multiple players are altering the landscape or engaging in chaotic boss fights simultaneously. By offloading this immense workload to a dedicated machine, you ensure a smooth, desync-free experience for everyone connected. It guarantees that your grand mead halls and sprawling settlements remain accessible and safe while bridging the gap seamlessly for cross-play between PC and console warriors.
Prerequisites
- Dedicated Hardware: A spare computer, a rented bare-metal server, or a Virtual Private Server (VPS).
- Sufficient RAM: At least 8GB of RAM is required, but 16GB or more is highly recommended if you intend to run both the Minecraft and Valheim servers simultaneously on the same machine.
- Capable CPU: A modern multi-core processor (e.g., equivalent to an Intel Core i5 or AMD Ryzen 5 or higher) to handle simultaneous world simulations.
- Fast Storage: At least 50GB of Solid State Drive (SSD) or NVMe storage. Fast read/write speeds are critical for quick world saves and fast chunk loading.
- Operating System: A 64-bit Linux distribution. This guide is optimized for Ubuntu 22.04 LTS or 24.04 LTS, which is the industry standard for game hosting.
- Network Requirements: A stable, high-speed broadband connection. If you are hosting this on a machine in your own home, you must have access to your router's administration panel to configure Port Forwarding.
- Basic Technical Knowledge: Familiarity with using a command-line interface (CLI) and connecting to a machine remotely via SSH (Secure Shell).
Initial Security Setup
Update the System
sudo apt update && sudo apt upgrade -y
Create a Dedicated User
root user is a major security risk. Create a dedicated user named gameserver .
sudo adduser gameserver
Configure the Firewall (UFW)
# Allow SSH so you don't lock yourself out sudo ufw allow OpenSSH # Allow Minecraft default port (TCP) sudo ufw allow 25565/tcp # Allow Valheim default ports (UDP) sudo ufw allow 2456:2458/udp # Enable the firewall sudo ufw enable
Switch to the New User
su - gameserver
Part 1: Setting up the Minecraft Server
Install Java
sudo if you added gameserver to the sudoers list, though it's safer to run this as your admin user).
exit sudo apt install openjdk-21-jre-headless -y su - gameserver
Create the Directory and Download the Server
mkdir ~/minecraft cd ~/minecraft
# Download the latest Paper 1.20.x build (replace URL with the latest build from papermc.io if needed) wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/496/downloads/paper-1.20.4-496.jar
Accept the EULA
echo "eula=true" > eula.txt
Create a Startup Script
nano start.sh
4G to match your hardware's available RAM):
#!/bin/bash java -Xms4G -Xmx4G -jar server.jar nogui
Ctrl+O , Enter , Ctrl+X). Make the script executable:
chmod +x start.sh
Part 2: Setting up the Valheim Server
Install Dependencies and SteamCMD
exit sudo dpkg --add-architecture i386 sudo apt update sudo apt install software-properties-common -y sudo apt install lib32gcc-s1 steamcmd -y
steamcmd installation, you will be prompted to read and accept the Steam EULA. Use the Tab key to select "OK" and "I Agree", then press Enter .)
gameserver user:
su - gameserver
Download the Valheim Server Files
896660).
mkdir ~/valheim cd ~/valheim /usr/games/steamcmd +force_install_dir ~/valheim +login anonymous +app_update 896660 validate +quit
Configure the Valheim Startup Script
cp start_server.sh start_valheim.sh nano start_valheim.sh
./valheim_server.x86_64 and modify the arguments. It should look like this:
export templdpath=$LD_LIBRARY_PATH export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH export SteamAppId=892970 # Edit the line below with your server details: ./valheim_server.x86_64 -name "My Epic Server" -port 2456 -world "Dedicated" -password "SecretPass123" -crossplay
- -name: The name of your server as it appears in the server browser.
- -world: The name of your save file (do not use spaces).
- -password: Must be at least 5 characters long.
- -crossplay: Allows Steam and Xbox players to play together.
Ctrl+O , Enter , Ctrl+X ). Make it executable:
chmod +x start_valheim.sh
Part 3: Running Servers in the Background (Systemd)
systemd services.
sudo privileges:
exit
Create the Minecraft Service
sudo nano /etc/systemd/system/minecraft.service
[Unit] Description=Minecraft Dedicated Server After=network.target [Service] User=gameserver Group=gameserver WorkingDirectory=/home/gameserver/minecraft ExecStart=/home/gameserver/minecraft/start.sh Restart=on-failure [Install] WantedBy=multi-user.target
Create the Valheim Service
sudo nano /etc/systemd/system/valheim.service
[Unit] Description=Valheim Dedicated Server Wants=network-online.target After=network-online.target [Service] User=gameserver Group=gameserver WorkingDirectory=/home/gameserver/valheim ExecStart=/home/gameserver/valheim/start_valheim.sh Restart=on-failure RestartSec=10 [Install] WantedBy=multi-user.target
Reload, Enable, and Start the Services
# Reload systemd to recognize the new files sudo systemctl daemon-reload # Enable them to start automatically on system boot sudo systemctl enable minecraft.service sudo systemctl enable valheim.service # Start the servers right now sudo systemctl start minecraft.service sudo systemctl start valheim.service
Checking Server Status
journalctl command:
- For Minecraft:
sudo journalctl -u minecraft -f - For Valheim:
sudo journalctl -u valheim -f
Ctrl+C to exit the live log view).
25565 (TCP) and 2456-2458 (UDP) pointing to your dedicated hardware's local IP address.
CTCservers Recommended Tutorials
Web, Network
Step-by-Step Guide: Install AMD ROCm on Ubuntu with RX 6600 GPU
Learn how to quickly and easily set up AMD ROCm on Ubuntu for your RX 6600 GPU, enabling powerful machine learning, AI workloads, and GPU-accelerated computing right on your system.
Web, Network, Linux, Mysql, Ubuntu
LAMP Setup Guide 2026: Ubuntu & Debian | CTCservers
Install a secure LAMP stack on Debian or Ubuntu. Follow our step-by-step guide to configure Linux, Apache, MySQL, and PHP for your web server.
Web, Network, Ubuntu
Deploy Phi-3 with Ollama on Ubuntu GPU | CTCservers
Learn how to easily deploy the Phi-3 LLM on an Ubuntu 24.04 GPU server using Ollama and WebUI. Follow our step-by-step tutorial for seamless AI hosting.
Discover CTCservers Dedicated Server Locations
CTCservers servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.