Raspberry Pi Minecraft PE Server (Pocket Edition)

In this tutorial, we will be showing you how to set up your very own Raspberry Pi Minecraft PE server. This project is a cheap way of providing you with an always-on, Pocket Edition capable server.

Raspberry Pi Minecraft PE Server

This setup stops you from having to leave your phone or computer online if you want others to be always able to access your world. The Pi is also pretty good on power usage so you can save on your power bill too.

For this tutorial, we will be making use of the Nukkit software. We decided to utilize Nukkit since we found that it was one of the most stable Minecraft Pocket Edition servers currently available.

Please keep in mind the Pi is quite limited in resources so you may have some issues when it comes to performance.

Tweaking the server properties is a great way to get more performance and maybe some room for more people. I wouldn’t recommend having more than five people joining the server. However, you may want to experiment to see how much it will be able to handle.

If you’re after a server for the Java version of Minecraft, then you should check out our previous tutorial that shows you how to set up a spigot Minecraft server.

If you would like to know more about the server software, then you can find out more about it on the Nukkit website.

Equipment List

The following pieces of equipment are what I recommend when it comes to completing this Raspberry Pi Minecraft pocket edition server.

Recommended

Raspberry Pi 3

Micro SD Card

Ethernet Cable or WiFi Dongle (Use a ethernet cable for the best performance)

Power Supply

Optional

Raspberry Pi Case

Note: Don’t forget that if you’re using a Pi 3 then this has WiFi inbuilt and you won’t need a dongle.

Setting up your Raspberry Pi Minecraft PE Server

In this tutorial, we will work entirely within the terminal. In fact, it is best to change the boot mode of the Raspberry Pi, so it boots directly into the terminal for the Minecraft Pocket Edition server.

You can also install Raspbian Lite, so you don’t install any of the additional packages that come with the full version of Raspbian, make sure you install java as we will need that.

Minecraft PE servers are hugely demanding on the Raspberry Pi’s hardware, so every extra bit of resources made available to it, the more it can handle. It’s important to keep this in mind before installing any additional software packages that may drag the performance down.

1. First, let’s make sure everything on the Raspberry Pi is up to date by running the following two commands.

sudo apt-get update
sudo apt-get upgrade

2. Now we will need to make a couple of changes in the raspberry pi config tool. Let’s open the tool by entering the following command:

sudo raspi-config

3. First, let’s go to Advanced Options->Memory Split and update this to 16. (This will allow for more memory to be free for the server)

4. Secondly, now is a good time to change the “boot up” option so that it boots straight into the terminal. Go to Boot Options->Desktop/CLI, and press Enter with Console selected to enable booting to console.

Note: This does not need to be done if you’re running on Raspbian lite.

5. To truly make the most of the Minecraft Pocket Edition server, you will need to overclock your Raspberry Pi.

The following steps only work with the Raspberry Pi 1 and 2 as the raspi-config tool does not currently support the Raspberry Pi 3 for overclocking.

While you’re still in the raspi-config tool, go to Overclock, here pick the “High” overclocking option. This will give the Raspberry Pi a good overclock, though make sure you have a decent, stable power supply, most USB chargers will not cut it.

6. If you haven’t activated SSH before, make sure you go to Advanced Options->SSH and select “Enable”. You will need this for easy access to your Raspberry Pi.

7. Now go to “Finish” and reboot your Raspberry Pi using the following command.

sudo reboot

8. We need to make sure we have Java installed, the following command will install the default JDK package for Raspbian.

sudo apt install default-jdk

9. Before we get too ahead of ourselves, now is a great chance to grab the IP address of the Raspberry Pi. You will need to write down the value from the next command, and we will need to use this later.

In the terminal, enter the following command:

sudo hostname -I

10. With that now set up, we will now proceed with downloading and setting up the Nukkit server software. Before we get too far ahead of ourselves, let’s first make a directory to keep this in, run the following commands to make the directory in the pi user’s root directory.

mkdir ~/nukkit
cd ~/nukkit

