Return to site

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 managed a server over 8 months. I've been creating plug-ins for almost 13 months. And I was the server administrator for over a full year. There may be some errors in this guide. Even after reading it many times and having it reviewed by others, I still have to correct any errors that I find. I hope this helps others who don't know how servers work. All information in this guide is based on my own experiences and learnings from CS. Enjoy. This guide will teach you how set up and maintain a physical server. This guide does not include any information about running a forum or website. This is just how to setup and monitor your server and make sure the backend is running smoothly. You can either run a server on your own computer or rent a Minecraft host to host your friends. However, if you want to run one on a larger scale, you will need to do a lot more work that I will explain in this guide. Prerequisites for Linux Server (These commands are for CentOS only, but they can be used with other Linux distributions). Knowledge of Filezilla or another FTP Client Knowledge of basic command-line navigation (Windows or Linux) 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, choose a server. You should expect to spend some money if you open a Minecraft Server. Running a server off your own personal computer, even a computer on your network, is not a good idea. You need the right internet service provider and the proper server setup to run a server. 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 are running a server that does not require constant maintenance (paintball, hunger games, etc.) then you really don't need to read much past this. You can get a host at $30 per month that will do everything and more. You will need to create CRON jobs, modify core files, install programs, and have more processing speed. you will eventually need to get a dedicated server host. Usually once you get past ~10GB of RAM from an MC host, the prices are more expensive than just renting a dedicated server. 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 the place to start looking at dedicated servers. A dedicated server does not have to be specifically designed for Minecraft. It is an entire physical server that you can rent from a datacenter and use to your heart's desire. https://minecraft-names.com/ I will not be covering how to run a Linux-operated Linux server in this guide. Anyone who is interested in running a Minecraft server I recommend that they get a Linux dedicated server. This is a personal preference. A Windows server is fine, but there are no particular reasons to choose Linux. This guide, however, will be written only for people with a Linux box. You can stop reading this guide if your Linux box is not available. When choosing a server, many people are concerned about their RAM. According to many sources, you will need approximately 1GB RAM for every 10-20 slots of your server. This is a reasonable estimate to base your calculations on, but RAM is only one thing you need to be concerned about. You need to make certain your HDD is sufficiently large, your processor is efficient, and your internet speeds remain fast enough. When I was running a server I had a very nice box: i7 3770 4 Core @ 3.4 Ghz, 32 GB RAM, 64 GB SSD, 32GB HDD. This is more than enough for a server to host 200+ users. This is something to consider when renting a box. Choopa is a great 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. There are so many processors that any you get offered will most likely get the job done. These numbers are highballing it and you don't exactly need that 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. Setting Up Your Server Now that you have your box you may be wondering how to start it. You don't have the option to open your Windows Explorer and run run.bat from Bukkit's Wiki. It is quite complicated. First, upload your craftbukkit files to your server. I usually used the directory /home/SERVERNAME. Next, create a file called begin.sh. You should place this code on that webpage: DO NOT COPY THIS COMMUNITIES CODE: java –server -Xms10G. Xmx16G. jar craftbukkit.jar Each box is unique, so you will need to adjust the RAM you 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 eightGB box, you should give the box -Xms4G, -Xmx6G, and if you have 16GB, -Xms8G, and –Xmx12G. Play around with numbers. Make sure you have at minimum 2GB available. Keep Xmx larger than Xms. There will be other applications running on your machine, so make sure to leave enough space. There are many other options available that can be added depending on how the server is being handled by your processor. It is not necessary, but you can do some research in case you need something changed. Upload the start.sh file to the /home/SERVERNAME. This can be done with Filezilla. Now, how do I run that script? Well, let me explain. I'm going to teach you how to use PuTTy. This is because it is simpler than teaching how to connect via 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, lets use 108.61.45.74 as an example IP. You will need to enter the IP address of your Minecraft server. If you don't know what it is you could get it by logging into your account on the server host's website or by contacting your serverhost. You can also use a URL to access the Minecraft server. Next, you will need to enter the port. If you haven’t changed it, 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 After you have done that, you will be asked to login. If you weren't already told, your login name must be root. If you don’t know your host’s name, you can contact it. After typing root, press enter. Next, enter your password that you have received from the host. Next, click on enter. As you type your password, it won't appear in the browser. You need to ensure you have certain items installed on your box. You will need a bunch of things like: Java, MySQL, htop, and iptraf. I will demonstrate how to do this in this guide. Installing Programs: This is the command line to install all programs you need. It is important to keep in mind that not all Linux boxes use exactly the same format. These commands will work with a CentOS system. I realize that Ubuntu is the most popular OS, but at the time of writing this I was still using CentOS. The commands for installing are similar. For CentOS, you can use this command line. You can use the apt–get command to install Ubuntu. I suggest that you research your distribution to find the right commands. First enter the following command to make sure you can use the rpm extension: 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 easily find guides to installing MySQL or Java with a quick Google Search. JAVA: http://www.wikihow.com/Install-Java-on-Linux MYSQL: http://www.thegeekstuff.com/2008/07/howto-install-mysql-on-linux/ Starting MySQL To start MySQL you want to enter the following command line: Code: /etc/init.d/mysqld start Turning the server on Now, I assume that you are ready to turn this machine on and begin installing plugins. To do this, you will need to open a screen (instance). Screen does not come pre-installed. You will need to install it. Type: Code: yum screen If the above command doesn't work, follow the next step. After you've installed it, you can now open a new screen. Go to this link and find the version for your distribution. Then, enter the two lines below into your terminal. Code: yum --y install ncurses devel texinfo pamdevel libtool $url_TO_RPM Now the screen has been installed. To open a window, you will need the following command line code: screen –S SERVERNAME Replace servername with your server's name. It is important that your screen name matches the name of your server. This is just so you can easily remember which server is running on each instance. Once you have done this, a page should appear like this. My screen will be called WARCHICKEN at this point. You are now on the screen. Now, you want to run your start script. You first have to open the file that it is in. Type: Code: cd/home/SERVERNAME Because that is the way we chose to follow in this guide. Now, type: Code:./start.sh This will start your server. If you receive the following message: It means that your start.sh file was not modified to 770. Please use this command to do so: Code: chmod 770 /home/SERVERNAME/start.sh After the server is on, you can use this screen to enter commands as the server. To detach, hold CTRL+A+D. It will detach. 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 view the screen at a given time You can also do Code: screen -list To list all the screens that are open, click here If you need to kill a screen you type: Code: kill -9 The PID number is the number that is left of the screenname. This number will vary from one screen to the next. If your server crashes, you need to kill the screen and then reopen it.

https://minecraft-names.com/