How To Set Up A Minecraft Server On Linux
Apart from being addictive, one of the problems with Minecraft is that you can't "click-and–play" online with 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 need depends on the system you use, but the JARfile works every time (which is what we are using). If you don’t feel comfortable using command line and are using Windows please download the easy to use EXE.
Next is to create the 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. Open a terminal window. Type "sudo-apt-get install openssh server" to install an SSH-server. You can remotely manage the Minecraft Server using SSH (or PuTTy to connect via Windows).
If you love remote management and are like me, you will also need an FTP Server to transfer minecraft_server.jar. Also, to retrieve the installation later, for backup purposes. Open a terminal and type "sudo:apt-get install Vsftpd". You will need to configure this. After the installation, run sudo nano /etc/vsftpd.conf and set "anonymous_enable=NO" and remove the "#" from the "#local_enable=YES and "#write_enable=YES". This will allow only certain users to connect to your computer (login using your usual name and password), and allow them to create files.
Java is required for Minecraft Server and Minecraft Server. "sudo:apt-get install sunjava6-jre should do the trick. As I mentioned before, I don't know what works for you. Please leave a comment or search another way to get the runtime environment.
We're done. Open PuTTy and enter the address to log in. To create a folder called "minecraft", write "mkdir". This is where the Minecraft Server will be stored. Log in to FileZilla or another FTP client and copy the minecraft_server.jar file to /minecraft. If you have a world that you want to import, place it inside /minecraft. Bring up the SSH again and type "java -Xmx1024M -Xms1024M -java minecraft_server.jar nogui" to start the server. -Xmx defines the maximum RAM java (minecraft servers) can use. –Xms defines the minimum amount. However, it doesn't seem that it allocates all of it at startup. Minecraft Server will now create another world if it hasn't already. Feel free to check if it works by joining it.
To close the Minecraft Server, you will need to write "stop". This will save the server to disk. You can also run "save all" to quit the server, but I don't recommend it. To edit the config, run "nano service.properties". This is not necessary, but it can be useful. 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 testing it out, so it's win-win-win for us all and win for developers.
Minecraft Server is currently running on port 555565 by default. minecraft It is possible to change this port, but then users will need the port number to connect - i.e. "192.168.0.111;xxxxxx" can be accessed by using ":", followed by the port.
That's it, I think! Happy mining and crafting!