11. Finally, let’s download Nukkit, we usually will have to compile the software which can take a while due to the Raspberry Pi’s low processing power, thankfully some nice users have provided their CI (Continuous Integration) servers to the public.

Run the following command to download the latest build of Nukkit to your Raspberry Pi.

wget -O nukkit.jar https://go.pimylifeup.com/3xsPQA/nukkit

12. With Nukkit now downloaded to our Raspberry Pi we can now run it, this will generate all the files we need to be able to configure the server further.

Running Nukkit is incredibly easy, we can run it with the following simple command.

java -jar nukkit.jar

Upon running the server for the first time, you will be asked to choose a language, for this tutorial we will be using English. Therefore we typed eng into the console and pressed enter.

select language

The server should immediately begin to boot up, and the server should display the following text when it is ready to be connected to.

[INFO] Preparing level "world"
[INFO] Starting GS4 status listener
[INFO] Setting query port to 19132
[INFO] Query is running on 0.0.0.0:19132
[INFO] Default game type: Survival Mode
[INFO] Done (3.109s)! For help, type "help" or "?"

While you can now begin to play on your server, you might want first to configure it, so it is set up more to your liking. To do this, first, kill the process by pressing Ctrl + C.

13. Two configuration files come with Nukkit, and one controls Nukkit’s own options such as being able to change the number of chunks it loads in, the other controls the actual Minecraft options such as what game mode you want the server to be using.

You can read up on the server.properties file and see what changes you can make to it by going to the Minecraft server properties page.

Run the following command to edit Nukkit’s configuration file.

nano nukkit.yml

Alternatively, run the following command to edit the Minecraft server configuration.

nano server.properties

Once you have finished making your changes to the configuration files, make sure you save them by pressing Ctrl + X then pressing Y and then Enter.

Afterwards, you can immediately proceed to start up Nukkit again by typing in the following command:

java -jar nukkit.jar

Connecting to your Minecraft PE Server

If you’re on a local network, then it will be easy to connect to the Raspberry Pi Minecraft PE server. To test out our recently setup server, we will need to do the following.

Now load up Minecraft on a Mobile Phone or a Windows 10 PC (Minecraft Windows 10 Edition) that is located on the same local network as the Raspberry Pi.

minecraft pocket edition main menu

Go to the friend’s tab and then your server should pop up at the bottom under LAN Games. If it doesn’t simply go to direct connect and enter the IP we got earlier on the Pi using the command hostname -I. We have highlighted the direct connect button in our screenshot below.

Raspberry Pi Minecraft PE Server Connect Buttons

If you want to allow access to the Minecraft Pocket Edition server via the internet, then you will need to setup port forwarding.

You will need to port forward the port 19132 (Unless you change it in the server properties) to the local IP address of your Raspberry Pi. Keep in mind opening ports always increases the security risk from outside sources.

For more information check out our port forwarding guide for the Raspberry Pi. You can also find this in our Raspberry Pi project eBook along with a ton of other projects & guides.

Updating your Minecraft Pocket Edition Server

1. To update your Raspberry Pi powered Minecraft Pocket Edition Server you will first have to make sure you are in the correct directory by running the following command.

cd ~/nukkit

2. Within this directory, all we need to do is redownload the latest available Nukkit binary from their build servers.

Run the following command to download the latest build of Nukkit to your Raspberry Pi.

wget -O nukkit.jar https://go.pimylifeup.com/3xsPQA/nukkit

3. Once the download has finished you should now have the latest available build of Nukkit, and you can now start your server up again by running the following command.

java -jar nukkit.jar

Start the Pocket Edition Server at Boot

1. To be able to get our Pocket Edition server to start at startup, we will need to go ahead and create a service for it.

Let’s begin writing this service by running the command below.

sudo nano /lib/systemd/system/minecraftpeserver.service

2. Within this file add the following text.

This text defines the service and tells the service manager what file to run.

[Unit]
Description=Minecraft Pocket Edition Server

