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

Want to play Minecraft on your own terms? Set up your own server, create your own worlds, 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 alongside him. It’s not easy to do while he’s playing on his tablet. As he’s only young, allowing him online seems inappropriate.

The solution is simple: set up a Minecraft server on a Raspberry Pi. It’s easy to set up!

What You Will Need

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

  • A Raspberry Pi 3 (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. These instructions for the Raspberry Pi 3 and 4 will give you the best Minecraft server possible.

All of the above, when used with a remote SSH connection 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. Note that the system spec of the Raspberry Pi means that you won’t be able to host too many people. For the Pi 3, certainly don’t attempt to host more than 10.

What Sort of Minecrafter Is This For?

Minecraft hosted on a Raspberry Pi server

Several versions of Minecraft are available.

Creating this server will give you a world that you can access from any device running Minecraft, except, curiously, MinecraftPi. So, versions of Minecraft on a Windows PC, game console, Android, iOS, and Amazon Fire tablets and TV devices will work with this server.

As such, if you have several devices on your local network, these could all access the Minecraft server.

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

Step 1: Install Raspbian and Configure Your Pi

Start off with a fresh copy of Raspbian. You’ll find the latest version at www.raspberrypi.org/downloads. Follow our guide to installing a Raspberry Pi operating system 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  for the full steps. If this seems too complicated, then 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 instead.

Prefer to stick with your existing copy of Raspbian? Simply upgrade to the latest version and update your packages:

sudo apt update

sudo apt upgrade

Next, 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:

  • Go to Advanced Options > Memory Split and change the setting to 16MB. This will free more memory resources for the server.
  • Next, go to Boot Options > Desktop/CLI and select Console. (No need to do this on Raspbian Lite.)
  • If you’re trying this with a Raspberry Pi 1 or 2, find Overclock on the main menu and set this to High. (Raspberry Pi 3 and 4 users can skip this step.)
  • Enable SSH in Advanced Options > SSH.
  • 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

Or:

ifconfig

Make a note of the IP address before continuing.

Step 2: Install the Minecraft Server

Installing Minecraft on the Raspberry Pi relies on the Nukkit server software. Developed specifically for Minecraft: Pocket Edition, Nukkit can be easily installed on the Pi via the command line.

Start by installing Java. This is required for Nukkit to run:

sudo apt install oracle-java8-jdk

Next create a new directory (labelled “nukkit”) then open it:

mkdir nukkit

cd nukkit

With that done, download the Nukkit server software. Be sure to enter this accurately—it’s easier to copy and paste into an SSH session.

wget -O nukkit.jar http://ci.mengcraft.com:8080/job/nukkit/lastSuccessfulBuild/artifact/target/nukkit-1.0-SNAPSHOT.jar

(You can find the most up-to-date builds at the project page.)

Once downloaded, run Nukkit:

sudo java -jar nukkit.jar

This prompts Nukkit to set up the server. When prompted, choose your language (we used eng) then watch as the Minecraft server is generated.

Step 3: Configure Your Minecraft Server

Once you know the server is setup correctly it’s time to configure it. Two configuration files are included with Nukkit: nukkit.yml and server.properties.

To edit these, simply open them in your preferred text editor. On Raspbian, nano is preinstalled, so use

sudo nano nukkit.yml

or

sudo nano server.properties

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

Configure your Minecraft server

A list of server properties can be found in the Minecraft wiki, but several should be edited right away. Start off with:

max-players=10

Older Raspberry Pi models will struggle with more than 10. You might be okay with 5-6 players. Several other options are available to configure that you might be interested in, such as:

pvp=on

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

difficulty=1

Here, the easiest setting is 0.

When you’re done, press Ctrl + X to save and exit, then run:

sudo java -jar nukkit.jar

This will restart the Minecraft server software.

Step 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, using the IP address you noted down earlier. If the ping returns a response from your Raspberry Pi then you’re fine to continue.

All you need to do is launch Minecraft on your computer or tablet, 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. If not, change it!

Connect to your Raspberry Pi Minecraft server

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

Step 5: Extend Your Minecraft Server Functions With Nukkit Plugins

The default configurations for the Nukkit server might not be wholly to your liking. Tweaking nukkit.yml and server.properties is one option, but will only get you so far.

Plugins have been developed for Nukkit that allow you to enhance the basic gameplay. This adds features to the online session that have been omitted, such as the inclusion of animals.

Suggested Nukkit plugins include:

  • MobPlugin: adds mobs and animals to the Minecraft environment
  • WorldEssentials: enables different game modes
  • EssentialsNK: includes additional game modes, multiplayer management tools, and more

These can be installed simply by downloading to your Raspberry Pi and moving them to the plugins directory.

For example, the MobPlugin can be moved with:

sudo mv MobPlugin-1.9.0.1.jar plugins

Head to the nukkitx.com website and click Resources to choose from over 250 plugins for your Raspberry Pi Minecraft server.

Minecraft Server Running on Your Raspberry Pi!

Minecraft can be installed on the 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.

Want to do more with your Raspberry Pi and games? Check our list of game servers that run on the Raspberry Pi 10 Game Servers You Can Run on a Raspberry Pi 10 Game Servers You Can Run on a Raspberry Pi The Raspberry Pi can do many wonderful things, one of which is run as a game server. We show you 10 of the best games it can host. Read More .

Explore more about: DIY Project Tutorials, 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
    September 1, 2019 at 5:12 am

    Hi there!

    Thanks so much for this tutorial! Can someone please help me upload a world from my iPad to my new rPI server? I was able to download the world folder to my computer, but when I add it to the world folder on the rPI, I get the following error:

    04:05:32 [INFO ] Old level data found for "lovely land", converting format
    04:05:33 [ERROR] Could not load level "world_lovely_land2": From type can be only McRegion or LevelDB
    04:05:33 [FATAL] No default level has been loaded

    I can see that the server made a duplicate of the folder and called the original one ".old". it contains a level.dat file, but the region folder is empty.

    Any help would be greatly appreciated!

    Thank you!

  2. Nick G
    August 21, 2019 at 2:11 am

    This guide no longer works, installing the minecraft server or step 2 always fails.
    Does not work past

    sudo apt install oracle-java8-jdk

    i get an error package is not available but referred to by another package.

  3. Alex
    July 29, 2019 at 11:29 pm

    Maybe it's just my tired brain that can't comprehend the guide at 01:03 AM, but after I followed the steps I tried connecting to the server with my usual minecraft installation (JE 1.14).

    I tried configuring the server for about 15 minutes until I noticed that the server is for the Bedrock Edition, not the Java Edition. Maybe an indicator like that in the guide would be cool.

    Otherwise, a great tutorial. After I found my problem, I connected with a Bedrock Edition I had lying around and it worked like a breeze. The only two problems I have now seem to be
    a) Mob Spawning seems to be disabled, although I enabled it in the Settings
    b) When I spawn a mob with commands, it seems to have no AI and no entity-collision. e.g. Zombies only stand around, doing nothing. I can hit them, but at the same time, I can walk right through them

  4. Stephen E Hahn
    July 21, 2019 at 5:33 pm

    Can this be hooked up to the internet so I can play online with a few friends?

  5. Steve Hahn
    July 21, 2019 at 3:37 pm

    after entering the command ‘sudo java -jar BuildTools.jar’ i type the ‘ls’ command and see no spigot with a version number listed. Did something go wrong? How can I fix it?

  6. Steve Hahn
    July 21, 2019 at 3:32 pm

    After I build the .jar file, i type the ls command and there is no spigot with a version number. Did the build not happen successfully? What can I do to fix it?

  7. 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?

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

    My server will not recognize the "sudo chmod +x startminecraft.sh" 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

  9. 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

  10. 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?

  11. 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

  12. 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+

    Glenn

  13. 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

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

    Fantastic guide! Thanks so much!!!

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

    Fantastic tutorial! Thanks so much!

  16. 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?

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

    Can you setup for it to work on your ps4?

  18. 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 :)

  19. 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 :)

  20. 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!

  21. 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 ".startminecraft.sh" line, it says "no such file or directory" -- but I can navigate the and it certainly exists.

  22. 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?

    Thanks!

    Ian