Raspberry Pi Tutorial: Host A Minecraft Server On Ubuntu Desktop

Welcome to the second in our sequence of Linux gaming posts within the run up to the vacations. XAJWM''S BLOG , we’ve put together a tutorial that teaches you easy methods to create a basic Minecraft Server on a Raspberry Pi with Ubuntu Desktop, so you''ll be able to play regionally with your folks.


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


Hosting a Minecraft server unlocks a tonne of extra control over how you play Minecraft with your folks. You may change the game guidelines and difficulty, the behaviour of enemies and decide how players interact.


Organising a server can also be a great solution to be taught extra about Linux. Linux is all about tinkering and making an attempt new things. While it might seem intimidating at first, the directions you’ll observe for this challenge will assist you to method more 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 too can follow along on just about any laptop or Laptop that has Ubuntu Desktop installed. You can even use a Digital Machine.


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


Pc tutorial

VirtualBox tutorial

Raspberry Pi tutorial


Notice: We’ll be utilizing Ubuntu Desktop 21.10 for Raspberry Pi on this tutorial, and suggest you comply with along with Ubuntu Desktop 21.10 on whatever device you employ.


Of course, you’ll additionally need one other Laptop or laptop with Minecraft Java Edition installed so you can hook up with your server once you’ve created it!


Let’s jump in.


Set up Ubuntu in your Raspberry Pi and update


If you’ve followed the Raspberry Pi installation tutorial, you’ll be just about ready to go, however at any time when we begin a brand new project, it’s always vital to verify all the things is up to date.


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


Enter your password and press Y when prompted.


This can test whether your model of Ubuntu is up to date and obtain and set up any new packages.


Install Java


Minecraft servers are based on Minecraft Java Edition, the unique model of Minecraft, so our next step is to install Java on our Raspberry Pi. The default Java on Ubuntu is older than the one used for Minecraft Servers, so we need to particularly install the latest Java Runtime Setting (jre), which is model 18:


Kind your password and press Y when prompted.


Create a folder to 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 manager, proper-clicking, and creating a new Folder named Minecraft. However we’re already within the terminal, so let’s keep typing right here!


The above will do exactly the identical factor as using the file supervisor. In truth, you possibly can examine the file manager your self to affirm that the brand new folder has appeared!


Since we’re going to install our server inside the brand new folder, we want to tell our terminal that we’re going to work there.


For those who kind


You possibly can see that we’re still in the home directory of our Pc. You’ll see your Paperwork and Downloads folders, as well as the new Minecraft folder you created. To get inside this folder, we''d like to change Directory (cd), so sort:


When you type ls once more, you may see that now nothing is returned, as a result of we’re inside an empty folder. You’ll additionally see that your prompt now contains the Minecraft folder name:


Download Minecraft Server!


Depart your terminal open, but now you additionally have to open your net browser.


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


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


This may make sure you all the time get the newest model of the server when following this tutorial!


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


And then Proper-Click and Paste the link to the server. It ought to look something like this:


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


You will notice the download full, and in case you then sort:


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


Begin your server!


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


Press ENTER and… Error??


That’s as a result of we simply instructed our Pi to run a file known as minecraft_server.1.18.jar, but you may see from our final ls that after we put in the server it was simply known as server.jar.


That’s a straightforward fix.


If you happen to press UP on the keyboard, your last instruction shall be repeated. Try this now, and then edit the filename to server.jar and press ENTER again.


Success!


Sort of. Now we''ve one other error. We need to comply with the tip Person License Agreement (EULA) before we are able to get began.


So where’s the EULA?


Effectively let’s use our trusty


on our Minecraft listing yet one more time. You’ll see the set up process has created a set of latest files. This is nice, as a result of these recordsdata are what allows us to play round with the sport guidelines! However earlier than we can get to the enjoyable stuff, let’s signal the EULA.


We will do this directly within the terminal (you are able to do all the things in the terminal, that’s why it’s so cool) using a textual content editor known as nano. Type:


It will open the eula.txt file in your terminal window. Now you simply need to vary the eula line to true instead of false.


Then we press CTRL+S to save and CTRL+X to exit back to the Command Line.


Let’s attempt the server again!


When you press UP just a few times on your keyboard, we are able to repeat the instruction from earlier with out typing it out once more.


However let’s make one last change earlier than we run issues and double the -Xmx1024M and -Xms1024M in our command to -Xmx2048M and -Xms2048. Xmx and Xms consult with the quantity of memory the server will use. The extra we give it, the higher the performance.


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


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


Once your server has completed organising, you’ll most likely get just a few messages like this relying on how a lot reminiscence you assigned it in the earlier command. It’s normal to have just a few of those at startup whatever occurs, so don’t fear too much.


High Tip: Higher hardware means a better server. If you’re considering keeping your server round, or utilizing it with lots of people, an 8GB Raspberry Pi four (with elevated Xmx and Xms numbers) will carry out better. Attaching an SSD via a USB3.Zero port may even help.


Finally, as gamers be part of, you’ll be capable to see key events appear on the terminal as they occur in the sport world.


Ouch.


You may cease your server any time by typing


in the Terminal. This can even save your world so you can resume once more at a later time.


Joining the Minecraft server over your local network


If you’ve invited your pals to affix your server on their laptops, they’re probably a bit impatient to get going by now. But we’re lastly ready!


On your (or your friend’s) laptop or Pc, make certain you might be working the Java Version of Minecraft (which you''ll be able to set up from the official Minecraft site - simply download it and double-click on).


Then they need to navigate to Multiplayer > Direct Connection.


Now they should enter the local IP deal with of the server which is… hmmm. We don’t know.


Let’s go back to our server terminal!


To find out the server’s native IP, you''ll want to open a second terminal window, or a new tab in the current terminal (or just stop your server for this bit and restart it after).


This can produce a string of numbers, but you only need the primary set.


Wanting at the above, my local IP is 192.168.1.222. Yours can be similar however not the identical.


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


Once your visitors have entered your server IP, they just must click Join Server and they’re in!


Unfortunately for my server, I spawned proper next to a spider. And it was raining.


Modifying your Server Settings


If you wish to play regular Minecraft regionally with your mates, then you’re all achieved - congratulations! However the best a part of working a server is which you can play god with the game world!


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


This time, we wish to do the same thing as we did to signal the EULA however this time we’re going to edit a file called server.properties (you may need noticed it the final time we used ls).


Sort:


This should deliver up all of the configuration options to your server. For those who scroll down there’s quite a number of!


I won’t go into detail on each option, however you''ll be able to read about them on the Minecraft Wiki.


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


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


Top Tip: In order for you to start a brand new Minecraft server, simply delete the World folder from your Minecraft listing, or rename the extent-identify in server.properties. This can create a new gameworld folder with the updated title next time the server begins, and you''ll switch again to the previous one any time!


Connecting to your Minecraft server remotely


In this mission, we’ve shown you tips on how to set up and customise a Minecraft server in your Raspberry Pi 4, and the way players on the same Wi-Fi community can join locally to your gameworld.


You’ve additionally learned some handy Linux commands, like ls, nano, and mkdir!


However what if your folks want to connect remotely, from their own houses?


When we think about players connecting over the internet, we have to talk about extra superior concepts like port forwarding. We also want to contemplate safety and what web strangers may do if they gained access to your Raspberry Pi.