How to Set Up a Minecraft Server on Your Raspberry Pi
Whatsapp Pinterest

Want to play Minecraft on your own terms? Set up your own server, create your own worlds Are These The 5 Greatest Minecraft Worlds Ever Built? Are These The 5 Greatest Minecraft Worlds Ever Built? We're almost five years past its first public release and Minecraft is still one of the most played games in the world. Despite the primitive graphics, these worlds are so grand and so lively that... Read More , perhaps build in them with friends and family?

It’s remarkable, but true: you can do all of this on a Raspberry Pi.

My son is a big fan of Minecraft, and is always wanting me to play along with him. It’s not easy to do while he’s playing on his computer — he’s six, so allowing him online seems a bit inappropriate.

The solution was simple: set up a Minecraft server on the little man’s own Raspberry Pi (with him helping out). Within the hour, we were playing Minecraft together on our dedicated, Raspberry Pi powered server!

Forget spending money on a dedicated PC, it can be done with a compact, credit card-sized Linux computer. The Pi is the perfect solution, and the setup is easy to work through.

What You Will Need

To build a Minecraft server on your Raspberry Pi, you will need:

  • A Raspberry Pi 2 (or later) and power cable. We’re assuming your Pi is in a case.
  • Ethernet cable (preferable to wireless networking).
  • 8GB or larger microSD card.

Although earlier Pi models can be used for this, the results aren’t as good. We’re expecting you want the best Minecraft server experience available. As such, these instructions are for the Raspberry Pi 2 and 3.

All of the above, when used with a remote SSH connection Setting Up Your Raspberry Pi For Headless Use With SSH Setting Up Your Raspberry Pi For Headless Use With SSH The Raspberry Pi can accept SSH commands when connected to a local network (either by Ethernet or Wi-Fi), enabling you to easily set it up. The benefits of SSH go beyond upsetting the daily screening... Read More will let you set up your Pi as a Minecraft server. If SSH isn’t an option, you will also need:

  • USB keyboard
  • USB mouse (or a combination of both)
  • 1 x HDMI cable
  • A monitor or other compatible display

Connect these peripherals before powering on your Raspberry Pi.

You will also, of course, need a copy of Minecraft on your computer.

What Sort of Minecrafter Is This For?

Several versions of Minecraft are available. Not all of them are suitable for use with any type of user-managed Minecraft server.

Creating this server will give you a world that you can access from your Windows PC, or game console version of Minecraft. The low spec of the Raspberry Pi means that you won’t be able to host too many people (certainly no more than 10), for example. So if you have several computers within your local network, these could all be used to access the Minecraft environment running on the Raspberry Pi.

For Minecraft users with mobile devices, you’re probably using the Minecraft Pocket Edition (PE). Unfortunately, this version of Minecraft cannot access the Minecraft server you’re about to create on your Raspberry Pi. The same applies to other Raspberry Pis. Mincraft Pi Edition is based on Minecraft PE, so there is pretty much zero wiggle room there.

In short, you’ll need the main Minecraft open world game from Mojang.

1. Install Raspbian and Configure Your Pi

The fastest way to get started is to install a fresh copy of Raspbian on your Pi How to Install an Operating System on a Raspberry Pi How to Install an Operating System on a Raspberry Pi Here's how to install an OS on your Raspberry Pi and how to clone your perfect setup for quick disaster recovery. Read More . This is done by downloading the latest image of the Debian-based operating system, and writing to the microSD card 5 Mistakes to Avoid When Buying a MicroSD Card 5 Mistakes to Avoid When Buying a MicroSD Card Buying MicroSD cards may seem simple, but here are a few critical mistakes to avoid if you don't want to regret your purchase. Read More .

If using a Flash media writer is a bit too complicated for you, try the NOOBS installer How NOOBS For Raspberry Pi Can Help First Time Users How NOOBS For Raspberry Pi Can Help First Time Users There is something about the Raspberry Pi that might just put people off: until now, setting it up has not been particularly user friendly. NOOBS aims to change that! Read More .

