Setting up your own Craftbukkit Minecraft server on a CentOS Server at Rackspace Cloud

So, this is a step by step tutorial for setting up your own craftbukkit minecraft server on RackspaceCloud. I've been running it now for about 2 weeks. I had 6 players on a 256mb server and it was pretty good so we setup camp and began building and expanding. It wasn't until someone left the base map and expanded into another biome that we started noticing lag. By that point, we decided to upgrade the server to 512mb.


We're up to 8 players now and it is running just fine. When it was 256mb, the bill came to about $2.20 something for the entire week. We upgraded this past Saturday to 512mb and the bill restarted (after the previous was paid) and is now over $3.20. Definitely a difference in price, but since my wife and I no longer play WoW that money will come out of our entertainment fund. It'll be interesting to see what a final monthly bill is like and what the next wall of lag we run into (if we do).

Setting up with Rackspace is rather easy, my only annoyance is that they had to call me to verify the account setup. I really don't want to talk to a human being about anything unless when I need to. The family wanted me to set this up so that we can play with friends elsewhere.

So, without further ado, the steps it took to get here:
  1. Sign up for an account at Rackspace. Make sure that you check Cloud Servers (Cloud Files automatically comes with the package). This form looks scary because you don’t actually know what the hell you’re signing up for or how much it is going to cost, but... fear not. It doesn’t cost you anything until you get things going.
  2. Finish out the account & billing form. Review the order and make sure everything looks correct. Now comes the disappointing part of this whole process. Rackspace has to call you to finish your order. No idea why. Slicehost never bothered me. Don’t bother logging into the control panel until you get that phone call. There’s nothing there for you to do.
  3. The phone call takes mere minutes to verify the address, etc. In the end, they’ll ask what you’re using the rackspace account for. I told them “Personal stuff” and left it at that. Whole process above took less than 30 minutes, but getting a phone call definitely took longer than 10 minutes.
  4. Sign into your account ( https://manage.rackspacecloud.com/pages/Login.jsp ) and click the Hosting link on the left, then Cloud Servers.
  5. Click Add Server.
  6. At this point, you get to pick the operating system of your choice (and, there’s plenty here to chose from CentOS, ArchLinux, Debian, Fedora, Oracle, Redhat, Ubuntu - There’s also Windows, but I believe it is more expensive and takes longer to setup). I selected CentOS 5.6
  7. Name your server and for now, we’re going to chose the 256 MB server size ( I ran this server full time with 6 players just fine for about a week before upgrading to 512MB ).
  8. At this point, your server is going to start building. You’ll get an IP address and a password to login as root. You’ll also get this information via your email address that you assigned to your account as well.
  9. Fire up your favorite SSH client (Don’t have one? use PuTTY - http://www.chiark.greenend.org.uk/~sgtatham/putty/ ) and login with the credentials given to you.
    1. At this point, I suggest hardening the box and locking down security.
    2. Change root password. Type: passwd and change it.
    3. Extra Credit if you’re familiar with CentOS:
      1. Stop using root account and setup your new account with the appropriate sudo privileges.
      2. Forbid root from logging in via sshd_config.
      3. Change the ssh port from 22 to something you'll use.
  10. At this point, bare-bones CentOS box, I type: yum update to grab all the latest CentOS updates. Download the updates and let the patcher patch everything.
  11. You’ll need to install java: yum install java will install (as of this writing) java-1.6.0-openjdk-1.6.0.0.-1.23.9.10.e15_7.x86_64
  12. You’ll also want to install a program called screen: yum install screen
  13. You’ll need to poke a hole into iptables for Minecraft port:
    1. iptables -A INPUT -p tcp --dport 25565 -j ACCEPT
    2. /sbin/service iptables save
    3. service iptables stop
    4. service iptables start
  14. Now we’re ready to install bukkit stuff! Pat yourself on the back, you’re halfway there. Huzzah!
  15. Make the minecraft directory where ever you want. This tutorial uses /minecraft - depending on how OCD you are, I suggest perhaps /opt/minecraft
    1. mkdir /minecraft
    2. cd /minecraft
  16. Download the latest craft bukkit:
    wget http://ci.bukkit.org/job/dev-CraftBukkit/promotion/latest/Recommended/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar
  17. mv craftbukkit-0.0.1-SNAPSHOT.jar craftbukkit.jar
  18. Next we’re going to create a startup script:
    1. vi serverstart.sh
    2. Type: i (to insert into the document)
    3. Copy/paste into the document:
      #!/bin/sh
      java -Xincgc -Xmx200M -jar craftbukkit.jar nogui
    4. Type: :wq save and write the file.
    5. Type: chmod u+x serverstart.sh to make it exectuable.
  19. Startup Minecraft for the 1st time! Type: ./serverstart.sh
  20. At this point, a bunch of junk will be spit out to the screen and your new world is being created with spawn points, etc. You’re left sitting at a cursor that looks like: >: (blinking cursor). Don’t sign off, don’t do anything just yet. Login to your minecraft server through your minecraft (client) and make sure everything is up and running. Once you’ve confirmed that stuff is running, disconnect from the minecraft server with the minecraft (client).
  21. Go back to your telnet client and at the >: prompt, type: stop and you should see the the craftbukkit shutting down.
  22. When you’re back at the main linux prompt, from here, you’re going to want to start configuring your server. You can edit your server.properties file to make changes to the game. You can modify the white-list.txt to register only players that you want allowed to log into the server. The ops.txt file is where you’d put all the names of players that you want to act as ops (operators).
  23. You’re essentially on your own now.
Pro-Tip: Eventually, after you have everything setup the way you want it, you’re going to be tempted to just start-up the server again so you can play. The thing is, unless you leave that telnet window open, every time you disconnect from the telnet server, your minecraft server will come down as well. This is where screen comes in handy.
  1.  
    1. Type: screen
    2. Navigate back to your minecraft directory: cd /minecraft
    3. Now start-up the server: ./serverstart.sh
    4. When the server is done starting up, you’ll want to detach from that screen session by hitting  CNTRL-A and then type: d
    5. You’ll know you’ve done this correctly when you see [detached] onto the screen and you’re back at a linux prompt.
    6. What you effectively have done is telneted to localhost, logged in and started up the server and detached yourself from that login to let it run as a process.
    7. Should you need to reattach yourself to that process (to shut it down or whatever), then you would type: screen -r and it will reattach you to the minecraft screen again.

 

David Boyer

David Boyer wrote on 11/15/11 11:16 AM

Great guide :) I've recently gotten into Minecraft and loving it so far. Shocked at the low price of running a server for it, especially as it could be spread between primary players.

Wonder how many Minecraft'ers there are in the ColdFusion community...
Rob Dudley

Rob Dudley wrote on 11/15/11 3:10 PM

Nice guide! and amazed that Minecraft runs that well on 256 MB.

Considering adding my own guide for AWS and Debian just to compare & contrast :o)

Oh and David - I'm plus one for CFMineCrafters
Sid Wing

Sid Wing wrote on 11/23/11 9:03 AM

Indeed - great guide - bookmarked for later - and +1 CFMineCrafter

Leave a comment


(required field)

(required field)