How to Set Up a Minecraft Server on a VPS
Introduction:
Hosting your own Minecraft server on a VPS gives you full control, better performance, and the ability to play with friends anytime. This guide shows you how to set up a Minecraft server step by step.
Step-by-step Guide
- Update your system:
- sudo apt update && sudo apt upgrade -y
- Install Java (required for Minecraft):
- sudo apt install openjdk-17-jre-headless
- Create a new user for Minecraft:
- sudo adduser --disabled-login minecraft
- sudo su - minecraft
- Download the latest Minecraft server JAR:
- wget https://launcher.mojang.com/v1/objects/$(curl -s https://launchermeta.mojang.com/mc/game/version_manifest.json | grep -oP '(?<="url":")[^"]release[^"]' | head -1 | xargs curl -s | grep -oP '(?<="server":")[^"]*' | head -1) -O minecraft_server.jarn
- (Or download manually from the official Minecraft site if the above fails.)
- wget https://launcher.mojang.com/v1/objects/$(curl -s https://launchermeta.mojang.com/mc/game/version_manifest.json | grep -oP '(?<="url":")[^"]release[^"]' | head -1 | xargs curl -s | grep -oP '(?<="server":")[^"]*' | head -1) -O minecraft_server.jarn
- Start the server for the first time:
- java -Xmx1024M -Xms1024M -jar minecraft_server.jar noguin
- This will create the EULA file and initial configs.
- java -Xmx1024M -Xms1024M -jar minecraft_server.jar noguin
- Accept the EULA:
- ano eula.txtn
- Change
eula=falsetoeula=trueand save.
- Change
- ano eula.txtn
- Start the server again:
- java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
- (Optional) Open the Minecraft port in your firewall:
- sudo ufw allow 25565/tcp
Recommendations
- Use screen or tmux to keep your server running after closing SSH.
- Regularly back up your world data.
- Allocate more RAM if needed for larger servers.
Call To Action
Want lag-free Minecraft hosting? Try our powerful VPS plans! https://xernode.com/#pricing