Prefer to stick with your existing copy of Raspbian? Well, if you’re worried about losing work, you could backup the microSD card Easily Clone Your SD Card For Trouble-free Raspberry Pi Computing Easily Clone Your SD Card For Trouble-free Raspberry Pi Computing Whether you have one SD card or several, one thing that you will need is the ability to back up your cards to avoid the problems that occur when your Raspberry Pi fails to boot. Read More , otherwise, simply upgrade to the latest version and update your packages:

sudo apt update
sudo apt upgrade

Once you’ve done this, it’s time to configure the Raspbian environment for running the Minecraft server. Did you set it up with a monitor and keyboard? If so, simply open the Raspberry Pi Configuration tool in the Preferences menu on the desktop.

If you’re accessing via SSH, use sudo raspi-config to open the text-based configuration tool.

Here, make the following changes:

minecraft server raspberry pi

Go to Advanced Options > Memory Split and change the setting to 16MB. This will free more memory resources for the server. Next, find Overclock on the main menu and set this to High. (Raspberry Pi 3 users can skip this step.) Finally, go to Advanced > Expand Filesystem.

With these changes made, go to Finish and reboot Raspbian at the prompt. Once done, login again, and find the IP address of the device with:

sudo hostname -I



Make a note of the IP address before continuing.

2. Install the Minecraft Server

The next stage is to install the server into a dedicated directory. Make a directory called “minecraft” and use the change directory command to open it:

sudo mkdir /home/minecraft
cd /home/minecraft

You’re now ready to download the builder tool from

minecraft server raspberry pi

sudo wget

As you may have guessed from the filename, the Spigot server is written in Java. The latest versions of Raspbian (Jessie and later) have Java built-in. The following command will take around 20 minutes to complete:

sudo java -jar BuildTools.jar

Go fix yourself a drink while this stage completes.

3. Build the Minecraft Server

By the time you’ve made a drink and finished it, the Minecraft server should have been built. It’s time to launch the server. First, use the ls command to find the correct name of the latest spigot.jar file.


This should display a filename similar to spigot-[version].jar. At the time of writing, this was spigot-1.12.2.jar. Launch the server with the following command, making sure you enter the correct version number.

minecraft server raspberry pi

sudo java -Xms512M -Xmx1008M -jar /home/minecraft/spigot-[version].jar nogui

Wait for the server to stop (don’t worry) then open the EULA:

sudo nano eula.txt

Confirm you accept the EULA by changing False to True, then press Ctrl > X to exit and save. Next, relaunch the server:

sudo java -Xms512M -Xmx1008M -jar /home/minecraft/spigot-[version].jar nogui

This time, things will take a bit longer as the map is built. We’re talking 3-5 minutes or so, but this is a one-time only delay. Once the map is created, subsequent restarts will only take half a minute or so.

4. Connect to the Raspberry Pi Minecraft Server

Your Minecraft server should now be online on your local network. Check this using a ping command Networking 101: Ethernet, LANs, and How They Work Networking 101: Ethernet, LANs, and How They Work Even for modern users, the language surrounding home networking can be a little confusing. What's a LAN? Why do I need an Ethernet cable? Isn't it all the same? Read More from another device. If the ping returns results from your Raspberry Pi (you already made a note of the server IP) then you’re fine to continue.

All you need to do is launch Minecraft on your computer, then click Play > Servers. Here, Add Server, inputting the new server details, giving it a name, and adding the IP address. The port number should match the one listed in the server properties (see below). If not, change it!

Your server should then be listed as an option to connect to. Simply select the server to start playing.

5. Configure Your Minecraft Server

Once you know the server is setup correctly and on your network, it’s time to configure it. Begin by editing the server properties. This is a text file that can be accessed with the nano text editor:

sudo nano /home/minecraft/

Various changes are recommended. Whatever you change here, keep in mind that the Pi is a modest device that cannot handle too much processing.

minecraft server raspberry pi

A list of server properties can be found in the Minecraft wiki, but those you should edit straight away are:


You might be okay with 5-6 players. Several other options are available to configure that you might be interested in, such as:

pvp = true

This is for player vs. player action. There’s also a difficulty setting:

difficulty = [integer 0-3]

Here, the easiest setting is 0.

Finally, you should install the NoSpawnChunks plugin, which is designed to prevent too much RAM being eaten up by the Minecraft server. First, open the /plugins subdirectory:

