Starting your own Minecraft server on Ubuntu 14.04
I first started playing Minecraft when the game was released in beta many years ago. Since then, I've played on very small multiplayer servers over the years. After a years abscence of playing, I recently got into Tekkit. Tekkit is a custom Minecraft launcher allowing you to easily manage the hordes of Mod packs out there. Minecraft has really come a long way over the years.
Although the MC community has created a lot of goodies, lets walk through how to set up your own Minecraft server! This post will walk through how to create the basic MC set up, or "Vanilla" server. So brush up on your Linux commands and let's get started.
If you have a decent machine that can be dedicated to MC then you are ready to get started. You can get away with running MC on a box with a gig of ram, but I recommend at least 3gigs. 2 gigs allocated for MC, and the rest for the system.
em1 Link encap:Ethernet HWaddr 3c:d9:2b:06:d5:26
inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::3ed9:2bff:fe06:d526/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3565798 errors:0 dropped:55 overruns:0 frame:0
TX packets:9498648 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:2566142317 (2.5 GB) TX bytes:12535889946 (12.5 GB)
Write down the IP number. In the example above, the IP is 192.168.1.4.
We are going to need a few tools in order to administer our server. Assuming you want to run the server "headless" (without a keyboard/mouse/monitor), we will need the following tools so the server can be maintained remotely.
sudo apt-get update
sudo apt-get install openssh-server
*press Y to install at prompt
Now that SSH is installed. The monitor/keyboard/mouse can be removed from the system. Hop on another computer and download a ssh program such as PuTTy if on Windows, or use the terminal in Mac/Linux. Issue this command:
ssh your-ip or ssh username@your-ip-number eg: ssh firstname.lastname@example.org
Your screen should look something like this when you log in:
You are now in the new MC server! Now lets set up FTP, create a Minecraft direcory, and download the server files.
Install FTP to transfer MC server files and use later to upload any other files you may need in the future.
sudo apt-get install vsftpd
Edit vsftp.conf file:
sudo nano /etc/vsftpd.conf
Change the following:
anonymous_enable=YES to NO
add to the bottom of the file force_dot_files=YES.
sudo service vsftpd restart
Create Minecraft directory:
Lets put the MC directory in root (where home, var, etc reside).
cd / *Will change the directory to "root".
sudo mkdir minecraft
Now that we have ftp installed, and our Minecraft directory created, lets create a shortcut in your user folder (for when you ftp into server and have a shortcut to the MC folder).
sudo ln -s /minecraft ~/minecraft
sudo apt-get update
sudo apt-get install openjdk-7-jre
Now do one more final reboot before installing the MC server files:
Download the files to your machine and upload using the newly installed FTP service!
Download the .jar server from the Minecraft website.
Now upload to the /minecraft directory.
sudo wget url_to_minecraft.jar
Make sure you go to the Minecraft website and copy the download link to the latest server file.
Navigate to the /minecraft directory: cd /minecraft
cntrl a + d gets out of the Minecraft console to the linux prompt
You are all set! A couple more things, the command above, Xmx1024M, is where you can set the amount of ram you want allocated to Minecraft. 1024 mb is in the example, so if you would like more, be sure to adjust and leave enough for your system to run.
Open the Minecraft game, select multiplayer, and add a new host with the IP you wrote down in the earlier step!
Lastly, if you want to be able to share the server to friends, etc. You will need to forward the port MC uses in your router. Minecraft's default port is 25565.
Thanks for reading! Leave a comment if something is not clear or I missed something.
--Drew D. Lenhart