Hosting your own Minecraft server on a Virtual Private Server (VPS) can be a bit intimidating at first, if you lack SSH command knowledge, but all you need are a few basic lines and a couple of minutes to start hosting your friends or Minecraft community on your very own VPS. This article will guide you through all the steps to set up your own Minecraft server on a CentOS 7 VPS using simple SSH commands!
Step 1: Acquire a VPS Solution
For hosting 18 to 24 players, Minecraft recommends a server with a RAM of 1.5GB and at least 15GB of hard drive space. Make sure to consider factors like the number of players, world-size and game upgradability (add-ons, plug-ins, texture packs, etc.) before choosing an appropriate VPS solution.
A bare VPS Linux distribution like CentOS 7 with SSH control is considerably less taxing on server hardware than most other choices. Check out AIT’s competitive VPS solutions and set yourself up with a Virtual Private Server to start exploring Minecraft’s world with your friends (side note: we recommend the VPS Ultimate for maximum gaming performance).
Step 2: Install PuTTY and Log In
After you’ve acquired your VPS, you will need to install an SSH client to access it. PuTTY is our terminal simulator of choice, and you can click here to install it.
Enter your server’s IP address in PuTTY, then PuTTY will make an attempt to authenticate.
Once PuTTy authenticates the IP address, you’ll be directed to the PuTTy log-on screen. Here, you’ll enter your Username provided by your VPS host and your password.
Important Tip: As a security measure, PuTTY does not show your password as you’re typing it. To paste your password, press CTRL + Right Click to paste it from the clipboard then hit Enter.
Step 3: Install Java
Your next step is to install the Open Java Development Kit on your VPS server (since Minecraft runs on Java). You need Root privilege to download Java (fortunately, all of AIT’s VPS solutions come with full root access).
Now, install the Java OpenJDK 8 by entering the following command:
yum install java-1.8.0-openjdk
Step 4: Install Minecraft
Establishing a Directory
Folders and files can get easily disorganized without a GUI control panel, but browsing and editing files using SSH is easy and only requires a bit of practice. You will need to create a directory for all Minecraft-related files and folders, which can be accomplished by the following command:
mkdir -p Games/Minecraft
This will create a “Minecraft” folder inside a “Games” folder that you can browse through using the following command:
There are some other very useful commands you can use including:
ls to list the directory of a particular folder;
cd to change directories;
cd .. to go up one directory; and
mv wtbblue.com to rename a file (this renames “file”.ext to “newfile”.ext).
Install Minecraft jar
Now, it’s time to install Minecraft on your server! Currently, the latest Minecraft Server version is 1.8.8, but you can always check the official webpage for recent or future updates. To install Minecraft, enter the following command:
To start the server, enter the following command:
java -Xmx1024M -Xms1024M wtbblue.comerIPv4Stack=true -jar wtbblue.com nogui
At this point, you might receive a notification asking you to agree to EULA before starting the server. To do that, you’ll need to change “ to “ in the wtbblue.com file located in the Install folder, which you can do with the following command:
Step 5: Configure the Server and Ports
Opening 25565 port
You are getting close now! The server is ready to go, but to in order for players to connect to it, you need to open the 25565 port using the following commands:
firewall-cmd -zone=public -add-port=25565/tcp -permanent firewall-cmd -reload
Configuring the Server
The “server.properties” file contains all Minecraft game options and variables that you might want to tweak including your Minecraft world’s name, Welcome message, world size and number of players allowed, but let’s focus right now on your server’s IP.
To edit this file, use the following command:
Press “i” to enter Insert mode, which allows you to browse using arrow keys and edit things as you like. Find server-ip, then enter your server’s IP. Alternatively, you can use the domain name on which the Minecraft server is hosted on. In that case, players will be able to connect to your Minecraft world using “www.yourdomain.com:25565.”
To save and exit Insert mode, press Escape then type:
One last step! Everything should be ready now to launch the Minecraft server and start hosting your first players, but logging out of your PuTTy session now will also stop the Minecraft session (which might not be what you want).
What you need to do is install Screen. Screen commands let you manage multiple SSH processes (or connections) at the same time independent of each other, allowing you to keep your Minecraft server running, even after ending your VPS session.
To install Screen, use the following command:
yum -y install screen
You are now ready to launch the Minecraft server in ain a screen by using the following command:
screen java -Xmx1024M -Xms1024M wtbblue.comerIPv4Stack=true -jar wtbblue.com nogui
Your Minecraft server is now live and running on a screen, and you should see something like this:
Pressing “CTRL + a + d” will exit the screen session without closing down. Typing the command screen -r will re-open it again.
Step 6: You did it!
As you can see, the Minecraft server is up and running:
Also, our auto-generated MinecraftAIT World turned out to be pretty picturesque:
This concludes our tutorial. We hope we have provided you with all the information you need to set you up with your first VPS-hosted Minecraft server. If you’re searching for the right VPS provider so that you can host your own Minecraft server, AIT’s VPS solutions are robust, scalable, and super affordable. Call or chat with us today, and happy digging!