How to Host a Minecraft Server on a VPS: The Complete Guide
Complete guide to hosting a Minecraft server on a VPS. Covers hardware requirements, server software choices, Java optimization, performance tuning, and scaling for larger communities.
Thomas van Herk
Infrastructure Engineer
Minecraft remains the most popular game server to self-host, and for good reason. Whether you are running a small survival world for friends or a public server with dozens of plugins, a VPS gives you full control over performance, mods, and who gets to play. No subscription to Realms, no limitations on player count, and no one else's rules about what you can install.
This guide covers setting up both Java Edition and Bedrock Edition servers on Linux and Windows, from initial installation through optimization and ongoing management.
Before you start, you need to decide which edition to host. Java Edition is the original version that runs on PC. It has the largest modding community, supports plugins through Spigot and Paper, and gives you the most control over server behavior. Bedrock Edition is the cross-platform version that runs on consoles, mobile devices, and Windows 10/11. If your players are on different platforms, Bedrock is the only option that lets everyone play together.
Java Edition servers are more resource-intensive but offer far more customization. Bedrock servers are lighter on resources but have a smaller plugin ecosystem. Most serious Minecraft communities run Java Edition. If you need cross-platform support, consider running both with a bridge plugin like GeyserMC.
2 to 5 players: 2 CPU cores, 2 to 4 GB RAM, 10 GB storage. A vanilla or lightly modded server for a small group. Budget 10 to 20 dollars per month.
5 to 20 players: 4 CPU cores, 4 to 8 GB RAM, 20 GB storage. Room for plugins, a larger world, and more concurrent players. Budget 20 to 35 dollars per month.
20 to 100 players: 6 to 8 CPU cores, 8 to 16 GB RAM, 40 GB NVMe storage. A public server with many plugins, large worlds, and heavy activity. Budget 40 to 70 dollars per month.
Minecraft Java Edition is single-threaded for the main game loop, which means clock speed matters more than core count. A VPS with fast single-core performance like those using Ryzen 9 processors will outperform one with more but slower cores.
Bedrock servers are significantly lighter. A server handling 10 players needs only 2 CPU cores and 1 to 2 GB of RAM. The Bedrock server binary is more optimized and does not run on the JVM, eliminating Java's memory overhead entirely.
Start with Ubuntu 22.04 or Debian 12. Install Java and create a dedicated user:
sudo apt update && sudo apt upgrade -y
sudo apt install -y openjdk-21-jre-headless screen
sudo useradd -m -s /bin/bash minecraft
sudo su - minecraftJava 21 is required for Minecraft 1.20.5 and newer. For older versions, Java 17 works. Check the Minecraft version requirements before installing.
Download the server jar file. We recommend Paper instead of vanilla Mojang server because it includes critical performance optimizations:
mkdir -p ~/server && cd ~/server
# For Paper (recommended):
curl -o paper.jar https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/411/downloads/paper-1.21.4-411.jar
# Or for vanilla Mojang server:
# curl -o server.jar https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jarRun the server once to generate config files:
java -Xms2G -Xmx4G -jar paper.jar noguiThe server will stop and create an eula.txt file. You need to accept the EULA:
sed -i "s/eula=false/eula=true/" eula.txtRun it again and the server will generate the world and all configuration files:
java -Xms2G -Xmx4G -jar paper.jar noguiThe main configuration file is server.properties. Edit it to customize your server:
nano ~/server/server.propertiesKey settings to change:
server-port=25565
max-players=20
view-distance=10
simulation-distance=8
difficulty=normal
gamemode=survival
motd=My Minecraft Server
white-list=false
online-mode=true
spawn-protection=0
max-tick-time=60000The view-distance and simulation-distance settings have the biggest impact on performance. Lower values reduce the area the server simulates around each player. A view distance of 10 is a good balance between visibility and performance. Reduce to 6 or 8 if you experience lag with many players.
The default Java flags leave performance on the table. Use Aikar's optimized flags which are the standard for Minecraft server hosting:
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -jar paper.jar noguiThese flags optimize garbage collection to minimize lag spikes. Set -Xms and -Xmx to the same value to prevent the JVM from constantly resizing the heap. Allocate about 80% of your available RAM to the JVM, leaving the rest for the OS.
Open the Minecraft port and set up auto-start:
sudo ufw allow 25565/tcp
sudo ufw allow 22/tcp
sudo ufw enableCreate the systemd service file:
sudo nano /etc/systemd/system/minecraft.service[Unit]
Description=Minecraft Java Server
After=network.target
[Service]
Type=simple
User=minecraft
WorkingDirectory=/home/minecraft/server
ExecStart=/usr/bin/java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -jar paper.jar nogui
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable minecraft
sudo systemctl start minecraftThe Bedrock server is a standalone binary, no Java required:
sudo useradd -m -s /bin/bash mcbedrock
sudo su - mcbedrock
mkdir -p ~/server && cd ~/server
curl -o bedrock-server.zip https://minecraft.azureedge.net/bin-linux/bedrock-server-1.21.51.02.zip
unzip bedrock-server.zip
chmod +x bedrock_serverEdit server.properties the same way as Java Edition. The settings are similar but not identical. Start the server:
LD_LIBRARY_PATH=. ./bedrock_serverBedrock uses UDP port 19132 by default. Open it in your firewall:
sudo ufw allow 19132/udpConnect via Remote Desktop. Download the server jar (Java) or server zip (Bedrock) and extract to a folder. For Java Edition, install Java 21 from Adoptium. Create a start script:
:: save as start.bat
@echo off
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -jar paper.jar nogui
pauseOpen the port in Windows Firewall:
netsh advfirewall firewall add rule name="Minecraft Server" dir=in action=allow protocol=TCP localport=25565For automatic startup, add the batch file to Task Scheduler with a trigger set to run at system boot.
A vanilla server works fine for small groups, but plugins transform Minecraft into whatever experience you want. Here are the essentials:
EssentialsX: The Swiss army knife of Minecraft plugins. Adds homes, warps, kits, economy, and hundreds of utility commands. Almost every server runs this.
LuckPerms: Permission management. Control who can use which commands, access which areas, and perform which actions. Essential for any server with more than a handful of players.
WorldGuard + WorldEdit: Region protection and world editing. Prevent griefing by protecting areas, and use WorldEdit for large-scale building and terrain modification.
CoreProtect: Block logging and rollback. See who placed or broke every block, and roll back griefing with a single command. This plugin has saved countless servers from griefers.
Install plugins by dropping the jar files into the plugins folder and restarting the server:
# Download plugins to the plugins directory
cd ~/server/plugins
curl -o EssentialsX.jar https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsX.jar
# Restart the server to load new plugins
sudo systemctl restart minecraftPaper has additional configuration files that let you fine-tune performance beyond what vanilla offers. Edit paper-world-defaults.yml:
nano ~/server/config/paper-world-defaults.ymlKey optimizations:
chunks:
max-auto-save-chunks-per-tick: 8
entity-per-chunk-save-limit:
experience_orb: 16
arrow: 8
snowball: 8
environment:
optimize-explosions: true
treasure-maps:
enabled: false
entities:
armor-stands:
tick: false
spawning:
per-player-mob-spawns: trueGenerating new chunks is the most CPU-intensive operation a Minecraft server performs. Pre-generate your world to eliminate lag when players explore new areas:
# Install Chunky plugin, then in-game or console:
chunky radius 5000
chunky startThis generates all chunks within 5000 blocks of spawn. It takes time but eliminates chunk generation lag during gameplay.
Automate world backups. Minecraft worlds are just files on disk, making backups straightforward:
#!/bin/bash
# save as /home/minecraft/backup.sh
DATE=$(date +%Y%m%d-%H%M)
BACKUP_DIR="/home/minecraft/backups"
mkdir -p $BACKUP_DIR
# Tell server to save and disable autosave temporarily
screen -S minecraft -p 0 -X stuff "save-all\n"
sleep 5
screen -S minecraft -p 0 -X stuff "save-off\n"
sleep 2
# Create backup
tar czf $BACKUP_DIR/world-$DATE.tar.gz -C /home/minecraft/server world world_nether world_the_end
# Re-enable autosave
screen -S minecraft -p 0 -X stuff "save-on\n"
# Delete backups older than 7 days
find $BACKUP_DIR -name "world-*.tar.gz" -mtime +7 -delete
echo "Backup completed: world-$DATE.tar.gz"chmod +x /home/minecraft/backup.sh
# Run every 6 hours
crontab -e
0 */6 * * * /home/minecraft/backup.shTPS drops below 20: Check timings with /timings on, wait 5 minutes, then /timings paste. The report shows exactly what is consuming server ticks. Common culprits are too many entities, unoptimized plugins, or excessive view distance.
Players experience lag but TPS is fine: This is usually network latency, not server performance. Check player ping with /ping. If ping is high, the server location is too far from the players. Choose a VPS in a data center close to your player base.
Out of memory errors: Increase -Xmx in your startup flags. If you are already using all available RAM, upgrade your VPS. Do not set -Xmx higher than your physical RAM or the server will swap to disk and performance will be terrible.
Server not appearing in server list: Verify the port is open and the server is running. Check server.properties to ensure server-port matches the port you opened in the firewall. If using a non-standard port, players need to specify it when connecting (e.g., your.ip:25566).
BlastVPS VPS plans come with NVMe storage and high clock-speed processors, giving your Minecraft server the single-thread performance it needs for smooth gameplay even with heavy plugin loads.
Ready to Deploy?
Get a high-performance VPS with instant setup, full root access, and 24/7 support.
Written by Thomas van Herk
Infrastructure Engineer
9+ years in server infrastructure, virtualization, and network architecture.