Skip to main contentdfsdf

Home/ troutverse9's Library/ Notes/ How To Set Up A Minecraft Server On Debian 10 - Techlear

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

from web site

mcdev's blog all about minecraft servers and plugins


Minecraft is a very popular game. There are many variations of this game. But they all share the need for a server that can host games and keep track 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're using Ubuntu, you can check their website to see which one works for you. 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!



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



These commands are run in tandem. First, update the system and then upgrade once it is done. 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. This will remove all versions that you have installed. Once the installation is complete, you will be able to confirm which version of the program is currently running by typing this command in your terminal.



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



Create a brand new Minecraft user



In this example, a new user is created named'minecraft.



Once done with that step, type or copy-paste your password for this account twice to confirm it (it's important to make sure this account has its own unique and secure password).



Sample output:



Add the new user in the sudo group.



Install Screen



Screen is a GNU utility which can be used for multiplexing terminal sessions. This is useful for remote access. You can disconnect from an ssh instance and resume it later.



To install Screen, type:



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



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



Install Minecraft



Exit your current SSH then, log in again using the minecraft user that we created earlier.



Create a new folder name minecraft and move into it:



Now, we need to download the latest version from Minecraft.net and place it in 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's to start automatically when you reboot your machine, or when Debian boots. It's also great if your internet connection drops at home and you need to restart it without having to log in.
All about minecraft servers and plugins



Copy and paste these lines into your terminal



You can configure jar to keep your world persistent; if you want a new start every time, then use nogui. If you do not have enough RAM for this setup in Debian (or Ubuntu), consider dropping the -Xmx value from 2560M to something lower like 512M.



Save your script using Ctrl–o, exit Nano by Ctrl–x, then confirm that you want this file saved by pressing "y" when prompted. Now, you should have a startup file in /home/minecraft/ It will automatically start on boot! To test it out, copy-paste this command or type it:



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



Make start.sh executable



After you're done, close the terminal window and type "exit" to exit. To disconnect from that ssh session entirely, simply exit by typing: exit or pressing Ctrl-D when at a prompt. You can also use nano 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 repositories to download packages from another server on behalf of yours; this can be more convenient as they're often better updated than your own! Once the agreement is accepted, the installation should take only a few minutes. After that, all files and resources have been downloaded.



Next, open eula.txt to set eula=true. This will allow your server connect to the Minecraft client software. 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", minecraft, that runs the Minecraft process in background. This can be accessed from any shell we are currently logged into.



Configure Your Minecraft Server Firewall



Next thing we want to do is set up 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, which allows certain ports to pass depending on criteria like destination address or source IP.



Debian currently allows only SSH traffic. Let's add rules to Minecraft by typing:



Connect to your Minecraft Server



Open your Minecraft client, select the Multiplayer tab, and enter your server name and 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.



Now you can connect to the server. Click on the Join Server button.



Congratulations! Congratulations! You can now play Minecraft, and build worlds. You can play Minecraft with your friends and create worlds. 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. These steps can be used for any Debian system such as Debian Stretch. We hope this tutorial was helpful and enjoyable. If there is anything we've missed, please let us know in the comments below. Happy mining!

troutverse9

Saved by troutverse9

on Aug 29, 22