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 holidays. This week, we’ve put together a tutorial that teaches you find out how to create a primary Minecraft Server on a Raspberry Pi with Ubuntu Desktop, so you’ll be able to play domestically with your pals.


This is a great afternoon undertaking to work on with a buddy or household member!


Hosting a Minecraft server unlocks a tonne of further management over how you play Minecraft with your pals. You possibly can change the game rules and issue, the behaviour of enemies and determine how gamers work together.


Organising a server can also be a fantastic way to study extra about Linux. Linux is all about tinkering and making an attempt new issues. Whereas it may appear intimidating at first, the directions you’ll observe for this project will assist you to method more complex Linux tasks in the future!


In this tutorial, we’ll be utilizing a Raspberry Pi 4 4GB with a 32GB SD card, but you can also comply with along on pretty much any laptop or Computer that has Ubuntu Desktop installed. You possibly can even use a Virtual Machine.


Check out these tutorials for getting began with Ubuntu Desktop on these platforms:


Pc tutorial

VirtualBox tutorial

Raspberry Pi tutorial


Observe: We’ll be utilizing Ubuntu Desktop 21.10 for Raspberry Pi on this tutorial, and advocate you comply with together with Ubuntu Desktop 21.10 on no matter system you utilize.


Of course, you’ll additionally want another Laptop or laptop with Minecraft Java Edition installed so you possibly can hook up with your server as soon as you’ve created it!


Let’s jump in.


Set up Ubuntu in your Raspberry Pi and update


If you’ve adopted the Raspberry Pi set up tutorial, you’ll be pretty much ready to go, however each time we start a brand new challenge, it’s always important to make sure every thing is updated.


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 will verify whether your model of Ubuntu is up to date and download and set up any new packages.


Set up Java


Minecraft servers are primarily based on Minecraft Java Edition, 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 set up the latest Java Runtime Atmosphere (jre), which is model 18:


Kind your password and press Y when prompted.


Create a folder for your server


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


The above will do exactly the same thing as utilizing the file manager. In reality, you can test the file supervisor your self to confirm that the brand new folder has appeared!


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


If you sort


You can see that we’re still in the home directory of our Computer. You’ll see your Documents and Downloads folders, in addition to the brand new Minecraft folder you created. To get inside this folder, we want to vary Directory (cd), so type:


When you sort ls once more, you can see that now nothing is returned, because we’re inside an empty folder. You’ll additionally see that your prompt now contains the Minecraft folder identify:


Download Minecraft Server!


Go away your terminal open, but now you also have to open your internet browser.


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


We wish to download the server linked right here, but as a substitute of left-clicking it, let’s Proper-Click and choose Copy Hyperlink.


This can be sure you at all times get the newest version of the server when following this tutorial!


Leave that web page open, as we’ll come back to it shortly. Now return to the terminal window, making sure we’re nonetheless in the Minecraft folder, and inform the terminal to download the server to this folder.


And then Proper-Click on and Paste the hyperlink to the server. It ought to 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 see the download complete, and if you happen to 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/obtain/server, and this time copy the Java instructions listed into your terminal.


Press ENTER and… Error??


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


That’s a straightforward fix.


For those who press UP on the keyboard, your final instruction can be repeated. Do that now, and then edit the filename to server.jar and press ENTER once more.


Success!


Kind of. Now now we have one other error. We need to comply with the end Consumer License Agreement (EULA) earlier than we are able to get started.


So where’s the EULA?


Well let’s use our trusty


on our Minecraft listing one more time. You’ll see the set up course of has created a set of new files. PREMIUM CONTENT is good, as a result of these recordsdata are what allows us to play around with the game rules! However earlier than we are able to get to the fun stuff, let’s sign the EULA.


We can do this immediately in the terminal (you can do everything within the terminal, that’s why it’s so cool) utilizing a textual content editor called nano. Sort:


This can open the eula.txt file in your terminal window. Now you simply need to change the eula line to true as a substitute of false.


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


Let’s strive the server again!


If you press UP a few instances on your keyboard, we can repeat the instruction from earlier with out typing it out once more.


But let’s make one last change before we run issues and double the -Xmx1024M and -Xms1024M in our command to -Xmx2048M and -Xms2048. Xmx and Xms consult with the amount of reminiscence the server will use. The more we give it, the better the performance.


Now we press ENTER once more and the server ought to begin properly!


This next bit is going to take some time. And you probably won’t be able to browse Fb whilst you’re ready, as a lot of the Raspberry Pi will probably be focussed on standing up the server.


Once your server has finished setting up, you’ll most likely get just a few messages like this depending on how a lot memory you assigned it in the earlier command. It’s regular to have a couple of of those at startup no matter happens, so don’t worry an excessive amount of.


High Tip: Better hardware means a greater server. If you’re considering conserving your server round, or using it with a lot of people, an 8GB Raspberry Pi four (with elevated Xmx and Xms numbers) will carry out higher. Attaching an SSD via a USB3.0 port will also assist.


Eventually, as gamers be a part of, you’ll be able to see key occasions seem on the terminal as they occur in the sport world.


Ouch.


You’ll be able to cease your server any time by typing


in the Terminal. This will also save your world so you’ll be able to resume once more at a later time.


Becoming a member of the Minecraft server over your local network


If you’ve invited your friends to join your server on their laptops, they’re most likely a bit impatient to get going by now. However we’re lastly prepared!


On your (or your friend’s) laptop computer or Pc, make sure that you might be operating the Java Edition of Minecraft (which you’ll be able to set up from the official Minecraft site – simply obtain it and double-click).


Then they should navigate to Multiplayer > Direct Connection.


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


Let’s go back to our server terminal!


To find out the server’s local IP, it’s essential open a second terminal window, or a new tab in the current terminal (or just cease your server for this bit and restart it after).


It will produce a string of numbers, but you only need the first set.


Looking at the above, my local IP is 192.168.1.222. Yours will probably be comparable however not the same.


So that’s what my guests should add in their games:


Once your visitors have entered your server IP, they simply need to click Join Server and they’re in!


Unfortunately for my server, I spawned right subsequent to a spider. And it was raining.


Modifying your Server Settings


If you want to play common Minecraft domestically with your friends, then you’re all completed – congratulations! But the most effective part of running a server is that you can play god with the game world!


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


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


Type:


This could convey up all of the configuration choices to your server. In the event you scroll down there’s quite a few!


I won’t go into element on every choice, but you may read about them on the Minecraft Wiki.


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


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


High Tip: If you would like to start out a new Minecraft server, just delete the World folder out of your Minecraft listing, or rename the extent-name in server.properties. This may create a brand new gameworld folder with the up to date identify subsequent time the server starts, and you can switch again to the previous one any time!


Connecting to your Minecraft server remotely


On this mission, we’ve shown you methods to arrange and customise a Minecraft server in your Raspberry Pi 4, and how gamers on the same Wi-Fi network can connect regionally to your gameworld.


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


However what if your mates want to attach remotely, from their own houses?


When we expect about gamers connecting over the internet, we need to discuss more advanced ideas like port forwarding. We also need to consider safety and what internet strangers may do in the event that they gained entry to your Raspberry Pi.

Leave a comment

Design a site like this with WordPress.com
Get started