[Service]
User=pi
Group=pi
Restart=on-abort
WorkingDirectory=/home/pi/nukkit
ExecStart=/usr/bin/java -jar /home/pi/nukkit/nukkit.jar

[Install]
WantedBy=multi-user.target

Once you have entered in all the data, you can save the file by pressing CTRL + X then Y followed by ENTER.

3. Now that we have created our new service we need to go ahead and enable it by running the following command.

sudo systemctl enable minecraftpeserver.service

4. Let’s go ahead and now start up our Pi’s Minecraft Pocket Edition server with the command below.

This command will tell the service manager to start up our newly created service.

sudo systemctl start minecraftpeserver.service

5. If you want to check the status of the Pocket Edition servers service, then you can with the command below.

sudo systemctl status minecraftpeserver.service

Hopefully, by now you should have a fully operational Raspberry Pi Minecraft PE Server. If you come across any issues or have some feedback related to this tutorial, then please don’t hesitate to leave a comment below.

38 Comments

  1. Dave on

    Hi, I just set this up as a service.
    Which is working great.

    However I am no longer in the minecraft console so can’t type in commands on the server which I was able to do before I made it a service.

    1. Gus on

      As a service, it runs in the background. To be able to bring the console back, you will need to stop the service and run the server manually.

  2. Cameron on

    Does this work with 7 people?
    I am running Raspbian Buster on a pi 3b+.
    thanks!

    1. Gus on

      It worked fine with two people, but I think once you get beyond three to five people online at the same time, it will really start to struggle.

  3. DrMedShadow on

    How to get this to auto-start on reboot? Could you give me a tutorial or something else?

    1. Gus on

      The tutorial has now been updated with instructions on setting up auto-start.

  4. zatalian on

    How can i connect this nukkit server to node-red or an mqtt server? Is this possible?

  5. Tim on

    Do you know how to change the seed of the world as it is not working for me.

    1. Gus on

      You should be able to change it in properties file.

      ~/nukkit/server.properties

      Alternatively, you can set it in the nukkit.yml under the worlds section.

      ~/nukkit/nukkit.yml
  6. Ulum on

    Thanks for the tutorial.
    I got java not found error while trying to run the jar, solved it by installing openjdk.

    sudo apt-get install openjdk-8-jre-headless -y

    it works fine.
    I don’t have any knowledge about java, so I don’t know if this makes any difference in performance

    1. Gus on

      Thanks for this Ulum, we have updated the tutorial to now install JDK. It appears it was removed as a pre-installed package.

  7. Evan on

    what do i put for the internal and external port in my router? I just put 19132 for both and i put the ip of my pi but when my friend try to connect it says it cant connect. what do i do?

    1. Gus on

      Hi Evan,

      Technically port 19132 should be correct and allow traffic to flow to your Raspberry Pi.

      Sometimes I find the port forwarding on routers to be a hit and miss. Sometimes, a restart will fix the problem.

      Do you have the model # of your router? as this can help work out issues.

      Thanks,
      Gus

  8. Alex M on

    I’m trying to get this to work with the cross platform edition, it’s not showing up under friends on minecraft. Is there any advice you have on what to do differently for the bedrock edition or will this not work with the bedrock edition?

    1. Emmet on

      Hi Alex,

      This project should definitely work with the bedrock edition, but it will not support all the features of it. I personally do not know why it wouldnt by appearing.

      I am assuming you are connecting within the same local network?

      Cheers,
      Emmet

  9. jhan on

    is there a way to set this server up so you can play even when you are not connected to the same wifi network?

    1. Emmet on

      Hi Jhan,

      Yes it is possible, you will need to portforward port 19132 for this to work however.

      You can find our guide on port forwarding and setting up dynamic DNS at https://pimylifeup.com/raspberry-pi-port-forwarding/.

      Cheers,
      Emmet

  10. GoldAurora on

    Thanks for this tutorial! Please add to your tutorial how to update the nukkit installation. This process worked great for me for a month but now I am getting errors about being outdated.

    I overwrote nukkit.jar using the original command wget -O nukkit.jar https://go.pimylifeup.com/3xsPQA/nukkit and it appears to be working OK but that was just a guess.

    1. Emmet on

      Hi GoldAurora,

      Just re-running the comamnd as you are doing is the best way to update your Minecraft PE Edition server installation.

      We have added a section to the tutorial to reflect this.

      Cheers,
      Emmet

  11. Karlos on

    Good article. The only thing I did different was to install it as a service. That way it starts on boot and restarts if crashes etc.

    Create a service file.

    sudo nano /lib/systemd/system/minecraft-server.service

    Add this:
    [Unit]
    Description=Minecraft Server

    [Service]
    WorkingDirectory=/opt/nukkit
    ExecStart=/usr/bin/java -jar nukkit.jar

    [Install]
    WantedBy=multi-user.target

    Assuming you files are in opt like mine.

    Then run
    sudo systemctl daemon-reload
    sudo systemctl enable minecraft-server

    Now you should be able to start the server with:

    sudo service minecraft-server start

  12. Bradley on

    How to get this to start on reboot?

    1. Sasha on

      Run sudo nano /etc/rc.locals and paste the server start command from root (/) and on end of command type & sign. Past it before exit 0 command!

  13. Alex on

    Hi,
    Has anyone got this working with the new 1.2.2 version of minecraft, it seems to be a big update.

    1. Alex on

      Hi,
      Once I worked out exactly where the forums were pointing me for the files, this seems to work! I have build 81 running and I have connected from 1.2.3 on iPad. Just need the kids to try and break it now…

  14. Rick on

    Hmm, mine seems to be stuck on debugging. I tried disabling debug mode (going into the nukkit.yml and changing debug to 1) but it doesn’t work. Don’t know what else to try.

  15. Virgil on

    After:
    sudo java -jar nukkit.jar

    I get an error:
    ERROR: Invalid or corrupt jarfile nukkit.jar

    How do you fix this issue stuck on this step.

    1. Gus on

      Have you tried redownloading the file ?

    2. Matthew on

      You probably made the O in -O -o

    3. Joe on

      You need to CD to Nukkit/archive/target then try again

  16. Simon on

    Fantastic guide – I did have one problem which was that I used Raspbian Jessie Lite not realising this does not come with Java, and when I tried to run the server with command line “sudo java -jar nukkit.jar” I received an error that ‘java’ was an unknown command.

    To install java I just used the command:

    sudo apt-get update
    sudo apt-get install oracle-java8-jdk

    Worked great and the server seems to run OK without the need for overclocking so far.

    Thanks again for a great guide

  17. Chad Lawson on

    Can this support API type calls? I’d like to have actions in the game trigger GPIO and vice versa.

    1. broo0ose on

      If you install the Pokkit plugin for Nukkit, it can then use plugins for the Spigot and Bukkit servers. The upshot of this is that you can run the RaspberryJuice plugin which gives you the python API.

    2. Chad Lawson on

      Excellent. Thank you for replying.

  18. Shawn on

    I need help!!! How do I access it via internet without port forwarding?

    1. Gus on

      You won’t be able to access it without port forwarding.

  19. Aniruddh kammar on

    Excellent guide!! Thanks to the maker, I got my mcpe server running within an hour

    Problems I faced and troubleshooting them

    The version on the server and mcpe version need to be same. My were different so it kept displaying “syncing packets to server” or something like that

    Be careful the are many build for a same version eg: mcpe 1.1.0.x
    I found the correct build by hit and trial. I tried all the builds of the version and one worked at last. make sure that you reboot the server after trying each build as sometimes it gets stuck.

  20. Tom on

    the first time i connected my client, I was able to build. After i diconnected, and reconnected, i can no longer build in minecraft. What do I need to change

    1. Aniruddh kammar on

      You must have fiddled with the .yaml file maybe try re-installing the server
      You can remove the nukkit directory and install it again

Leave a Reply

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