RASPBERRY PI TUTORIAL: HOST A MINECRAFT SERVER ON UBUNTU DESKTOP


Welcome to the second in our series of Linux gaming posts within the run up to the holidays. This week, we’ve put collectively a tutorial that teaches you easy methods to create a basic Minecraft Server on a Raspberry Pi with Ubuntu Desktop, so you can play regionally with your folks.


This is a good afternoon venture to work on with a pal or household member!


Internet hosting a Minecraft server unlocks a tonne of additional management over how you play Minecraft with your pals. You'll be able to change the game guidelines and problem, the behaviour of enemies and determine how players interact.


Establishing a server can be an incredible method to learn more about Linux. Linux is all about tinkering and attempting new issues. While it will probably appear intimidating at first, the directions you’ll follow for this project will make it easier to approach extra advanced Linux projects sooner or later!


On this tutorial, we’ll be utilizing a Raspberry Pi four 4GB with a 32GB SD card, however you can too follow along on pretty much any laptop computer or Computer that has Ubuntu Desktop put in. You might even use a Digital Machine.


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


Computer tutorial

VirtualBox tutorial

Raspberry Pi tutorial


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


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


Let’s soar in.


Install Ubuntu on your Raspberry Pi and replace


If you’ve followed the Raspberry Pi set up tutorial, you’ll be just about able to go, but every time we begin a brand new project, it’s at all times necessary to verify the whole lot is updated.


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


Enter your password and press Y when prompted.


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


Set up Java


Minecraft servers are primarily based on Minecraft Java Edition, the original version of Minecraft, so our subsequent 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 have to particularly set up the latest Java Runtime Setting (jre), which is version 18:


Type your password and press Y when prompted.


Create a folder on your server


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


The above will do precisely the identical thing as utilizing the file supervisor. In actual fact, you'll be able to check the file manager yourself to confirm that the brand new folder has appeared!


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


For those who type


You can see that we’re nonetheless in the house listing 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 need to alter Listing (cd), so kind:


In case you type ls once more, you can see that now nothing is returned, because we’re inside an empty folder. You’ll also see that your prompt now contains the Minecraft folder name:


Download Minecraft Server!


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


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


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


It will be sure to always get the latest model of the server when following this tutorial!


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


After which Right-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) no matter file is linked at that internet tackle you gave it.


You will notice the obtain full, and if you then sort:


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


Start your server!


Return to https://www.minecraft.net/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 simply advised our Pi to run a file referred to as minecraft_server.1.18.jar, however you'll be able to see from our last ls that when we installed the server it was just known as server.jar.


That’s an easy fix.


If you press UP on the keyboard, your final instruction will likely be repeated. Do that now, after which edit the filename to server.jar and press ENTER again.


Success!


Form of. Now we've one other error. We need to agree to the end User License Settlement (EULA) earlier than we will get began.


So where’s the EULA?


Effectively let’s use our trusty


on our Minecraft directory one more time. You’ll see the set up course of has created a set of latest information. https://wickedfrise.com/ is nice, as a result of these recordsdata are what permits us to play around with the game rules! However before we will get to the enjoyable stuff, let’s sign the EULA.


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


This can open the eula.txt file in your terminal window. Now you just need to vary the eula line to true as an alternative of false.


Then we press CTRL+S to save lots of and CTRL+X to exit again to the Command Line.


Let’s try the server again!


Should you press UP just a few instances in 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 things and double the -Xmx1024M and -Xms1024M in our command to -Xmx2048M and -Xms2048. Xmx and Xms refer to the amount of memory the server will use. The extra we give it, the better the performance.


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


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


Once your server has completed establishing, you’ll most likely get a couple of messages like this depending on how much reminiscence you assigned it within the earlier command. It’s regular to have a number of of these at startup whatever occurs, so don’t worry an excessive amount of.


High Tip: Better hardware means a greater server. If you’re contemplating retaining your server around, or utilizing it with a lot of people, an 8GB Raspberry Pi 4 (with elevated Xmx and Xms numbers) will carry out better. Attaching an SSD via a USB3.0 port can even assist.


Finally, as gamers join, you’ll be able to see key occasions appear on the terminal as they happen in the game world.


Ouch.


You can stop your server any time by typing


in the Terminal. This may also save your world so you'll be able to resume again at a later time.


Becoming a member of the Minecraft server over your local network


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


On your (or your friend’s) laptop computer or Computer, ensure you're operating the Java Edition of Minecraft (which you'll install from the official Minecraft site - just obtain 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 return to our server terminal!


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


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


Wanting at the above, my native IP is 192.168.1.222. Yours will probably be comparable but not the identical.


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


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


Sadly 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 domestically with your folks, then you’re all completed - congratulations! But the most effective a part of operating a server is that you can play god with the sport world!


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


This time, we want to do the identical thing as we did to signal the EULA however this time we’re going to edit a file known as server.properties (you might have noticed it the final time we used ls).


Type:


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


I won’t go into detail on each possibility, however you may examine 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:


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


High Tip: If you'd like to begin a new Minecraft server, just delete the World folder out of your Minecraft directory, or rename the level-name in server.properties. This can create a new gameworld folder with the up to date name subsequent time the server starts, and you'll change back to the outdated one any time!


Connecting to your Minecraft server remotely


On this project, we’ve proven you the right way to set up and customise a Minecraft server in your Raspberry Pi 4, and how players on the identical Wi-Fi network can join locally to your gameworld.


You’ve additionally realized some useful Linux commands, like ls, nano, and mkdir!


But what if your folks want to attach remotely, from their own properties?


When we think about gamers connecting over the web, we have to discuss extra advanced concepts like port forwarding. We also need to think about safety and what web strangers could do in the event that they gained access to your Raspberry Pi.


Created: 06/07/2022 11:46:02
Page views: 106
CREATE NEW PAGE