How to Install Minecraft Game Server in Linux VPS? Print

  • 185

This article will assist you in installing Minecraft Server in your Linux VPS. 

Check out our VPS plans to host Minecraft Game Server. 

To install Minecraft Server, you will need root access and Java 1.7 or a newer version installed in your VPS. If you have not installed Java yet, refer following steps to install Java first.

1. Connect to SSH with the root user and type the following command – 

sudo yum install java-1.7.0-openjdk

2. Enter y, then RETURN at the confirmation prompt to continue with the installation.

3. Now, you have successfully installed OpenJDK 7.

To download and install the latest versions of OpenJDK packages, refer to OpenJDK.

Install Vanilla Minecraft Server

1. Connect to SSH with the root user.

2. Type the following command to create a folder where you want to install Minecraft. 
Though you can create this folder anywhere in the VPS file structure, creating it under the home directory is recommended.

mkdir minecraft

3. Now, switch to the Minecraft directory.

cd Minecraft

4. Now, verify that we have installed Java properly in the previous steps, and run the following command – 

java -version

5. Once it is verified that Java has been successfully installed in 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

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

7. Install a screen to run Minecraft Server when you are not connected to VPS. 

sudo yum install screen

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.

 



Was this answer helpful?

« Back

chat