Raspberry Pi Tutorial: Host A Minecraft Server On Ubuntu Desktop

Welcome to the second in our collection of Linux gaming posts in the run up to the holidays. This week, we’ve put together a tutorial that teaches you methods to create a basic Minecraft Server on a Raspberry Pi with Ubuntu Desktop, so you'll be able to play locally with your folks.


This is a good afternoon undertaking to work on with a friend or household member!


Hosting a Minecraft server unlocks a tonne of extra control over the way you play Minecraft with your mates. You may change the game rules and problem, the behaviour of enemies and decide how players work together.


Setting up a server can be an excellent option to be taught extra about Linux. Linux is all about tinkering and attempting new issues. While it might probably seem intimidating at first, the instructions you’ll observe for this undertaking will make it easier to strategy extra complicated Linux initiatives sooner or later!


In this tutorial, we’ll be utilizing a Raspberry Pi four 4GB with a 32GB SD card, however you can even observe along on just about any laptop computer or Computer that has Ubuntu Desktop put in. You possibly can even use a Virtual Machine.


Try these tutorials for getting started with Ubuntu Desktop on these platforms:


Pc tutorial

VirtualBox tutorial

Raspberry Pi tutorial


Notice: We’ll be using Ubuntu Desktop 21.10 for Raspberry Pi in this tutorial, and advocate you observe together with Ubuntu Desktop 21.10 on no matter machine you employ.


After all, you’ll additionally need one other Pc or laptop computer with Minecraft Java Version installed so you possibly can connect to your server as soon as you’ve created it!


Let’s bounce in.


Set up Ubuntu on your Raspberry Pi and replace


If you’ve adopted the Raspberry Pi set up tutorial, you’ll be just about ready to go, but at any time when we start a brand new venture, it’s always essential to make sure the whole lot is up to date.


Go forward and open a terminal (ALT+T or click on the Terminal icon in your sidebar) and sort:


Enter your password and press Y when prompted.


It will examine whether your version of Ubuntu is updated and obtain and install any new packages.


Install Java


Minecraft servers are based mostly on Minecraft Java Version, the unique version of Minecraft, so our next step is to put in Java on our Raspberry Pi. The default Java on Ubuntu is older than the one used for Minecraft Servers, so we have to specifically install the most recent Java Runtime Surroundings (jre), which is version 18:


Kind your password and press Y when prompted.


Create a folder in your server


Now you need a place to place the Minecraft server in your Pi. We might do it the ‘Windows’ way by opening the file supervisor, proper-clicking, and creating a new Folder named Minecraft. But we’re already in the terminal, so let’s keep typing here!


The above will do exactly the identical factor as using the file supervisor. In fact, you can test the file manager yourself to verify that the brand new folder has appeared!


Since we’re going to put in our server inside the new folder, we'd like to inform our terminal that we’re going to work there.


When you type


You may see that we’re nonetheless in the house listing of our Pc. You’ll see your Paperwork and Downloads folders, as well as the brand new Minecraft folder you created. To get inside this folder, we need to alter Directory (cd), so sort:


Should you sort ls once more, you'll be able to see that now nothing is returned, because we’re inside an empty folder. You’ll also see that your prompt now includes the Minecraft folder name:


Download Minecraft Server!


Go away your terminal open, however now you also must open your internet browser.


In your browser, go to this page: https://www.minecraft.web/en-us/download/server


We want to download the server linked here, however as an alternative of left-clicking it, let’s Right-Click on and select Copy Link.


This can be sure to all the time get the latest version of the server when following this tutorial!


Go away that page open, as we’ll come again to it shortly. Now go back to the terminal window, ensuring we’re nonetheless within the Minecraft folder, and inform the terminal to download the server to this folder.


After which Proper-Click on and Paste the link to the server. It should look one thing like this:


Then press ENTER. This command instructs your Pi to ‘get’ (obtain) whatever file is linked at that internet address you gave it.


You will note the obtain full, and should you then kind:


You’ll see we now have a server.jar file in our Minecraft folder!


Start your server!


Go back to https://www.minecraft.web/en-us/download/server, and this time copy the Java directions listed into your terminal.


Press ENTER and… Error??


That’s because we just advised our Pi to run a file known as minecraft_server.1.18.jar, but you possibly can see from our final ls that after we installed the server it was simply referred to as server.jar.


That’s a straightforward repair.


Should you press UP on the keyboard, your last instruction will probably be repeated. Do this now, and then edit the filename to server.jar and press ENTER once more.


Success!