cd /home/minecraft/plugins

Next, download the NoSpawnChunks.jar Java object.

sudo wget -O NoSpawnChunks.jar

This will keep RAM use low, thereby ensuring the server doesn’t run slow.

6. Make Minecraft Server Launch at Boot

If you’re using the Pi as a dedicated Minecraft server, it’s probably a good idea to have the server running at all times. While there’s bound to be some minor downtime, a startup script will ensure the server can start itself automatically.

Start by creating a startup script:

sudo nano /home/

You can call it whatever you like — choose something meaningful though.

Copy the following into your file:

cd /home/minecraft
sudo java -Xms512M -Xmx1008M -jar /home/minecraft/spigot-[version].jar nogui &

minecraft server raspberry pi

You could stop here and just use the file to launch the software, after giving it executable permissions:

sudo chmod +x

Then, run it with:


However, if you prefer to have the script run at boot, find the rc.local file, and edit it:

sudo nano /etc/rc.local

At the end, before the exit 0 line, add:

bash /home/

Again, use Ctrl > X to exit and save the file.

Minecraft Server Running on Your Raspberry Pi!

That’s all there is to it. Your very own Minecraft game server running on the Raspberry Pi. If you leave it up and running, you’ll have an always-on Minecraft world that you can connect to and use. A great solution for Minecraft-loving children, self-hosting the server on your local network keeps their online activity safe — at least as far as playing their favorite game goes.

If your Minecraft constructions are constantly being raided by children or other family members, then take a look at these Minecraft home security tips, which will surely help you to level the playing field!

For more, check out how to add a power button to Raspberry Pi How to Add a Power Button to Your Raspberry Pi How to Add a Power Button to Your Raspberry Pi Want an ordered shutdown for your Raspberry Pi? Here's how to add a power switch and shutdown script to the Raspberry Pi. Read More .

