How To Set Up A Minecraft Server On Debian 10 Techlear

From Security Holes
Jump to: navigation, search

Minecraft is a game that has taken the world by storm. 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: 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!



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



These commands are run in tandem; updating first then upgrading once that has completed successfully. These commands should be executed in tandem. If there are no pending updates, they should take less than five minutes. Larger upgrades can take longer so be patient!



Java can be installed



This will download the most recent Java version and install it. If you have multiple versions installed, this will remove them all for simplicity's sake! Once you're done, you can check which version is currently running in your terminal by typing the following command:



That's it! Java has been installed.



Create a new Minecraft account



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



Once you are done, copy-paste or paste your password twice to confirm. It's important to ensure that each account has its own unique password.



Example output:



Add the new sudo user to the group.



Install Screen



Screen is a GNU utility that can be used to multiplex terminal sessions. This is a useful tool to remote access. It allows you to disconnect from an ssh session, and then resume it later without having to close that instance.



To install a Screen, type:



This command will install screen, along with all its dependencies, to your server.



This is it. Continue with the next task.



Install Minecraft



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



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



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.



Make 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.



Copy and paste these lines 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 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 with CTRL-O, exit Nano with CTRL-X, then confirm that the file you want to save by pressing "y". You should now have a startup script in /home/minecraft/. It will automatically start when you boot! To test it out, copy-paste this command or type it:



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



Make start.sh executable



Once you are done, you can either type "exit", or close the terminal window if you wish to log out from this user account. Then go back to your main screen. To disconnect from the ssh session completely, type exit or press CTRL-D when prompted. 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. 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! Minecraft Servers List Once you accept the agreement, the installation should only take a few moments. No further action is required until all necessary files have been downloaded.



Next, open the eula.txt and 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 called minecraft that runs the Minecraft process in the background. We can access this shell from any other shell.



Configure Your Minecraft Server Firewall



Next, we need to set up our firewall. Debian has an excellent built-in firewall called ufw that allows us great control over what programs on our system can access outside network resources like the internet! It also includes port forwarding, which allows certain ports to pass depending on criteria like destination address or source IP.



Debian's default settings allow only SSH traffic. Let's start by typing rules for Minecraft.



Connect to your Minecraft Server



Open your Minecraft client, select the Multiplayer tab, and enter your server name and IP address.



Notable: In order to play on a publicly accessible network, you will need to purchase an external domain from any domains service providers and set up Dynamic DNS by yourself. This tutorial is too broad.



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



Congratulations! Now you can play Minecraft and create worlds. Minecraft Servers List You can create worlds and share them with your friends. 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 questions be sure to comment below. 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!