Looking to host your Minecraft world? Whether you're building with friends or setting up a public server, a Linux VPS is a powerful and affordable way to host a Minecraft server with full control and performance.
In this guide, we’ll walk you through step-by-step instructions to install a Vanilla Minecraft Server on your Linux VPS. From installing Java to configuring ports and launching your server, it’s all here.
Prerequisites
- Root access to your Linux VPS
- Java 1.7 or newer installed
- Basic SSH access and familiarity
Install Java (if not installed)
Step 1: Connect to your VPS via SSH as the root user and run:
# sudo yum install java-1.7.0-openjdk
Step 2: Enter y and press RETURN to confirm the installation. Java is now installed. For newer versions, you can also explore official OpenJDK downloads.
Set Up Vanilla Minecraft Server
Step 1: Connect to SSH with the root user.
Step 2: Type the following command to create a folder where you want to install Minecraft.
# mkdir minecraft
Step 3: Now, switch to the Minecraft directory.
# cd Minecraft
Step 4: Now, verify that we have installed Java properly in the previous steps, and run the following command:
# java -version
Step 5: Once it is verified that Java has been successfully installed in the VPS, download the Minecraft JAR file. Check Minecraft's download page to get the latest version of Minecraft Server.
# curl-O https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar
Step 6: Open the default Minecraft port 25565.
# sudo iptables -A INPUT -p tcp -m tcp --dport 25565 -j ACCEPT # sudo service iptables save # sudo service iptables restart
Step 7: Install a screen to run the Minecraft Server when you are not connected to the VPS.
# sudo yum install screen
Step 8: Start the Minecraft Server.
# screen java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
Now, you can exit from SSH or use Ctrl+a+d to exit the screen. While you exit from the screen, Minecraft won't be closed.
You can type screen -r to open the screen session again.
Conclusion:
Setting up a Minecraft Server on a Linux VPS is easier than you think. With just a few commands, you can launch a private or public Minecraft world that you fully control.
