GUIDE Setting Up And Monitoring A Linux MineCraft Server

From Wifi Adapters DB
Jump to: navigation, search

Hello, I'm lDucks and this is my guide on how to run a Linux MineCraft server. I ran a server for about 8 months, I've been creating plugins for about 13 months, and I administrated a server for over a year. This guide may have some errors in it since even after rereading it and having other people reread it countless times, I still have to change little errors I find. I hope this helps others who don't know how servers work.



All the information in this guide has been compiled from my personal experiences and learned through my passion for CS. Enjoy.



This guide is to teach you how to set up and run a physical server. This guide doesn't address the running of a community, or running a website. This guide will only show you how to setup and maintain your server. You can either run a server on your own computer or rent a Minecraft host to host your friends. But if you wish to run one on larger scales, you will need to do much more work, which I will explain in this guide.



Prerequisites: Linux Server (This guide is for a Linux server. All commands are for CentOS, but they don’t differ from other Linux distributions.) Knowledge of Filezilla and another FTP client. Basic command line navigation (Windows and Linux, as long you know what a "terminal", and how to use its basic commands.



What you need to download: Latest craftbukkit build



This guide is set up in the order in which you will set the server up. It starts with step 1, and ends up with additional information that you will require after setup to ensure your server runs properly.



First, pick a server. If you plan to open a Minecraft Server, you should expect some investment. It is not a good idea for a server to be run from your own computer or on your network. To run a server you need to have the correct internet service provider and a proper server setup. I highly recommend that if you want to run a Minecraft server you start it up with a Minecraft host.



What is a Minecraft Host? Minecraft hosting has become so popular that there are now hundreds of companies offering Minecraft hosting. I won't get into how to manage a server from them, as they don’t have much functionality. Most use MCMyAdmin. If you have a server that doesn’t require constant maintenance (paintballs, hunger games etc.), then it is not necessary to use MCMyAdmin. You don't really need to read any further. You can get a host at $30 per month that will do everything and more. However, if you want to make a server that requires you to create CRON jobs, edit core files, install software, has more processing speed, etc. you will eventually need to get a dedicated server host. Once you've used 10GB RAM from an MChost, renting a dedicated host is usually more affordable than renting. Once you have 30 players on your server and are able pull in $100+ per months in donations, you should expand.



For those of you looking for good Minecraft hosts, I have had some good experiences with https://allgamer.net/ - I have supplied a list of Minecraft hosts at the end of this guide.



This is where you should start looking for dedicated servers. A dedicated server is not designed for Minecraft. It is a physical server that you can rent from the datacenter and use as you please. This guide will only cover how to operate a Linux-operated server. I highly recommend to anyone looking to run a Minecraft server to get a Linux dedicated host. This is a personal preference. A Windows server is fine, but there are no particular reasons to choose Linux. This guide is only for those who have a Linux box. You can skip this section if you don’t have a Linuxbox.



People are often concerned about the RAM requirements when selecting a server. According to many sources, you will need approximately 1GB RAM for every 10-20 slots of your server. This is a pretty good estimate to go by, but you have to remember that RAM is not the only thing that you need to worry about. You need to make certain your HDD is sufficiently large, your processor is efficient, and your internet speeds remain fast enough.



I had a very nice box when I was running my server: i73770 4 Core @3.4 Ghz with 32 GB RAM and 64 GB SSD, 32GB HHDD.



This is more than enough for a server to host 200+ users. This is something to consider when renting a box. A good host you may want to look into would be Choopa. Before you decide which host you want to use, it is a good idea to research other hosts. I have supplied a list of hosts at the end of this guide.



I recommend that you get a 16GB RAM box, 16 - 32GB HDD, 16 – 32GB SSD. There are so many processors out there that any one of them will do the job. These numbers are too high and you don’t necessarily need that much. If you're on a budget, you can go less. I would only recommend these numbers so you have some working space.



Setting Up Your Server Now that you have your box you may be wondering how to start it. You don't have the ability to open up your Windows Explorer and run the run.bat file you got off Bukkit's wiki. Unfortunately, it's a bit more complicated than that. First, upload your craftbukkit files to your server. I usually used the directory /home/SERVERNAME.



Next, create a file called begin.sh.



This code should be placed on the page: DO NOT CODE THIS CODE EXACTLY. Code: Java -server Xms10GXmx16G-jar craftbukkit.jar



Every box is different so you will need a different amount of RAM to provide to your server. As you can see, we have allocated the server 10GB extended memory and 16GB maximum heap size. DO NOT ALLOCATE ALL THE RAM. If you have an 8GB storage device, you should give it the following: -Xms4G or -Xmx6G. If you have a 16GB storage device, you should give it the following: -Xms8G or -Xmx12G. You can play around with the numbers. Make sure that you have at most 2GB of space left unallocated, and that Xmx is not larger than Xms. You will have other things running on your box, including the Minecraft server. So make sure you have enough space. There are many other options you can choose from depending on how you want the server to be handled by your processor. It is not necessary, but you can do some research in case you need something changed. ebookmarks



Upload this start.sh into the /home/SERVERNAME. This can be done using Filezilla. I'm going to assume that you already know how to use Filezilla or any other FTP client if you're setting it up a server.



Now, how do I run that script? Well, let me explain. I will show you how to use PuTTy. This method is easier than showing you how to connect to a terminal. PuTTY is ideal for any task you want to do on a server box.



Download PuTTy here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html



Open PuTTy, and enter the hostname. Let's use 108.61.45.74 for an example IP. You will want to use the IP of your Minecraft server. If you don’t know it, you can find it by logging into the server host’s website or contacting your serverhost. You can also use a URL to access the Minecraft server.



Next, you must enter the port. If you have not changed the port, it should now be port 22. Then you want to click the option "SSH" .. This is not the port for your Minecraft server. It is the SSH port.



You can now open the connection. Click "Open"



After you have done that, you will be asked to login. Your login name should be root if you weren't told otherwise. You can contact your host if you don't know what it is. After you have typed root, hit enter. Next, enter the password that you also received from your host. Then click the enter key. The password will not appear as soon as you enter it.



Now you want to make sure you have certain things installed on your box. You will need Java and MySQL, htop, iptraf, and other things. This guide will show you how to do it.



Installing Programs Here is command line for installing every program you will need. Keep in mind, not all Linux boxes will use the same format. These commands will work with a CentOS system. I realize that most people use Ubuntu (and now I do) but at the time I wrote this I was running CentOS. The commands for installing are similar. The following command line is available for CentOS users. You can also use the "aptget" command if you are using Ubuntu. For the correct commands, I recommend researching your distribution.



To verify that you can use rpm extensions, first enter the code: Code: yum - install rpm



32bit systems will require you to search for the RPMs yourself. The iptraf and htop links I have provided are for 64bit boxes.



iptraf: Code: yum install http://scriptmantra.info/sources/iptraf-3.0.0-5.el5.x86_64.rpm



htop: Code: yum install http://205.196.123.160/j785fw1gc80g/al1aaacqodltr1i/Htopbuild0056.yashua.rf.x86_64.rpm



You can find the guides for installing MySQL and Java by doing a quick Google search. I won't waste my time rewriting them.



JAVA: http://www.wikihow.com/Install-Java-on-Linux MYSQL: http://www.thegeekstuff.com/2008/07/howto-install-mysql-on-linux/



Start MySQL



Turning the Server on Well now I assume you're ready to turn this baby on and start installing plugins. To do this, you will need to open a screen (instance).

Screen is not pre-installed, so you will have to install it. Type: Code: yum screen

If the above command doesn't work, follow the next step. Move on to the next step if you have it installed.



Click this link to find the version you need. Then, enter the following two lines into your terminal:



Code: yum-y install ncurses -devel pam-devel textinfo libtool URL_TO_RPM



Now, the screen is installed.



To open a new screen, type the following into your command line Code: screen-S SERVERNAME



Replace servername with your server's name. When you run your screen you will want it to be the same name. This is to make it easy to remember which server is running on each individual instance. Once you do this a page should open up like this. I'm going to call my screen "WARCHICKEN" for now.



You are now on the screen. You want to now run your start script. You must first open the file.



You type: Code: cd /home/SERVERNAME



Since that is the path we decided to use earlier in this guide.



Now, type: Code:./start.sh



This will launch your server. ebookmarks This will start your server.



It means you did not chmod your start.sh file to 770. Please use this command to do so:



Code: chmod 770 /home/SERVERNAME/start.sh



Once the server is up, you can use this screen as a way to enter commands. You can detach by pressing CTRL+A+D.



You can use Code: screen –r WARCHICKEN to reconnect



-r is to connect -rd is to connect and kick anyone else who is attached off. Only one person can see a screen at once



You can also do Code : screen -list



to list all the open screens. To kill a screen, type Code: kill



The PID number is the number that is left of the screenname.



This number will change each time you reopen a window. If your server crashes, kill it and then reopen it.