HOW TO: Minecraft for the Ubuntu noob.

Post Reply
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

HOW TO: Minecraft for the Ubuntu noob.

Post by Vanderburg »

The following is a step by step process for starting a Minecraft server from your Ubuntu VDS or dedicated server. Do note that Minecraft is extremely I/O heavy and uses -A-LOT- of RAM (100MB per player, on average). Also, it does not like Open Java. So we'll cover that, too.

I'm going to assume that you are running a 64-bit version of whatever Ubuntu you are using. If you are not, you cannot allocate more than 2GB of RAM to the Java process, so this will limit you to around ~20 players max. I'm also going to assume you are an idiot. Not because you are, but because it will require me to explain everything, step by step, so hopefully there is no confusion later.

The first thing you want to do is get a good SSH client. I like PuTTY. Once PuTTY is downloaded, open 'er up and enter the IP address to your server and select "SSH". Once connected, you will be prompted with a, uh... prompt.

Okay, so let's get Java!

Enter the following line:

Code: Select all

sudo nano /etc/apt/sources.list
This will take you into the nano editor. If you scroll down you will see the following two lines:

Code: Select all

#deb http://archive.canonical.com/ubuntu maverick partner
#deb-src http://archive.canonical.com/ubuntu maverick partner
See those pesky little '#'s? Yeah, get rid of them. Watch as they light up when that comment is taken out. When this is done, press CTRL+X, then Y, then Enter.

Yay, now enter the following:

Code: Select all

sudo apt-get update
This will grab the package information from the repositories we just added so you can do the following line:

Code: Select all

sudo apt-get install sun-java6-jdk
We have now started the process to get Sun's Java 6 JDK (And the JRE) downloaded and installed. Still with us? Great! See how easy it is so far? Once that is downloaded, it will open up a big blue prompt screen. Hit tab, then Enter to get past the first one, then him left to get to Yes for the second one. Then it will install and you will be finished with the java step.

Yeah, I know, seems like a lot of work. But we're moving along!

Odie-dokie! No, make sure you're in your home directory by entering this:

Code: Select all

cd ~
Yep, that's the tilde. To get that symbol, hold SHIFT and hit the key just to the left of your 1 key. Once you are in your home directory, you're going to want to do the following series of commands.

Code: Select all

sudo mkdir mcserver
cd mcserver
wget http://www.minecraft.net/download/minecraft_server.jar
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
Yay! You just started the minecraft_server for the first time! You can see that it created your first world and, more importantly, generated a server.properties file, which is all we really wanted. Now that that is done getting you all hot and bothered, hit CTRL+C. Yeah, I know, we murdered your MC server. That's okay, now we are going to poke around in the server.properties file. Do the following:

Code: Select all

nano server.properties
Inside of here are a couple things we want to play with. You can ignore level-name, unless you're really OCD. If you want turn off monsters or animals (Poor piggies), change those flags to 'false'. If you want to bind your MC server to a specific IP address (So it will ONLY listen on that IP address), enter it on the server-ip line. If you want your people to run around in the Nether INSTEAD OF the regular world, set hellworld to 'true'. Now, the pvp line is important. If you do not want players to be able to kill each other, set this to 'false'. It it 'true' by default. If you are planning on running multiple servers on the same IP address, you'll need to edit the server-port line, too. Going sequential works here, 25565, 25566, etc. Finally, set max-players to the maximum number of players you want on your server at any given time.

Yay, Minecraft is configured-ish! (We won't get into hMod, Bukkit, McMyAdmin, etc here)

Last steps! Now, very importantly, you should run your Minecraft server in a screen session. This will let you do other stuff while the server is running. If you don't do this, it'll get pretty frustrating.

Code: Select all

sudo apt-get install screen
Once this is installed, go ahead and open it with:

Code: Select all

screen
then hit Enter. It'll open up a new 'window'. Now you are ready to take on the Minecraft world! Now, depending on how much RAM you want to give to Java (Depending on how many players you want) you enter the next line appropriately (I assume you want to use 4GB here):

Code: Select all

java -Xmx4096M -Xms4096M -jar minecraft_server.jar nogui
Congratulations, you are now running your Minecraft server. Keeping control of all the 11 year olds who want to run around on your server griefing with giant swastikas is now your main concern.
Post Reply