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 popular game. 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.

PrerequisiteYou will need a Debian installation with 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. 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. These commands should only take about five minutes, whereas larger upgrades can take a lot longer.

Java

This will download the latest Java version and then install it. If you have multiple versions installed, this will remove them all for simplicity's sake! 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 brand new Minecraft user

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

Once you're done, copy-paste or type your password twice to confirm it. It is important that each account has a 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 a Screen, type:

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

This is it. Continue with the next task.

Install Minecraft

Next, exit your current SSH and log in again with the minecraft account that you created earlier.

Create a new folder name minecraft and move into it:

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 the following lines into 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 for this setup in Debian, or Ubuntu, consider dropping -Xmx from 2560M up to something lower like 500M.

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

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

Make 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 completely from ssh, type exit or press 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 you accept the agreement, the installation should only take a few moments. No further action is required until all necessary files have been downloaded.

The next step is to open the eula.txt file and set eula=true. This will allow your server to connect with the Minecraft game client software. Open that file in your preferred editor and ensure it reads: 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 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 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, which allows certain ports to pass depending on criteria like destination address or source IP.

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

Strongcraft

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 to the server. Click on the Join Server link.

Congratulations! Congratulations! You can now play Minecraft, and build worlds. You can create worlds and share them with your friends. The Minecraft Wiki provides more tips and assistance.

Setting up a Minecraft Server on Debian is easy, just follow the steps in this post. Please comment below if there are any questions. You can apply the same steps to any Debian system like Debian Stretch. We hope you have enjoyed this tutorial and hope it has helped you to set up your own server! If you think we've missed something, please let us all know in the comments. Happy mining!

Report Page