Guide to Setting Up Minecraft and Valheim Servers on VPS with Maximum Performance
Detailed guide to setting up Minecraft and Valheim servers on VPS with maximum performance, including system configuration, software optimization, security, and monitoring. Suitable...
Preparation Before Setup
To set up Minecraft and Valheim servers with maximum performance, you need a VPS or Dedicated Server with appropriate specifications. Below are the basic requirements:
- OS: Ubuntu 22.04 LTS or Debian 11 (optimized for game servers)
- RAM: Minimum 8GB, recommended 16GB or higher
- CPU: Xeon Gold or equivalent, with high clock speed (especially important for Minecraft and FiveM)
- Storage: NVMe or SATA SSD, minimum 100GB capacity
- Bandwidth: Under 100Mbps, but ensure it is not throttled
For VPS, you can use the Anti-DDoS Game Hosting & Pterodactyl Wings service. For Dedicated Server, refer to Xeon Gold Dedicated Servers at CMC & FPT Q9.
Setting Up Game Servers on VPS
1. Install and Configure Pterodactyl Wings
Use Pterodactyl Wings to easily manage game servers. Detailed instructions are available at Fixing Pterodactyl Wings Daemon TLS, SFTP Port, and Container Allocation Errors.
Run the following commands to install Pterodactyl:
sudo apt update
sudo apt install -y curl
curl -sL https://pterodactyl.io/install/panel.sh | bash
2. Create Containers for Minecraft and Valheim
In Pterodactyl, create a new container for each game. Select the appropriate Docker image (e.g., itzg/minecraft-server for Minecraft, valheim-server for Valheim).
Set the environment variables:
- Minecraft:
MEMORY=4G,TYPE=VANILLA,VERSION=1.19.2 - Valheim:
SERVER_NAME=MyValheimServer,SERVER_PASSWORD=yourpassword,SERVER_WORLD=MyWorld
3. Optimize Game Server Performance
To achieve maximum performance, optimize both software and system settings:
- Optimize RAM: Use How to Build a Lag-Free Minecraft Server and Hold a Solid 20 TPS to manage memory usage.
- Set CPU Affinity: Assign threads to specific CPUs to reduce latency.
- Set I/O Priority: Use
ioniceto prioritize I/O for the game server.
Security and Monitoring
1. Install Firewall
Set up a firewall to protect the server from DDoS attacks. Refer to FiveM Server Hardening: Anti-DDoS Firewall & Port 30120 Protection Guide for guidance.
Run the following commands to install UFW:
sudo apt install -y ufw
sudo ufw allow 25565/tcp # Minecraft
sudo ufw allow 2457/tcp # Valheim
sudo ufw allow 22/tcp # SSH
sudo ufw enable
2. Monitor Performance
Monitor server performance using tools like htop, iotop, or glances. Track CPU, RAM, I/O, and network usage.
3. Schedule Regular Backups
Automate daily backups of game server data. Use cron jobs to perform the task:
0 2 * * * tar -czf /backup/minecraft-valheim-$(date +\%Y\%m\%d).tar.gz /home/pterodactyl/servers/minecraft /home/pterodactyl/servers/valheim
Testing and Troubleshooting
1. Test Performance
Run the following command to check CPU and RAM performance:
htop
Ensure CPU and RAM are not overloaded.
2. Fix Common Errors
- TLS or SFTP Errors: Refer to Fixing Pterodactyl Wings Daemon TLS, SFTP Port, and Container Allocation Errors.
- Connection Interruptions: Check network and firewall settings.
References
- Why Single-Core Xeon Gold Clock Speed Decides Minecraft and FiveM Server TPS
- How to Build a Lag-Free Minecraft Server and Hold a Solid 20 TPS
- FiveM Server Hardening: Anti-DDoS Firewall & Port 30120 Protection Guide
- Fixing Pterodactyl Wings Daemon TLS, SFTP Port, and Container Allocation Errors
As no direct web source evidence is available, this guide is based on general technical knowledge and previously published related documentation. Installation and configuration steps may vary depending on software versions and operating systems.
Recommended Game Hosting Plans For This Guide
Powered by high-clock Intel Xeon Gold 6138 / 6146, Gen4 NVMe storage & Pterodactyl Panel with Anti-DDoS.
ECO 6138-02
VAT included
- CPU: 200% vCPU
- RAM: 4 GB
- Storage: 20 GB NVMe
ECO 6138-04
VAT included
- CPU: 600% vCPU
- RAM: 8 GB
- Storage: 20 GB NVMe
ECO 6146-04
VAT included
- CPU: 600% vCPU
- RAM: 8 GB
- Storage: 20 GB NVMe
