How To Set Up A Minecraft Server On Debian 10 - Techlear


Minecraft is a game that has taken the world by storm. There are many versions of this game. However, they all have the same requirement for a server in order to host games and keep track on all players. In this tutorial we will show you how to set up your own Minecraft server on Debian 10, using open-source tools available from their official website.



Prerequisite: A Debian installation must have root privileges.



- A Minecraft server that is compatible with the version of your Debian release. If you are using Ubuntu, you can find out what works for you by going to their website. If it's not clear which one to use, try googling Minecraft Server compatible on Debian /Ubuntu or ask in the comments and we'll help!



Upgrade your Debian system to the most recent release.



This is a good idea before installing any additional packages because it will provide you with all of the latest updates and security patches for both Debian software as well as installed applications like Minecraft server. This can be done by simply running the following commands from your terminal:



These commands are executed in tandem, updating first and then upgrading after it has been completed successfully. You should note that these commands will only take five minutes to run. Larger upgrades may take much longer, so be patient!



Java can be installed



This will download the current latest release of Java and install it. For simplicity's sake, if you have multiple versions of Java installed, this will remove them all. Once completed, you can confirm which version is currently running by typing the command below in your terminal:



That's it! Java has been installed on your server.



Create a new Minecraft account



In this example, we create a new user named 'minecraft':



Once you have completed that step, type in or copy-paste the password for this account twice more to confirm it. This is important because each account should have a unique password.



Take a look at this sample output



Add the new sudo user to the group.



Install Screen



Screen is a GNU utility which can be used for multiplexing terminal sessions. This is a useful tool for remote access, allowing you to detach from an ssh session and resume it later without the need of closing that instance (which would disconnect you).



To install a Screen, type:



This command will install the screen program and all its dependencies on your server.



This is the end. Please continue with the next task.



Install Minecraft



After exiting your current SSH, log back in using the minecraft user we created earlier.



Make a new folder called minecraft and place it in your computer.



Now, download the latest version of Minecraft.net to this directory. Refer to the Minecraft server page to get the latest version of Minecraft Server, replace the version section below with that URL.



Make a startup script



This allows your Debian server to start on reboot of your machine or Debian itself. It's also useful in case your home internet connection drops.



Copy and paste this text into your terminal



The jar parameter can be set to keep your world persistant or not. If you want a fresh start each time, use nogui. If you don't have enough RAM for this setup in Debian, or Ubuntu, consider dropping -Xmx from 2560M up to something lower like 500M.



Save your script by pressing Ctrl+o, exit Nano using Ctrl+x, and then confirm that this file is saved when prompted by pressing "y". You should now have a startup script in /home/minecraft/. It will automatically launch on boot! To test it, copy-paste or type the following command.



If errors such as "java", are not recognized, please double check the java installation process.



Start.sh executable



Once you are done, type "exit" in the terminal window or close it if you would like to log out of this user account; then go back to your main screen. To disconnect from this ssh connection completely, you can simply type exit or hit Ctrl-D at a prompt. You can also type nano again to remove./start.sh If you have already done so in a previous instance (e.g., for Minecraft Server), then it won't prompt again. These agreements allow Debian's repositories download packages from another server for yours. This can be more convenient, as they are often more up-to-date than yours. Once the agreement is accepted, the installation should take only a few minutes. After that, all files and resources have been downloaded.



Next, you need to open the file eula.txt. This will allow your server's connection to the Minecraft game client software. Open that file in the editor of your choice and make sure it says: eula=true



The next step is using screen to run our Minecraft server process independently so that we don't need to be logged into the minecraft user account at all times when administering the game server remotely via SSH.



This will create "session" minecraft to run the Minecraft process behind the scenes; we can access it from any shell we're logged into.



Configure Your Minecraft Server Firewall



Next is to set up your firewall. Debian's built-in firewall, ufw, allows us to have great control over which programs can access external network resources like the internet. It also includes port forwarding that allows certain ports to be allowed depending on criteria such a destination address or source ips.



Debian currently only allows SSH traffic. Let's start by typing rules for Minecraft.



Connect to your Minecraft Server



Open your Minecraft client. Click the Multiplayer tab. Type in your server's name or IP address.



You will need to buy an additional domain name from any domains suppliers in order to play on the public network. Also, Dynamic DNS must be set up by you. This is beyond this tutorial's scope.
MINECRAFT SERVERS



You can now connect to the server. Click on the Join Server button.



Congratulations! You are now able to play Minecraft and build worlds. You can build worlds and have fun with your friends, too. The Minecraft Wiki has more information and help.



Setting up a Minecraft Server on Debian is easy, just follow the steps in this post. If you have any further questions, please comment below. The same steps can also be applied to other Debian systems, such as Debian Stretch. We hope that you enjoyed this tutorial, and that it has helped to set up your server. If there is anything we've missed, please let us know in the comments below. Happy mining!


Created: 11/08/2022 06:05:59
Page views: 40
CREATE NEW PAGE