How to install Minecraft on a VPS


Summary
This guide will provide step-by-step instructions for installing Minecraft on a VPS (Virtual Private Server). Minecraft is a popular sandbox video game that allows players to explore, build, and create in a 3D world. Installing Minecraft on a VPS can provide a reliable and stable platform for hosting Minecraft servers that can support multiple players.

This tutorial is based on Ubuntu LTS 14.04.

To follow this tutorial, you must first connect to your server via SSH and SFTP, to learn how to do this follow these tutorials:
https://www.bisecthosting.com/clients/knowledgebase/71/Connect-to-your-server-via-SSH.html
https://www.bisecthosting.com/clients/knowledgebase/72/Connect-to-your-server-via-SFTP.html

Installing Java

Before you can setup a Minecraft server on your VPS, you first need to install Java.

We need to create a directory to download Java. Use the following commands to create the directory.
1. mkdir /usr/lib/jvm

2. cd /usr/lib/jvm

Now you need to download the latest version of Java to your computer from here (choose Linux x64 .tar.gz file for a 64-bit systems and Linux x86 .tar.gz file for 32-bit systems.): http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Once Java has been downloaded, upload the downloaded file to /usr/lib/jvm directory using SFTP.

After the file has been uploaded, execute the command below using SSH to extract the file.

tar -zxvf <filename.tar.gz> (replace <filename.tar.gz> with the name of the file that you uploaded)

Output of the extracted files should look similar to the screenshot below. Take note of the directory it's being extracted to as we are going to need it next. The directory that we are looking for is called "jre1.8.0_73" in this tutorial but this will vary depending on the version of Java that you download.

 

Now run the following command to install Java (Change jre1.8.0_73 to the name of directory that you took note above):
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.8.0_73/bin/java 0

Java is now installed. We can verify that we have Java installed correctly by using this command: java -version

Output of that command should look something like this if you have Java installed correctly:

 


Creating a Minecraft Server

Before we create the Minecraft server, we have to create a folder to store all our Minecraft files, I will be using the folder /minecraft for this tutorial.

We can create the /minecraft folder by executing the following command in SSH.

mkdir /minecraft

Now let's navigate to the created folder using the command below.

cd /minecraft

Once you have done that, we need to upload the Minecraft server JAR file to the /minecraft folder that we created. You can upload this file by using SFTP.

Now we need to create a screen to run our Minecraft server on, screens are used to run programs on background in Linux so when we exit out of SSH, the program will still run. Use the command below to create the screen.

screen -S minecraft

Now we can run the server using the following command and replace minecraft_server.jar on the command to the server JAR file that you are using:

java7 -Xms512M -Xmx512M -jar minecraft_server.jar (Change 512 for the amount of RAM you want to allocate the server, do not allocate more RAM than is allocated to your VPS)

Server will now start up and you will be able to access the server console. If you are running a 1.7 or newer Minecraft server, you will be asked to accept Minecraft Eula, login using SFTP and edit the eula.txt file on /minecraft folder and set "eula=false" to "eula=true".

Once you are done using the server console, you can detach the screen and keep the server running on background by using the following keys.

Control + A + D

And when you need access the console again, login to SSH and use the command:

screen -r minecraft
 


Was this answer helpful?

21
« Back