Software Installs

How To Build a Minecraft Server on a cPanel VPS

So you want to build your own Minecraft server? Minecraft can be a pretty easy game to set up on a VPS. It just requires a few quick commands before you’re on your way to survival/adventure/creativity!

Note: This guide is specific to CentOS cPanel servers, but can be followed for a non-cPanel server as well. Also, this tutorial assumes you are familiar with working on the command line on your server via SSH. If you’re not, you might want to check out this article first to get your feet wet.

Also note: This tutorial does not include purchasing and installing the Minecraft stand-alone launcher. If you are new to Minecraft, download the launcher here to connect to your Minecraft server installation.

Without further ado, here are the steps to install Minecraft on a cPanel VPS:

Step 1: Install Java

Minecraft is a Java-based game and so we will need to install Java. cPanel offers Tomcat, which runs Java, but I would recommend installing it via the command line. You will need root-level access to the server to install Java. Here is how to set up a cPanel account that can escalate to root.

Once in the server as root you should install either java-1.6.0-openjdk or java-1.7.0-openjdk:

yum install java-1.7.0-openjdk

Substitute java-1.6.0-openjdk in the yum install command if that is your preference.

Step 2: Configure your server

Now lets prepare for the game itself. The next few commands will create a Minecraft directory in the account where we want to host Minecraft and take us to the new directory:

mkdir -p /home/account/Minecraft

(Where /account/ is the name of the account in which you wish to install Minecraft.)

cd /home/account/Minecraft

Step 3: Download and start Minecraft

  1. Download the game with the following command:
wget https://s3.amazonaws.com/Minecraft.Download/versions/1.7.2/minecraft_server.1.7.2.jar
  1. Rename the file:
mv minecraft_server.1.7.2.jar minecraft_server.jar
  1. Start Minecraft in Java:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

The version at this time of writing is 1.7.2, but the process will remain the same with future versions. You can find out the latest version by visiting the Minecraft download page.

Step 4: Relaunch Minecraft

Now you should see from the rolling text on the command line that the game is starting and generating the world. This confirms that you have successfully installed Minecraft, but there are a few things we should do before we log in and start crafting and mining. The first thing is… stop the Minecraft server and restart it in a screen so we can log out of the VPS without stopping the game.

stop
screen
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

Now Minecraft is running in a screen, which means you can exit the server without the game closing on you. You can do this by detaching the screen:

[ctrl] + a
[ctrl] + d

If done successfully you should get a message that says [detached]

If you don’t want to alter the default settings, you are now done. If you do, read on…

Step 5: Configure Minecraft

If you want to get a little deeper into the Minecraft setup you can add the IP for your server, your world name, or the message of the day.

  1. To make any configuration changes you will need to stop the game though, so re-attach the screen:
screen -r
stop
  1. Then you will want to edit at least the server.properties file and probably the opts.txt file.

Note: If you want to edit the files via FTP or cPanel you may need to change their permissions. If you do, run: chown -R account:account /home/account/Minecraft

The ops.txt file controls who has administrator powers while in the game, so place the Minecraft accounts you want to have administrator power in that file. The server.properties file is the big one, it is going to have game options and settings in there. The settings I am going to set are:

level-name=ServInt
server-type=LARGEBIOMES
server-ip=207.58.132.171
pvp=false
motd=Welcome to Minecraft
  1. There are lots of other options that you may set: whether or not you have the nether, level-seed to generate a specific Minecraft map, and game mode are just a few examples. Here is a link to all of the options and their settings.
  2. After you have your server configured, it would be wise to create an init script to easily restart the game and make it so that you can restart it on boot. Check out this template for just such an init script. You must edit it and place the init script in /etc/init.d/ . It will not work if you simply copy/paste it.

The fields that you need to edit are:

USERNAME=
WORLD=
MCPATH=

The USERNAME field will be the cPanel account that you have Minecraft installed in, WORLD is the name of the world/directory, and MCPATH is where your Minecraft installation is, something like /home/account/Minecraft. You can then start, stop, restart and set it to start on boot with these two commands:

/etc/init.d/minecraft restart
chkconfig minecraft on

You can check your work by using chkconfig --list. Then you can start the server back up and log in to the game.

In case you’re interested, the Minecraft server I set up that a bunch of us play on at ServInt is available on IP 207.58.132.171. Come and join us.

Final note on support: This software falls outside the scope of support we provide for our managed products at ServInt. With that said, we have several employees that are enthusiastic about Minecraft. While we cannot guarantee results, nor a timely response, these employees are typically happy to look over a problem if you submit a ticket in your customer portal. ServInt also recommends no less than a Signature VPS to run Minecraft, due to the stringent memory requirements.

Photo by Daniel Jurena

 

Find out more about ServInt solutions

Starting at $25

Comments
  1. I don't use Bukkit, but Bukkit is the way to go for public servers. I usually only play Minecraft with a small group of friends and we all use vanilla Minecraft. Bukkit has the advantage of having mods that allow for tighter control of the server, but it is usually behind when it comes to patches and in my limited experience it requires more resources. Server resources is also likely the issue that you are running into, java is pretty demanding when it comes to RAM.
  2. Thanks, Bill for getting back to me so quickly. I think I've got it running now but am testing the client on an older pc at home and it seems if my user crashes mc i have to restart the server and/or the mc server via java to reconnect. i can't get the script for restarting referenced in your tut to work and am a terminal noob. I saw you mentioned a bukkit tut coming soon. is bukkit the way to go i.e. is it an interface or what else does it offer? thanks.
  3. It sounds like it may be an ownership issue, are the files owned by the cPanel user? Without changing the ownership the files will be owned by root:root.
  4. I should add I've only completed up until Step 5 as I don't really know to access those files. thx.
  5. Hi, First off - thanks for this awesome tutorial! I'm trying to setup a MC server for my son for his 12th birthday on a Linus VPS w/CPanel and I can see that the files install ok via Putty, however, cannot view the files via FTP and when attempt to connect, get a Server Connection Error in the Dev Console of the Launcher. Any suggestions for this noob? Thanks :) Jen
  6. Control over griefing and permissions. Nice to always see guides to help people get things setup.
  7. You should post something on setting up a Bulkit server also. I think most Minecraft servers don't run Vanilla, due to the lack of c
  8. Just a few quick commands and you’re on your way to survival/adventure/creativity with #Minecraft on a VPS! http://t.co/r7Vx4h53Ed
  9. Want to play Minecraft on your VPS Server? Learn how, this week in the #TechBench. http://t.co/r7Vx4h53Ed
  • Hosting Advice
  • The New York Times
  • The Hill
  • Bloomberg
  • The Seattle Times
  • Computer World
  • Ars Technica
  • MSNBC

To engage with the ServInt Sales Team use the following chat icon. Normal sales hours are Monday-Friday 9am-5pm EST but feel free to leave a message and we will follow up as soon as possible.

Sales Chat



To engage with the ServInt Support Team you must be logged into our Customer Portal for identity verification and have a ticket opened about your request or there will only be limited support offered.

Support Chat

CLOSE