How To Make A Minecraft Server

From Security Holes
Revision as of 18:38, 6 August 2022 by Petfall08 (talk | contribs)
Jump to: navigation, search

We will show you how to create a Minecraft server using easy-to-follow steps. It will be a persistent, multiplayer server that you and your friends can play on together. You don't even need to be connected to a network.



How to Make a Minecraft Server - Quick Guide



This is our "Table of contents" if you're in a hurry and want to go straight to the point. We recommend reading through everything.



Learn stuff (optional) Learn more stuff (optional) Requirements (required) Install and start the Minecraft server (required) Run the server even after you log out of your VPS (optional) Make the server automatically start at boot (optional) Configure your Minecraft server (required) FAQs (optional) Need specialized managed Minecraft server hosting? Host Havoc will give you a coupon to get a server.



Before you get to the instructions, here are some things you should know.



Reasons why you would NOT use a specialized Minecraft server hosting provider



Since you're here, you're obviously interested in hosting your own Minecraft server. There are many reasons why you wouldn't use a specialized Minecraft server hosting provider. Here are some examples.



They are usually slow. This is because you actually share the resources with multiple users. It can overload at some point. Many of them also oversell their server. You don't have full control over the Minecraft server or the actual server. You cannot modify anything. You're limited. These types of hosting plans are always limited.



There are many advantages to using a Minecraft hosting company. The best part is that you don’t have actually to do the stuff we’ll discuss below. But where's all the fun?



Why you should NOT use your personal computer to make a Minecraft server



We found many tutorials on how to host a server from your own computer. There are some drawbacks to this approach, however.



DDoS attacks can't be handled if your home internet isn't secure enough. DDoS attacks are a common problem with game servers. Your home internet setup is likely not strong enough to protect them. It is unlikely to be powerful enough to withstand a small attack. Port forwarding is something you will need to manage. If you've tried making a Minecraft server on your home network, you've surely stumbled upon port forwarding and had issues with it. You will need to keep your computer plugged in at all times. Your electricity bill is going to soar, and your hardware will be put under unnecessary load. Most servers use enterprise-grade hardware that is designed to handle heavy loads and has greater stability and longevity. Your home internet is not fast enough. Multiplayer games are not possible on home networks. To even consider setting up small servers, you'll need to have a bigger internet plan. Data centers have several high-speed, enterprise grade internet connections. This ensures they have (or attempt to have) 100% availability. Your hardware is most likely not good enough. Again, servers use enterprise-grade hardware, latest and fastest CPUs, SSDs, and much more. Most likely, your personal computer does not. - You probably use Windows/MacOS on your personal computer. Although this is a debateable point, we believe Linux is better for game hosting. Don't worry, you don't really need to know everything about Linux to make a Minecraft server (though it's recommended). We will show you everything.



Our tip is not to use your personal computer, though technically you can. A cloud server is not too expensive. We'll show you how to make a Minecraft server on cloud hosting below. It's easy if the steps are followed carefully.



How to make a Minecraft server - Requirements



There are some prerequisites. Before you can continue to the tutorial, you should be familiar with all of these requirements.



A Linux cloud server will be required. Linode is our recommendation. Their prices are very affordable, the services are excellent, and the customer support is outstanding. Also, the server hardware is of high quality. Check the Minecraft server requirements to find out what kind of server you should get (resources like RAM and Disk space). We recommend the $20 per-month server. You can pay per hour pricing if you use the server only for play with friends. Sign up for Ubuntu 22.04. During signup, choose the closest server location to your players. Remember that your server will be your responsibility. You will need to protect it and maintain it. If you don't want to do that, you can get a managed server, in which case the hosting provider will likely make a Minecraft server for you. To connect to the Linux cloud server, you will need an SSH client. PuTTy is often recommended for beginners, but we also recommend MobaXTerm. There are many SSH clients that you can choose from. You'll need to setup your server (basic security setup at least). You can Google it to find many tutorials. You can use Linode's Security Guide and follow the exact steps on your Linode server. - We'll handle Java and other required software below.



And finally, onto our actual tutorial:



How to Make a Minecraft Server on Ubuntu (Linux)



These instructions were created for and tested with an Ubuntu 22.04 server by Linode. They will work on Ubuntu 20.04 and Ubuntu 18.04 as well as any other Ubuntu-based distros and any other server providers.



We're using Minecraft's default Vanilla server. You can use alternatives like CraftBukkit or Spigot that allow more customizations and plugins. But you can't use too many plugins and it will essentially ruin your server. Each plugin has its advantages and disadvantages. To keep things simple for beginners, these instructions are for Vanilla's default server. We may publish a tutorial for CraftBukkit soon if there's an interest.



Here are the step-by-step instructions on how to make a Minecraft server:



1. Log in to your server



We'll use the root account. If you use a limited-user, you'll have to execute most commands with 'sudo'. If you are doing something you don’t have enough permissions to do, you’ll be warned.



You can log in to your server through your SSH client. Use your server IP and your port (most likely 22).



After you log into, make sure to secure your server.



2. Update Ubuntu



Before you do anything else, make sure to update Ubuntu first. These commands will update your Ubuntu.



When prompted to, hit "enter", and/or "y".



3. Install the necessary tools



