Profile
GUIDE: Setting Up And Monitoring A Linux MineCraft Server 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. Although I have reread the guide many times and had it read by others countless times, there are still errors. I hope this helps those who don't have the knowledge to run servers. All the information in this guide are things I have picked up in my experiences and learned through my love for CS. Enjoy. This guide will teach you how set up and maintain a physical server. This guide does NOT cover how to run a community or a website. This guide will show you how to set up and monitor your server, and how to make sure that the backend runs smoothly. 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. Download the latest craftbukkit build This guide is designed to be used in the same order that you will set up the server. It starts with step 1, and ends up with additional information that you will require after setup to ensure your server runs properly. First, you need to choose a server. If you want to open a Minecraft server, you should expect to invest some money. It is not a good idea to run a server from your personal computer or even your network computer. You need the right internet service provider and the proper server setup to run a server. If you want to start a Minecraft server, I recommend you do so with a Minecraft host. What is a Minecraft host? Minecraft has grown to the point that there are hundreds upon hundreds of companies dedicated to hosting it. I'm not going to get too into how to run a server from them because you don't have much functionality and most of them use MCMyAdmin. If you are running a server that does not require constant maintenance (paintball, hunger games, etc.) You don't have to read anything beyond this. A host can be yours for as low as $30 per month and will do all you need. If you need to create CRON jobs and edit core files, install software or have a faster processing speed, you will need a dedicated server host. A dedicated server host is what you will eventually need. Once you've used 10GB RAM from an MChost, renting a dedicated host is usually more affordable than renting. Once you get past ~30 players on your server and you're able to pull in $100+ per month in donations, you need to 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 start looking for dedicated servers. A dedicated server isn't made for Minecraft. It is a whole server that you can rent at a datacenter to use as much as you want. This guide will focus on how to manage a Linux-operated server. Anyone who wants to run a Minecraft server should get a Linux dedicated host. This is a personal preference. There is no reason to choose Linux over a Windows server. This guide is only for those who have a Linux box. If you don't have a Linux box, you can stop reading now. People are often concerned about the RAM requirements when selecting a server. I've read in many places that you need about 1GB of RAM for every 10-20 slots on your server. This is a great estimate, but it is important to remember that RAM is just one aspect of what you need. You must ensure that your HDD is large enough, that your processor is fast enough, and that your internet speeds are sufficient. I had a nice box when I was running a server: i73770 4 Core @ 3.4 Ghz 32 GB RAM 64 GB SSD, 32GB HHDD. This is enough to run a server for 200+ people. When renting a box, take this into account. Choopa is a good host. Before you choose a host to use, I recommend you do some research. I have supplied a list of hosts at the end of this guide. I recommend a 16GB RAM, 16 - 32GB HDD and 16GB SSD box. There are so many processors, that any processor you get will likely do the job. These numbers are inflated and you don't need as much. If you are on a budget, you may be able to go lower. These numbers would be recommended if you have enough space to work. You may be wondering how you can set up your server now that you have it. You don't have the option to open your Windows Explorer and run run.bat from Bukkit's Wiki. Sadly, it is a bit more complicated than that. Upload your craftbukkit file first to your server. I used the directory: /home/SERVERNAME. Next, create a file called "start.sh". This code should be put on that page: DONT COPY THIS CODE EXACTLY. Java -server.Xms10G.Xmx16G.jar. Every box is different so you will need a different amount of RAM to provide to your server. Above, we are giving the server 10GB of extended memory and 16GB for the maximum heap size. DO NOT ALLOCATE ALL YOUR RAM. If you have an 8GB box, you should give it -Xms4G and -Xmx6G, if you have a 16GB box you should give it -Xms8G and -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. There will be other applications running on your machine, so make sure to leave enough space. There are a bunch of other options that you can add depending on how you want your processor to handle the server and what not. That isn't important but you can do some research if you need things changed. Upload this start.sh into the /home/SERVERNAME. This can be done with Filezilla. I assume that you are familiar with Filezilla (or other FTP clients) if you are setting up a server. How do you run the script? Well, let me explain. I'm going to teach you how to use PuTTy. This method is easier than showing you how to connect to a terminal. PuTTY can do almost anything on your server box. Download PuTTy here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Open PuTTy and enter the hostname, lets use 108.61.45.74 as an example IP. You will want to use the IP of your Minecraft server. If you don't know the IP of your Minecraft server, you can log into your account at the server host's website. Or contact your serverhost. To access your Minecraft server, you can use a URL. Next, you need to enter in the port. If you haven't changed the port it should be port 22. Next, click on the option "SSH". Note, this is NOT the port of your Minecraft server. It is the SSH port. Next, click "Open" to activate the connection. Click "Open" Once you do that, you'll be prompted for login. If you were not informed otherwise, your root login name should be root. minecraft servers You can contact your host if you don't know what it is. After typing root, press enter. Then enter the password which you should also have gotten from your host. Then click the enter key. The password will not appear as soon as you enter it. Now, you need to make sure that you have certain things on your box. You will need to have a lot of things such as Java, MySQL, htop and iptraf. I will explain how to do this in this guide. Installing Programs Here is command line for installing every program you will need. Remember that not all Linux boxes have 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 is not much different. For CentOS, you can use this command line. If you are using Ubuntu then you can use the "apt-get" command. For the correct commands, I recommend researching your distribution. First enter the following command to make sure you can use the rpm extension: Code: yum install rpm You'll need to manually find the RPMs if you're running 32bit. 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 For installing MySQL and Java you can get those guides with a quick Google search, so I'm not going to waste 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 Now, I assume you are ready for the server to be turned on and you can start installing plugins. To do this, you will need to open a screen (instance). However, screen does not come preinstalled and you will need to install it. Type: Code yum install screen If the above command fails to work, proceed to the next step. Move on to the next step if you have it installed. Go to this link and find the version for your distribution. 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 has been installed. To open a screen, you will need to enter the following code into the command line Code screen -S SERVERNAME Obviously, replace servername with the name of your server. 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 have done that, you should see a page like this. For now, I'm going with "WARCHICKEN", as that is what my screen looks like. Now, you're on the screen. Now you need to run your script. First, you need to open the file. Type: Code cd /home/SERVERNAME We chose this path because it is what we used earlier in the guide. Now, type: Code:./start.sh This will start your server. You will receive the following message. This means that you didn't chmod your start.sh 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. If you want to reconnect you can type Code: screen -r WARCHICKEN screen -rd WARCHICKEN -r stands for "to connect" -rd stands for "to kick and connect anyone else who is attached off." One person can view a screen simultaneously You can also do Code : screen -list To list all open screens, type: Code: kill -9 You can kill any screen by typing Code: kill -9 The PID number is located to the left side of the screen name. This number will change each time you reopen a window. If your server crashes, you need to kill the screen and then reopen it.
Forum Role: Participant
Topics Started: 0
Replies Created: 0