Difference between revisions of "Raspberry Pi Tutorial Host A Minecraft Server On Ubuntu Desktop"

From Yogi Central
Jump to: navigation, search
m
m
Line 1: Line 1:
<p>Welcome to the second in our sequence of Linux gaming posts within the run as much as the vacations. This week, we’ve put together a tutorial that teaches you how one can create a primary Minecraft Server on a Raspberry Pi with Ubuntu Desktop, so you can play locally with your mates.</p><br /><br /><p>This is a superb afternoon mission to work on with a pal or family member!</p><br /><br /><p>Internet hosting a Minecraft server unlocks a tonne of further management over the way you play Minecraft with your folks. You possibly can change the sport rules and problem, the behaviour of enemies and determine how gamers work together.</p><br /><br /><p>Setting up a server is also an amazing way to learn extra about Linux. Linux is all about tinkering and making an attempt new things. Whereas it will probably seem intimidating at first, the directions you’ll follow for this venture will assist you method extra advanced Linux projects in the future!</p><br /><br /><p>In this tutorial, we’ll be utilizing a Raspberry Pi four 4GB with a 32GB SD card, but you too can comply with along on pretty much any laptop computer or Laptop that has Ubuntu Desktop installed. You could even use a Virtual Machine. [https://joensen-nixon.blogbright.net/finest-minecraft-1-16-three-mods-june-2022 Minecraft servers list] </p><br /><br /><p>Try these tutorials for getting began with Ubuntu Desktop on these platforms:</p><br /><br /><p>Computer tutorialVirtualBox tutorialRaspberry Pi tutorialObserve: We’ll be using Ubuntu Desktop 21.10 for Raspberry Pi in this tutorial, and advocate you follow together with Ubuntu Desktop 21.10 on no matter device you employ.</p><br /><br /><p>Of course, you’ll also need another Computer or laptop with Minecraft Java Version installed so you may hook up with your server once you’ve created it!</p><br /><br /><p>Let’s jump in.</p><br /><br /><p>Install Ubuntu on your Raspberry Pi and update</p><br /><br /><p>If you’ve followed the Raspberry Pi set up tutorial, you’ll be just about ready to go, but at any time when we start a brand new mission, it’s all the time important to verify everything is up to date.</p><br /><br /><p>Go forward and open a terminal (ALT+T or click on the Terminal icon in your sidebar) and kind:</p><br /><br /><p>Enter your password and press Y when prompted.</p><br /><br /><p>It will examine whether your version of Ubuntu is updated and obtain and install any new packages.</p><br /><br /><p>Install Java</p><br /><br /><p>Minecraft servers are primarily based on Minecraft Java Edition, the unique 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 specifically set up the latest Java Runtime Atmosphere (jre), which is version 18:</p><br /><br /><p>Type your password and press Y when prompted.</p><br /><br /><p>Create a folder for your server</p><br /><br /><p>Now you need a place to place the Minecraft server on your Pi. We might do it the ‘Windows’ method by opening the file supervisor, right-clicking, and creating a new Folder named Minecraft. But we’re already within the terminal, so let’s keep typing right here!</p><br /><br /><p>The above will do exactly the identical thing as utilizing the file manager. In fact, you can verify the file manager your self to affirm that the brand new folder has appeared!</p><br /><br /><p>Since we’re going to install our server inside the brand new folder, we need to tell our terminal that we’re going to work there.</p><br /><br /><p>In case you type</p><br /><br /><p>You can see that we’re still in the home listing of our Pc. You’ll see your Documents and Downloads folders, as well as the brand new Minecraft folder you created. To get inside this folder, we'd like to vary Listing (cd), so kind:</p><br /><br /><p>In the event you kind 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 consists of the Minecraft folder title:</p><br /><br /><p>Download Minecraft Server!</p><br /><br /><p>Go away your terminal open, but now you additionally must open your web browser.</p><br /><br /><p>In your browser, go to this page: https://www.minecraft.net/en-us/download/server</p><br /><br /><p>We wish to obtain the server linked right here, but as a substitute of left-clicking it, let’s Proper-Click and choose Copy Link.</p><br /><br /><p>This can be sure to always get the latest version of the server when following this tutorial!</p><br /><br /><p>Depart 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 obtain the server to this folder.</p><br /><br /><p>After which Right-Click on and Paste the link to the server. It ought to look something like this:</p><br /><br /><p>Then press ENTER. This command instructs your Pi to ‘get’ (download) no matter file is linked at that internet address you gave it.</p><br /><br /><p>You will note the download complete, and when you then kind:</p><br /><br /><p>You’ll see we now have a server.jar file in our Minecraft folder!</p><br /><br /><p>Start your server!</p><br /><br /><p>Go back to https://www.minecraft.web/en-us/download/server, and this time copy the Java directions listed into your terminal.</p><br /><br /><p>Press ENTER and… Error??</p><br /><br /><p>That’s because we simply instructed our Pi to run a file called minecraft_server.1.18.jar, however you possibly can see from our last ls that after we put in the server it was just called server.jar.</p><br /><br /><p>That’s an easy fix.</p><br /><br /><p>When you press UP on the keyboard, your final instruction will probably be repeated. Do that now, after which edit the filename to server.jar and press ENTER again.</p><br /><br /><p>Success!</p><br /><br /><p>Form of. Now now we have one other error. We need to comply with the tip User License Settlement (EULA) before we can get began.</p><br /><br /><p>So where’s the EULA?</p><br /><br /><p>Well let’s use our trusty</p><br /><br /><p>on our Minecraft listing yet another time. You’ll see the set up course of has created a set of latest recordsdata. This is good, because these files are what allows us to play round with the sport guidelines! However before we are able to get to the enjoyable stuff, let’s sign the EULA.</p><br /><br /><p>We will do that instantly within the terminal (you can do the whole lot within the terminal, that’s why it’s so cool) using a textual content editor referred to as nano. Kind:</p><br /><br /><p>This may open the eula.txt file in your terminal window. Now you simply need to alter the eula line to true instead of false.</p><br /><br /><p>Then we press CTRL+S to save lots of and CTRL+X to exit again to the Command Line.</p><br /><br /><p>Let’s try the server once more!</p><br /><br /><p>If you press UP a few times in your keyboard, we are able to repeat the instruction from earlier without typing it out once more.</p><br /><br /><p>However let’s make one final change before we run issues and double the -Xmx1024M and -Xms1024M in our command to -Xmx2048M and -Xms2048. Xmx and Xms seek advice from the quantity of memory the server will use. The extra we give it, the higher the performance.</p><br /><br /><p>Now we press ENTER again and the server should start properly!</p><br /><br /><p>This next bit goes to take a while. And also you in all probability won’t be capable to browse Fb while you’re waiting, as most of the Raspberry Pi will likely be focussed on standing up the server.</p><br /><br /><p>Once your server has completed organising, you’ll in all probability 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 a couple of of these at startup no matter happens, so don’t worry too much.</p><br /><br /><p>Prime Tip: Higher hardware means a better server. If you’re considering retaining your server round, or utilizing it with lots of people, an 8GB Raspberry Pi four (with elevated Xmx and Xms numbers) will perform better. Attaching an SSD via a USB3.0 port will even help.</p><br /><br /><p>Ultimately, as gamers join, you’ll be able to see key occasions appear on the terminal as they happen in the sport world.</p><br /><br /><p>Ouch.</p><br /><br /><p>You may stop your server any time by typing</p><br /><br /><p>in the Terminal. This may even save your world so you may resume once more at a later time.</p><br /><br /><p>Becoming a member of the Minecraft server over your local community</p><br /><br /><p>If you’ve invited your pals to join your server on their laptops, they’re probably a bit impatient to get going by now. However we’re finally prepared!</p><br /><br /><p>In your (or your friend’s) laptop or Pc, be sure that you are running the Java Edition of Minecraft (which you'll install from the official Minecraft site - just obtain it and double-click on).</p><br /><br /><p>Then they should navigate to Multiplayer &gt; Direct Connection.</p><br /><br /><p>Now they need to enter the local IP deal with of the server which is… hmmm. We don’t know.</p><br /><br /><p>Let’s return to our server terminal!</p><br /><br /><p>To find out the server’s native IP, you could open a second terminal window, or a brand new tab in the current terminal (or simply stop your server for this bit and restart it after).</p><br /><br /><p>This will produce a string of numbers, however you only need the primary set.</p><br /><br /><p>Looking on the above, my local IP is 192.168.1.222. Yours shall be similar however not the same.</p><br /><br /><p>So that’s what my guests should add of their games:</p><br /><br /><p>Once your visitors have entered your server IP, they simply need to click Join Server and they’re in!</p><br /><br /><p>Sadly for my server, I spawned proper subsequent to a spider. And it was raining.</p><br /><br /><p>Modifying your Server Settings</p><br /><br /><p>If you wish to play regular Minecraft locally with your folks, then you’re all executed - congratulations! However the very best a part of running a server is that you could play god with the sport world!</p><br /><br /><p>Let’s shut the server (cease, remember?) and do some tweaking.</p><br /><br /><p>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 referred to as server.properties (you might have spotted it the last time we used ls).</p><br /><br /><p>Kind:</p><br /><br /><p>This should deliver up all the configuration options for your server. If you scroll down there’s fairly a few!</p><br /><br /><p>I won’t go into element on every choice, but you'll be able to examine them on the Minecraft Wiki.</p><br /><br /><p>Personally, I simply want to turn off the spiders and alter the server’s message of the day, so I’m going to make the next tweaks:</p><br /><br /><p>Just as earlier than, we press CTRL+S after which CTRL+X to avoid wasting and exit!</p><br /><br /><p>Top Tip: If you need to start a new Minecraft server, simply delete the World folder out of your Minecraft listing, or rename the level-title in server.properties. This can create a new gameworld folder with the updated identify next time the server begins, and you may swap back to the old one any time!</p><br /><br /><p>Connecting to your Minecraft server remotely</p><br /><br /><p>In this project, we’ve shown you the way to arrange and customise a Minecraft server on your Raspberry Pi 4, and the way players on the same Wi-Fi network can join regionally to your gameworld.</p><br /><br /><p>You’ve additionally realized some useful Linux commands, like ls, nano, and mkdir!</p><br /><br /><p>However what if your mates need to connect remotely, from their very own houses?</p><br /><br /><p>When we think about players connecting over the web, we need to talk about extra advanced concepts like port forwarding. We also want to contemplate security and what internet strangers may do in the event that they gained access to your Raspberry Pi.</p>
+
<p> Welcome to the second in our series of Linux gaming posts in the run up to the holidays. We've created a tutorial this week that shows you how to create a Minecraft Server on a Raspberry Pi using Ubuntu Desktop. This will allow you to play locally with your friends.</p><br /><br /><p> This is a great afternoon project to work on with a friend or family member!</p><br /><br /><p> Hosting a Minecraft server unlocks a tonne of additional control over how you play Minecraft with your friends. You can change the game rules and difficulty, the behaviour of enemies and determine how players interact.</p><br /><br /><p> Setting up a server is also a great way to learn more about Linux. Linux is all about tinkering and trying new things. While it can seem intimidating at first, the instructions you'll follow for this project will help you approach more complex Linux projects in the future!</p><br /><br /><p> In this tutorial, we'll be using a Raspberry Pi 4 4GB with a 32GB SD card, but you can also follow along on pretty much any laptop or PC that has Ubuntu Desktop installed. You could even use a Virtual Machine.</p><br /><br /><p> Check out these tutorials for getting started with Ubuntu Desktop on these platforms:</p><br /><br /><p> PC tutorial VirtualBox tutorial  Raspberry Pi tutorial  Note: We'll be using Ubuntu Desktop 21.10 for Raspberry Pi in this tutorial, and recommend you follow along with Ubuntu Desktop 21.10 on whatever device you use.</p><br /><br /><p> Of course, you'll also need another PC or laptop with Minecraft Java Edition installed so you can connect to your server once you've created it!</p><br /><br /><p> Let's jump in.</p><br /><br /><p> Install Ubuntu on your Raspberry Pi and update</p><br /><br /><p> If you've followed the Raspberry Pi installation tutorial, you'll be pretty much ready to go, but whenever we start a new project, it's always important to make sure everything is up to date.</p><br /><br /><p> Go ahead and open a terminal (ALT+T or click the Terminal icon in your sidebar) and type:</p><br /><br /><p> Enter your password and press Y when prompted.</p><br /><br /><p> This will check whether your version of Ubuntu is up to date and download and install any new packages.</p><br /><br /><p> Minecraft servers are based on Minecraft Java Edition, the original version 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 specifically install the latest Java Runtime Environment (jre), which is version 18:</p><br /><br /><p> Type your password and press Y when prompted.</p><br /><br /><p> Create a folder for your server</p><br /><br /><p> Now you need a place to put the Minecraft server on your Pi. We could do it the 'Windows' way by opening the file manager, right-clicking, and creating a New Folder named Minecraft. But we're already in the terminal, so let's keep typing here!</p><br /><br /><p> The above will do exactly the same thing as using the file manager. In fact, you can check the file manager yourself to confirm that the new folder has appeared!</p><br /><br /><p> Since we're going to install our server inside the new folder, we need to tell our terminal that we're going to work there.</p><br /><br /><p> If you type</p><br /><br /><p> You can see that we're still in the home directory of our PC. You'll see your Documents and Downloads folders, as well as the new Minecraft folder you created. To get inside this folder, we need to Change Directory (cd), so type:</p><br /><br /><p> If you type ls again, you can 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:</p><br /><br /><p> Download Minecraft Server!</p><br /><br /><p> Leave your terminal open, but now you also need to open your web browser.</p><br /><br /><p> In your browser, go to this page: https://www.minecraft.net/en-us/download/server</p><br /><br /><p> We want to download the server linked here, but instead of left-clicking it, let's RIGHT-CLICK and select Copy Link.</p><br /><br /><p> This will make sure you always get the latest version of the server when following this tutorial!</p><br /><br /><p> Leave that page open, as we'll come back to it shortly. Now go back to the terminal window, making sure we're still in the Minecraft folder, and tell the terminal to download the server to this folder.</p><br /><br /><p> And then RIGHT-CLICK and Paste the link to the server. It should look something like this:</p><br /><br /><p> Then press ENTER. This command instructs your Pi to 'get' (download) whatever file is linked at that web address you gave it.</p><br /><br /><p> You will see the download complete, and if you then type:</p><br /><br /><p> You'll see we now have a server.jar file in our Minecraft folder!</p><br /><br /><p> Start your server!</p><br /><br /><p> Go back to https://www.minecraft.net/en-us/download/server, and this time copy the Java instructions listed into your terminal.</p><br /><br /><p> Press ENTER and... Error? ?</p><br /><br /><p> That's because we just told our Pi to run a file called minecraft_server.1.18.jar, but you can see from our last ls that when we installed the server it was just called server.jar.</p><br /><br /><p> That's an easy fix.</p><br /><br /><p> If you press UP on the keyboard, your last instruction will be repeated. Do that now, and then edit the filename to server.jar and press ENTER again.</p><br /><br /><p> Success!</p><br /><br /><p> Sort of. Now we have another error. We need to agree to the End User License Agreement (EULA) before we can get started.</p><br /><br /><p> So where's the EULA?</p><br /><br /><p> Well let's use our trusty</p><br /><br /><p> on our Minecraft directory one more time. You'll see the installation process has created a set of new files. This is good, because these files are what allows us to play around with the game rules! But before we can get to the fun stuff, let's sign the EULA.</p><br /><br /><p> We can do this directly in the terminal (you can do everything in the terminal, that's why it's so cool) using a text editor called nano. Type:</p><br /><br /><p> This will open the eula.txt file in your terminal window. Now you just need to change the eula line to true instead of false.</p><br /><br /><p> Then we press CTRL+S to save and CTRL+X to exit back to the Command Line.</p><br /><br /><p> Let's try the server again!</p><br /><br /><p> If you press UP a few times on your keyboard, we can repeat the instruction from earlier without typing it out again.</p><br /><br /><p> 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 more we give it, the better the performance.</p><br /><br /><p> Now we press ENTER again and the server should start properly!</p><br /><br /><p> This next bit is going to take a while. And you probably won't be able to browse Facebook whilst you're waiting, as most of the Raspberry Pi will be focussed on standing up the server.</p><br /><br /><p> Once your server has finished setting up, you'll probably get a few messages like this depending on how much memory you assigned it in the previous command. It's normal to have a few of these at startup whatever happens, so don't worry too much.</p><br /><br /><p> Top Tip: Better hardware means a better server. If you're considering keeping your server around, or using it with a lot of people, an 8GB Raspberry Pi 4 (with increased Xmx and Xms numbers) will perform better. Attaching an SSD via a USB3.0 port will also help.</p><br /><br /><p> Eventually, as players join, you'll be able to see key events appear on the terminal as they happen in the game world.</p><br /><br /><p> Ouch. [https://www.pearltrees.com/liquidsword85/item456385716 Minecraft blog] </p><br /><br /><p> You can stop your server any time by typing</p><br /><br /><p> in the Terminal. This will also save your world so you can resume again at a later time.</p><br /><br /><p> Joining the Minecraft server over your local network</p><br /><br /><p> If you've invited your friends to join your server on their laptops, they're probably a bit impatient to get going by now. But we're finally ready!</p><br /><br /><p> Make sure that you have the Java Edition of Minecraft installed on your computer or friend's computer.</p><br /><br /><p> Then they need to navigate to Multiplayer &gt; Direct Connection.</p><br /><br /><p> Now they need to enter the local IP address of the server which is... hmmm. We don't know.</p><br /><br /><p> Let's go back to our server terminal!</p><br /><br /><p> To find out the server's local IP, you need 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).</p><br /><br /><p> This will produce a string of numbers, but you only need the first set.</p><br /><br /><p> Looking at the above, my local IP is 192.168.1.222. Yours will be similar but not the same.</p><br /><br /><p> So that's what my guests should add in their games:</p><br /><br /><p> Once your guests have entered your server IP, they just need to click Join Server and they're in!</p><br /><br /><p> Unfortunately for my server, I spawned right next to a spider. And it was raining.</p><br /><br /><p> Modifying your Server Settings</p><br /><br /><p> If you want to play regular Minecraft locally with your friends, then you're all done - congratulations! But the best part of running a server is that you can play god with the game world!</p><br /><br /><p> Let's close the server (stop, remember?) and do some tweaking.</p><br /><br /><p> This time, we want to do the same thing as we did to sign the EULA but this time we're going to edit a file called server.properties (you might have spotted it the last time we used ls).</p><br /><br /><p> Type:</p><br /><br /><p> This should bring up all the configuration options for your server. If you scroll down there's quite a few!</p><br /><br /><p> I won't go into detail on every option, but you can read about them on the Minecraft Wiki.</p><br /><br /><p> Personally, I just want to turn off the spiders and change the server's message of the day, so I'm going to make the following tweaks:</p><br /><br /><p> Just as before, we press CTRL+S and then CTRL+X to save and exit!</p><br /><br /><p> Top Tip: If you want to start a new Minecraft server, just delete the World folder from your Minecraft directory, or rename the level-name in server.properties.</p> This will create a new gameworld folder with the updated name next time the server starts, and you can switch back to the old one any time!<br /><br /><p> Connecting to your Minecraft server remotely</p><br /><br /><p> In this project, we've shown you how to set up and customise a Minecraft server on your Raspberry Pi 4, and how players on the same Wi-Fi network can connect locally to your gameworld.</p><br /><br /><p> You've also learned some handy Linux commands, like ls, nano, and mkdir!</p><br /><br /><p> But what if your friends want to connect remotely, from their own homes?</p><br /><br /><p> When we think about players connecting over the internet, we need to talk about more advanced concepts like port forwarding. We also need to consider security and what internet strangers could do if they gained access to your Raspberry Pi.</p>

Revision as of 17:42, 9 August 2022

Welcome to the second in our series of Linux gaming posts in the run up to the holidays. We've created a tutorial this week that shows you how to create a Minecraft Server on a Raspberry Pi using Ubuntu Desktop. This will allow you to play locally with your friends.



This is a great afternoon project to work on with a friend or family member!



Hosting a Minecraft server unlocks a tonne of additional control over how you play Minecraft with your friends. You can change the game rules and difficulty, the behaviour of enemies and determine how players interact.



Setting up a server is also a great way to learn more about Linux. Linux is all about tinkering and trying new things. While it can seem intimidating at first, the instructions you'll follow for this project will help you approach more complex Linux projects in the future!



In this tutorial, we'll be using a Raspberry Pi 4 4GB with a 32GB SD card, but you can also follow along on pretty much any laptop or PC that has Ubuntu Desktop installed. You could even use a Virtual Machine.



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



PC tutorial VirtualBox tutorial Raspberry Pi tutorial Note: We'll be using Ubuntu Desktop 21.10 for Raspberry Pi in this tutorial, and recommend you follow along with Ubuntu Desktop 21.10 on whatever device you use.



Of course, you'll also need another PC or laptop with Minecraft Java Edition installed so you can connect to your server once you've created it!



Let's jump in.



Install Ubuntu on your Raspberry Pi and update



If you've followed the Raspberry Pi installation tutorial, you'll be pretty much ready to go, but whenever we start a new project, it's always important to make sure everything is up to date.



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



Enter your password and press Y when prompted.



This will check whether your version of Ubuntu is up to date and download and install any new packages.



Minecraft servers are based on Minecraft Java Edition, the original version 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 specifically install the latest Java Runtime Environment (jre), which is version 18:



Type your password and press Y when prompted.



Create a folder for your server



Now you need a place to put the Minecraft server on your Pi. We could do it the 'Windows' way by opening the file manager, right-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 same thing as using the file manager. In fact, you can check the file manager yourself to confirm that the new folder has appeared!



Since we're going to install our server inside the new folder, we need to tell our terminal that we're going to work there.



If you type



You can see that we're still in the home directory of our PC. You'll see your Documents and Downloads folders, as well as the new Minecraft folder you created. To get inside this folder, we need to Change Directory (cd), so type:



If you type ls again, you can 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!



Leave your terminal open, but now you also need to open your web browser.



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



We want to download the server linked here, but instead of left-clicking it, let's RIGHT-CLICK and select Copy Link.



This will make sure you always get the latest version of the server when following this tutorial!



Leave that page open, as we'll come back to it shortly. Now go back to the terminal window, making sure we're still in the Minecraft folder, and tell the terminal to download the server to this folder.



And then RIGHT-CLICK and Paste the link to the server. It should look something like this:



Then press ENTER. This command instructs your Pi to 'get' (download) whatever file is linked at that web address you gave it.



You will see the download complete, and if you then type:



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



Start your server!



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



Press ENTER and... Error? ?



That's because we just told our Pi to run a file called minecraft_server.1.18.jar, but you can see from our last ls that when we installed the server it was just called server.jar.



That's an easy fix.



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



Success!



Sort of. Now we have another error. We need to agree to the End User License Agreement (EULA) before we can get started.



So where's the EULA?



Well let's use our trusty



on our Minecraft directory one more time. You'll see the installation process has created a set of new files. This is good, because these files are what allows us to play around with the game rules! But before we can get to the fun stuff, let's sign the EULA.



We can do this directly in the terminal (you can do everything in the terminal, that's why it's so cool) using a text editor called nano. Type:



This will open the eula.txt file in your terminal window. Now you just need to change 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 try the server again!



If you press UP a few times on your keyboard, we can repeat the instruction from earlier without typing it out again.



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 more we give it, the better the performance.



Now we press ENTER again and the server should start properly!



This next bit is going to take a while. And you probably won't be able to browse Facebook whilst you're waiting, as most of the Raspberry Pi will be focussed on standing up the server.



Once your server has finished setting up, you'll probably get a few messages like this depending on how much memory you assigned it in the previous command. It's normal to have a few of these at startup whatever happens, so don't worry too much.



Top Tip: Better hardware means a better server. If you're considering keeping your server around, or using it with a lot of people, an 8GB Raspberry Pi 4 (with increased Xmx and Xms numbers) will perform better. Attaching an SSD via a USB3.0 port will also help.



Eventually, as players join, you'll be able to see key events appear on the terminal as they happen in the game world.



Ouch. Minecraft blog



You can stop your server any time by typing



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



Joining the Minecraft server over your local network



If you've invited your friends to join your server on their laptops, they're probably a bit impatient to get going by now. But we're finally ready!



Make sure that you have the Java Edition of Minecraft installed on your computer or friend's computer.



Then they need to navigate to Multiplayer > Direct Connection.



Now they need to enter the local IP address 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, you need 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 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 be similar but not the same.



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



Once your guests have entered your server IP, they just need to click Join Server and they're in!



Unfortunately 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 done - congratulations! But the best part of running a server is that 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 same thing as we did to sign the EULA but this time we're going to edit a file called server.properties (you might have spotted it the last time we used ls).



Type:



This should bring up all the configuration options for your server. If you scroll down there's quite a few!



I won't go into detail on every option, but you can read about them on the Minecraft Wiki.



Personally, I just want to turn off the spiders and change 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 save and exit!



Top Tip: If you want to start a new Minecraft server, just delete the World folder from your Minecraft directory, or rename the level-name in server.properties.

This will create a new gameworld folder with the updated name next time the server starts, and you can switch back to the old one any time!

Connecting to your Minecraft server remotely



In this project, we've shown you how to set up and customise a Minecraft server on your Raspberry Pi 4, and how players on the same Wi-Fi network can connect locally to your gameworld.



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



But what if your friends want to connect remotely, from their own homes?



When we think about players connecting over the internet, we need to talk about more advanced concepts like port forwarding. We also need to consider security and what internet strangers could do if they gained access to your Raspberry Pi.