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

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


Minecraft is a very popular game. There are many different versions of this game, but they have in common the need for a server to host games and keep track of 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: You will need a Debian install with root privileges.



 - A Minecraft server that is compatible with the version of your Debian release. If you are using Ubuntu you can go to their website to find out what works. 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!



Make sure to update your Debian system with the latest version.



 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. To do this simply execute the following commands in your terminal:



These commands are executed in tandem, updating first and then upgrading after it has been completed successfully. These commands should only take about five minutes, whereas larger upgrades can take a lot longer.



Java Install



 This will download the current latest release of Java and install it.  Maimers.Com To simplify things, you can remove multiple versions from your computer. After you are done, you can verify which version is running by entering the following command in your terminal:



 That's it! Java has been installed.



 Create a new user for Minecraft



In this example, a new user is created 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.



Here's an example of the output:



Add the new user into the sudo group



Install Screen



Screen is a GNU utility that allows you to multiplex terminal sessions. This is useful for remote access. You can disconnect from an ssh instance and resume it later.



To install a Screen, type:



 This command will install screen and all of its dependencies to your server.



This task is over. You can continue to the next task by clicking here.



 Install Minecraft



Then, quit your current SSH connection and log back in with the minecraft username that we created earlier.



Create a new folder named minecraft and then move it to your desktop.



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



 Create a startup script



This allows your server start when you reboot your computer or Debian itself. It is also very useful if your home internet connection drops, and you need the server to restart without you having to log into!



Copy and paste the following lines in your terminal



The jar parameter can either be set to keep your environment persistent or not. Nogui will give you a fresh start everytime. If you don't have enough RAM to run this setup in Debian or Ubuntu, consider dropping the Xmx value from 2560M down to something like 512M.



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 start on boot! To test it out type or copy-paste the following command:



 If any 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 use 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. Accepting these agreements allows Debian's repository to download packages on your behalf from another server; this can make it more convenient since they are often more current than yours. Once accepted, the installation should be completed in a matter of minutes. There is no need to do anything else until all required files are downloaded.



Next, you need to open the file eula.txt. This will allow the server to connect to the Minecraft game client program. Open the file in your favorite editor and verify that it reads:



 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 a new "session" called minecraft running the Minecraft process in the background; we can access this from any other shell we are logged into.



 Configure Your Minecraft Server Firewall



Next we need to set our firewall. Debian includes a great firewall called ufw. This allows us to have complete control over which programs can access network resources outside of our system, such as the internet. It also includes port forwarding that allows certain ports to be allowed depending on criteria such a destination address or source ips.



 In Debian, the default settings currently only allow SSH traffic (e.g., ssh from your local system into this server). Let's add rules to Minecraft by typing:



 Connect to your Minecraft Server



Open your Minecraft client and select the Multiplayer tab. Enter your server's name, IP address, and password.



 Note: to play on a public network you will need to buy an external domain name from any domains providers and set up Dynamic DNS yourself which is beyond the scope of this tutorial.



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



 Congratulations! Congratulations! You can now play Minecraft, and build worlds. You can also create worlds with your friends and have fun. The Minecraft Wiki has more information and help.



 Setting up a Minecraft Server on Debian is easy, just follow the steps in this post. Please comment below if there are any questions. The same steps can be applied to any Debian system, such as Debian Stretch. We hope this tutorial was helpful and enjoyable. If you think we've missed something, please let us all know in the comments. Happy mining!