How To Install Minecraft Server Onto Ubuntu 11.10?

Home sweet home - in minecraft

Home sweet home - in minecraft (Photo credit: Larry and Laura)

I didn’t know anything about Minecraft, and I still don’t.  Nonetheless, someone has asked me how to install Minecraft server onto Ubuntu, and so I showed him how to do so.  Since now I knew how to install Minecraft server onto Ubuntu 11.10, I thought it would be a good idea to write about it.  It is simple to install Minecraft server onto Ubuntu 11.10 really!

You can either follow the instruction from minecraftwiki.net/wiki/Tutorials/Setting_up_a_server or you can follow mine here, because I actually had to use Minecraftwiki as the source of knowledge on how to install Minecraft server onto Ubuntu 11.10.

Steps:

  1. Are you running Ubuntu 11.10?  Make sure you are, and then follow the step number 2.
  2. Opening up a terminal and becoming root by executing this command [sudo -i], but do not use the square brackets as part of your command line — square brackets are there to only clarify the command line.
  3. Inside terminal as root, type in this command [add-apt-repository ppa:ferramroberto/java].  This command is to add a ppa repository which contains sun-java6-jre software.  Using this ppa repository, you can now install sun-java6-jre easily through apt-get or aptitude.  I guess Minecraft server requires sun-java6-jre to be installed before you can launch Minecraft server.
  4. Since we have added a new ppa repository.  Now we should just update our aptitude database by doing this command as root [aptitude update].
  5. Now aptitude’s database is up to date, we should now be able to go ahead and install sun-java6-jre.  Let do this command as root [aptitude install sun-java6-jre].
  6. Now, we need to tell Ubuntu system to insert sun-java6-jre into user’s home path by doing this command as root [update-alternatives –config java].  You need to choose the selection that emphasizes sun-java6-jre specifically.
  7. Since we now have sun-java6-jre installed, we can now go to Minecraft official website and download Minecraft server software.  Make sure you are downloading the Minecraft server version that is to be used with Linux operating system, OK?
  8. Hopefully, you remember where you have downloaded minecraft.jar file to.  You need to change into the directory that you have downloaded the minecraft.jar file.  Now, execute this command [java -Xms1G -Xmx1G -jar minecraft.jar nogui] as the user who has the privilege to run server on your system.  Usually, preferable users are nobody (i.e., user apache is for running web server) and normal user.  Don’t run Minecraft server as root, because Minecraft server might have exploitable codes and allow hackers to escalate to root privilege by exploiting the faulty codes of Minecraft server — with root privilege, hackers will be able to do anything to the entire Ubuntu system.

Note:  If your server isn’t having enough RAM, then you should read the instruction at minecraftwiki.net/wiki/Tutorials/Setting_up_a_server to know how to solve the RAM and SWAP problem OK?  The command [java -Xms1G -Xmx1G -jar minecraft.jar nogui] has two parameters (-Xms and -Xmx) and by adding the free/available RAM amount of a system to these parameters, this action might allow a Minecraft server administrator to control how much RAM a Minecraft server would hog (i.e., use).  So, in a sense, you can manipulate this command line’s parameters to make Minecraft runs smoothly — depending on how much RAM your Ubuntu 11.10 system has.

Source:  http://www.minecraftwiki.net/wiki/Tutorials/Setting_up_a_server