Explore more about: Minecraft, Raspberry Pi.

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Sam Williams
    June 29, 2019 at 7:12 am

    Hey! i know this post if really old but i hope its still active. Does this still work for the 1.14.3 version? And will my friends at their house be able to join the server? Also will i be able to use the Raspberry pi for anything else other then a Mine craft server after i follow all the steps?

  2. Stressed
    March 24, 2019 at 6:34 pm

    My server will not recognize the "sudo chmod +x" command, or boot up without manually being forced to. Does anyone have any expirience with fixing this problem?

    • foxdarkmaster
      June 25, 2019 at 9:39 pm

      That's because of the current directory you're in. Right now you should be on /home/minecraft while the script was created on /home. You need to move to the script directory:

      cd /home

      and then run the script

  3. Hunter BIggs
    February 25, 2019 at 2:28 am

    Once I get to Preparing Spawn Area 84% it sats java.lang.OutOfMemory thrown from the UncaughtExceptionHAndler in thread "SErver console handler" can someone help Im completely stuck

  4. Michael A. Robinson
    January 23, 2019 at 3:10 am

    I downloaded the NoSpawnChunks.jar file and stuck it the the plugins folder, but when I start the server, I get an invalid plugin.yml exception. How can I get around this?

  5. Smouk
    December 31, 2018 at 12:57 pm

    I got stuck at the step where I was supposed to execute the java file. First thing's first, I'm using a Raspberry Pi 3 B+ and when I execute the command:
    sudo java -jar BuildTools.jar

    It prompts me the next message:
    "BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected
    237M. This can often occur if you are running a 32-bit system, or one with low RAM.
    Please re-run BuildTools with manually specified memory, e.g: java -Xmx1024M -jar BuildTools.jar".

    Sure enough I'm using Raspbian and it is a 32-bit OS but I don't think this is the problem since this tutorial was made using Raspbian too. I tried some methods to free up RAM and it showed that there were at least 800M of RAM free so I don't see the problem there either.

    Another "problem" I found was that it wouldn't allow me to overclock the Pi as if the function to do it is not available, it just says:
    "This Pi cannot be overclocked".

    I don't know why that is either, might be because it's not available to the last version since the 3 B+ is the last one but I didn't give it much importance. Anyway, I just hope someone can help me out with this.

    Thanks for your attention.

    • Smouk
      December 31, 2018 at 1:07 pm

      Well, that was quite easy to fix. I just needed to use the next command:
      sudo java -Xmx1024M -jar BuildTools.jar

      With that command ad the prompt suggested you can use the amount of memory you specify, I just didn't think I would be able to use more memory than what it detected. Guess I was wrong, I just used 800M instead of the 1024M of the command above, executed it and it worked just fine.

      I hope this can be of help to someone.

    • Lovsaphira9
      February 15, 2019 at 6:40 pm

      I found that it started working when I allocated some memory space using the command 'sudo java -Xmd512M -jar BuildTools.jar' Not sure why, but it just wanted a specified amount of ram to be allocated to fetching the tools, but I had roughly 812 MB of ram available

  6. Glenn hodges
    December 30, 2018 at 8:04 pm

    I am getting stuck at the java -jar BuildTools.jar. after running it. I get the error. BuildTools requires 512m of memory, only detecting 276m.

    What am I doing wrong?
    Pi3 b+


  7. Anonymoose
    December 9, 2018 at 10:17 pm

    i followed all the steps but when i try to run the .sh file it doesnt show a console

  8. gosplunk
    November 10, 2018 at 3:12 pm

    Fantastic guide! Thanks so much!!!

  9. splunkninja
    November 10, 2018 at 3:11 pm

    Fantastic tutorial! Thanks so much!

  10. Zack
    October 12, 2018 at 3:47 pm

    This is a great tutorial but I have an issue. When I typed the "ls" command, I saw that I had the 1.12.2 version of spigot, but when I type the sudo java -Xms512M -Xmx1008M -jar /home/minecraft/spigot-[version].jar nogui command, it just says "Error: Unable to access jarfile /home/minecraft/spigot-1.12.2. jar"

    What should I do to fix that?

  11. Blake
    October 11, 2018 at 8:01 pm

    Can you setup for it to work on your ps4?

  12. Bo
    September 22, 2018 at 6:23 pm

    Does anyone know how to update spigot to version 1.13.1?

    • HTMLars
      October 5, 2018 at 9:57 am

      Spigot 1.13.1 is not out yet, but im sure it will by this month :)

  13. Please help me
    August 13, 2018 at 1:48 pm

    Okay, I’m having a huge problem, and I know this post is roughly over a year old, but I need help.
    So everything works fine until I get to the:
    sudo java -jar BuildTools.jar
    part. Okay here’s what it does. The code runs fine, and goes to work, until it gets to this this part of it:
    Final mapped jar: work/mapped.cf6b1333.jar does not exist, creating!
    And then it hangs on that message for a few minutes, and just goes to a black screen.
    Like no warning, nothing it just black screens. The lights on the pi are still there, but the screen just goes black.
    It’s definitly not overheating, because I attached a fan to it and monitored the temperature. It didn’t get over 45 degrees Celsius and yet it still just black screened after a while. Any help please?
    Raspberry pi 3 model B, forgot to mention.
    Please help!

    • Ed
      August 31, 2018 at 10:39 pm

      Move the mouse or hit a key, is it not the screensaver kicking in?

    • HTMLars
      October 5, 2018 at 9:58 am

      I am pretty sure the blackout thing is just you'r PI going to sleep...
      For me it took 2,5 hours to install, so just wait :)

  14. CosminPerRam
    July 3, 2018 at 12:06 pm

    This is the best tutorial of how to of this topic! I got it to work on my Raspberry Pi 3 b+ it works flawlessly! The only thing i had problem with was when building with the 'java' command, i didn't had java installed, solved with 'sudo apt-get install oracle-java8-jdk'! Thanks!

  15. John
    May 16, 2018 at 2:34 pm

    I can't get the step 6 to work. It I create the .sh file and save it, but when I try to run the "" line, it says "no such file or directory" -- but I can navigate the and it certainly exists.

  16. Ian
    January 22, 2018 at 2:27 am

    "All you need to do is launch Minecraft on your computer, then click Play > Servers."

    Great tutorial. But do you need to purchase a license for a Minecraft client that can connect to the Raspberry Pi Minecraft server? Or where do you download this client?