You'll need a few packages and tools for various things in this tutorial like text editing, making your server persistent etc. The following command will install them:



Some of them may already be installed.



4. Download Minecraft Server



First, create a directory where you'll store your Minecraft server and all other files:



Go to the new directory.



Now you can download Minecraft Server. Go to the download site and find the link. Use wget to download the file



5. Install the Minecraft server



Once you have downloaded the server.jar, you will need it to be run once. This will generate some files including an eula.txt licens file. It will return an error the first time it is run. That's supposed to happen. Run in with the following command:



"-Xms2048M" is the minimum RAM that your Minecraft server can use and "-Xmx3472M" is the maximum. This can be adjusted depending upon your server's resources. Linode provided a 4GB RAM server. You can leave them as is if you do not intend to use the server for any other purposes than Minecraft.



After the command returns an error and ends, a new file eula.txt will be created. You need to accept the license in that file. You can do that by adding "eula=true" to the file with the following command:



You can now start the server again and access the Minecraft server console with that same java command from before:



You must be in the /opt/minecraft directory. This directory is where you installed your MC Server.



You're free to stop here if you're just testing this and need it for the short-term. You will need to configure your firewall if you have trouble logging in to the server.



The first time you successfully start the server it will take a bit longer to generate



We'll show you how to create a script so you can start the server with it.



6. Start the Minecraft server with a script, make it persistent, and enable it at boot



We'll create a bash script to automatically start the server.



First, create a bash-script with nano



You will see a new (blank!) file. Paste the following:



If you're new in nano, you can save and close your file by pressing CTRL +X, then hitting "Y", and then hitting enter. This script navigates to your Minecraft server directory you created previously and runs the java command for starting the server. You need to make it executable with the following command:



Then, you can start the server anytime with the following command:



This command can be used to start a screen session.



Once you're done with the screen session, you can use the bash script you used earlier to start the server.



To exit the screen, press CTRL+ A-D. The server will continue to run even after you exit the screen session (detach). You can safely log off your Ubuntu server now, and the Minecraft server you created will keep running.



Open the /etc/rc.

Local file:

and add the following line above the "exit 0" line:



To access the Minecraft server console, just run the following command to attach to the screen session:



This is it for now. Congratulations and have lots of fun! You can now connect to your Minecraft server or configure/modify it.



Configure your Ubuntu Server



You will need to set-up your Ubuntu server and make sure it is secure. Follow the guide we mentioned earlier and google it for more info. The configurations you need to do for your Minecraft server on your Ubuntu server are:



Configure and enable the firewall



First, enable UFW if it isn't already enabled.



You should allow the default Minecraft server port:



You can allow or deny different rules depending on how your server is used. If you don't use your server for hosting websites, you need to deny ports 80/43. You can find recommendations for UFW/Firewall guides for Ubuntu by searching Google. Be careful when setting up your firewall, you may lock yourself out of your server if you block the SSH port.



This port is often automatically scanned and attacked since it is the default. Skins You can prevent attacks by blocking access to anyone that's not of your whitelist.



First, you must enable the whitelist option in your server.properties. To do this, you need to open the file:



Change "white-list" line from "true" to "true".



Save and close the file.



Next, restart your server by either restarting your Ubuntu server, or running the start bash script once again.



Access the Minecraft server console:



And if you want someone to be able to join your server, you need to add them to the whitelist with the following command:



Use:



CTRL +A-D is used to exit the screen session. It is important to note that this will block access to everyone except the whitelisted usernames.



How to Make a Minecraft Server - FAQs



We'll answer some frequently asked questions about Minecraft Servers and our guide.



How do I restart the Minecraft server?



You can simply reboot your Ubuntu server if you have followed all the steps in our tutorial, including enabling it to start on boot. If you didn't set it up to start at boot, you can just run the start script again which will restart the Minecraft server:



How do I configure my Minecraft server?



You can configure your server by using the server.properties. You can refer to the Minecraft Wiki for more information.



You can use the server console to change the difficulty, game mode, and other settings. Access the server console by running:



There, execute commands. Commands such as:



Depending on the command you used, you may need restart the server. There are many other commands you can use. Check the wiki for more. Skins



How do I upgrade my Minecraft server?



You need to activate a new release.



Navigate to the minecraft directory



Download the latest version using wget (like step 1 in the tutorial).



Next, build and operate the new server.



Last but not least, update your Start Script:



Make sure to update the version numbers as necessary.



Now you can restart the server and everything should go well.



Why is your Minecraft server tutorial so long, and yet others are only 2 lines long? !



We tried to make it as easy as possible for beginners and as detailed as possible. We also showed you how to make the Minecraft server persistent and start it automatically at boot, we showed you how to configure your server and everything. I mean, sure, you can start a Minecraft server with a couple of lines, but it would definitely suck, for more than one reason.



I don't know Linux or anything you wrote about here, how do I make a Minecraft server?



Simply read the article and then copy and paste the commands. If you really don't know how to do it all, we can do it for you, or just get a managed server provider and let them do it for you.



How do I install mods onto my server? How do I install plugins?



This article is intended as a guide. MINECRAFT SKINS You can read the Minecraft wiki for additional information or just Google it. There are many tutorials online.