Screenshot of minecraftOne of the bad things with Minecraft (if there is such a thing), except being addicted is that you can't easily "click-and-play" online with your friends. In Counter-Strike, for example, you can host a server while you play using only two mouse-clicks - but how do you do you host a Minecraft Server?

Read on to get the full walkthrough of how to set up a Minecraft Server. 

The first step for setting up a Minecraft Server is getting the software (or binaries, if you'd like), which can be found here. The file you want depends on what system you're going to use, but the JAR-file always works (which is the one we're using). If you're not comfortable using  the command line and are using Windows, feel free to get the simple-to-use EXE.

Next step is to set up our environment for our Minecraft Server. As I am using Ubuntu on my netbook, I can't vouch for that this will work for other types, but I'm pretty sure, so keep that in mind. Bring up a terminal window and type "sudo apt-get install openssh-server", which will essentially install an SSH-server and give you the ability to remotely manage the Minecraft Server via SSH (you can use PuTTy to connect using Windows).

If you're like me, loving remote management, you'd also need an FTP server in order to transfer the minecraft_server.jar and to retrieve the installation later for backup purposes. Bring up the terminal and go "sudo apt-get install vsftpd". This will need a bit of configuration, so after the installation run "sudo nano /etc/vsftpd.conf" and set "anonymous_enable = NO", remove the "#" from "#local_enable=YES" and "#write_enable=YES". What this does is that it only allows users on your machine to connect (you login with your usual name and password) and allow them to write files.

You will need to install Java, since both Minecraft  and Minecraft Server uses it. "sudo apt-get install sun-java6-jre" should to the trick. As previously mentioned, I'm not sure what works for you, so if in trouble drop a comment or search for another way to get the runtime environment.

Alright - we're now set. Open PuTTy, enter the adress and log in. Write "mkdir minecraft" to create a folder named minecraft, this is were we'll put the Minecraft Server. Open up FileZilla (or another FTP client), log in, and transfer the minecraft_server.jar to ~/minecraft. If you have a world you'd like to import, place that folder inside ~/minecraft and rename it to "world". Bring up the SSH again and type "java -Xmx1024M -Xms1024M -java minecraft_server.jar nogui" to start the server. -Xmx sets the maximum amount of RAM java (minecraft server) can use, and -Xms sets the lowest amount (although it doesn't seem to allocate all of it at start). Minecraft Server will now create a new world if you didn't import one. Feel free to check if it works by joining it.

Just a few more things, almost there: write "stop" to shut down the Minecraft Server. This is important to do since it will make the server save everything to disk, although you could run "save-all" and then quit it however you like but I wouldn't recommend it. Run "nano" to edit the config, usually you don't need to do this, but it could be nice to see what's available. I only changed "online-mode" to false since I don't feel the need to authenticate users, mainly because I have a few friends who are running a hacked version. Some of them bought Minecraft after trying it out, so it's win for us and win for the developers.

Note that Minecraft Server is running on port 25565 by default, changing the port is okay, but then users will have to enter the port when connecting - i.e. "" - using ":" and then the port.

I think that's it! Happy mining and crafting!