Kind of. Now we've got one other error. We have to conform to the tip Person License Agreement (EULA) before we are able to get started.


So where’s the EULA?


Well let’s use our trusty


on our Minecraft listing another time. You’ll see the set up course of has created a set of recent files. This is sweet, because these information are what allows us to play around with the sport guidelines! However before we are able to get to the enjoyable stuff, let’s signal the EULA.


We are able to do that immediately within the terminal (you are able to do every thing in the terminal, that’s why it’s so cool) using a text editor referred to as nano. Sort:


This can open the eula.txt file in your terminal window. Now https://irc101.org/ want to alter the eula line to true as an alternative of false.


Then we press CTRL+S to avoid wasting and CTRL+X to exit again to the Command Line.


Let’s try the server once more!


For those who press UP a couple of occasions in your keyboard, we will repeat the instruction from earlier without typing it out once more.


But let’s make one last change before we run things and double the -Xmx1024M and -Xms1024M in our command to -Xmx2048M and -Xms2048. Xmx and Xms consult with the quantity of reminiscence the server will use. The extra we give it, the higher the efficiency.


Now we press ENTER once more and the server should start correctly!


This next bit goes to take some time. And you most likely won’t be capable to browse Facebook while you’re ready, as most of the Raspberry Pi will likely be focussed on standing up the server.


As soon as your server has completed organising, you’ll most likely get a couple of messages like this relying on how a lot reminiscence you assigned it in the earlier command. It’s regular to have a few of those at startup whatever happens, so don’t worry too much.


Prime Tip: Higher hardware means a greater server. If you’re contemplating retaining your server around, or using it with lots of people, an 8GB Raspberry Pi four (with elevated Xmx and Xms numbers) will carry out higher. Attaching an SSD by way of a USB3.0 port can even assist.


Eventually, as gamers join, you’ll have the ability to see key events appear on the terminal as they happen in the game world.


Ouch.


You may stop your server any time by typing


within the Terminal. This will also save your world so you may resume again at a later time.


Becoming a member of the Minecraft server over your native network


If you’ve invited your pals to affix your server on their laptops, they’re in all probability a bit impatient to get going by now. But we’re finally prepared!


In your (or your friend’s) laptop computer or Laptop, make certain you are operating the Java Version of Minecraft (which you'll be able to install from the official Minecraft site - just obtain it and double-click on).


Then they should navigate to Multiplayer > Direct Connection.


Now they need to enter the native IP tackle of the server which is… hmmm. We don’t know.


Let’s go back to our server terminal!


To search out out the server’s local IP, it is advisable to open a second terminal window, or a brand new tab in the current terminal (or simply cease your server for this bit and restart it after).


This can produce a string of numbers, but you only want the first set.


Looking at the above, my local IP is 192.168.1.222. Yours might be related but not the identical.


So that’s what my friends ought to add in their games:


As soon as your friends have entered your server IP, they just need to click Join Server and they’re in!


Sadly for my server, I spawned right next to a spider. And it was raining.


Modifying your Server Settings


If you want to play regular Minecraft locally with your friends, then you’re all performed - congratulations! However the perfect part of working a server is which you can play god with the game world!


Let’s close the server (stop, remember?) and do some tweaking.


This time, we want to do the identical thing as we did to signal the EULA but this time we’re going to edit a file known as server.properties (you may need spotted it the last time we used ls).


Type:


This should deliver up all of the configuration choices to your server. If you scroll down there’s quite a couple of!


I won’t go into element on each choice, but you'll be able to read about them on the Minecraft Wiki.


Personally, I just need to show off the spiders and change the server’s message of the day, so I’m going to make the following tweaks:


Just as earlier than, we press CTRL+S and then CTRL+X to avoid wasting and exit!


High Tip: In order for you to begin a new Minecraft server, just delete the World folder from your Minecraft listing, or rename the level-title in server.properties. This can create a brand new gameworld folder with the updated identify next time the server starts, and you'll change back to the previous one any time!


Connecting to your Minecraft server remotely


On this mission, we’ve shown you the best way to set up and customise a Minecraft server in your Raspberry Pi 4, and the way gamers on the same Wi-Fi community can connect locally to your gameworld.


You’ve also discovered some useful Linux commands, like ls, nano, and mkdir!


However what if your pals want to connect remotely, from their very own homes?


When we expect about gamers connecting over the internet, we need to speak about extra advanced ideas like port forwarding. We also want to consider safety and what internet strangers might do in the event that they gained access to your Raspberry Pi.

Public Last updated: 2022-06-26 03:38:12 PM