Setting up a “robust” Minecraft server (Java Edition) on a Raspberry Pi

My kids are gamers, and they love Minecraft. Minecraft sells its client software, but the server software is freely available. Since it is written in Java, it can run easily on Linux. Meanwhile, you can order neat little Raspberry Pi Linux computers for less than $50. So, putting two and two together, you can build cheaply a little box (not much bigger than my hand) that can be used as a permanent, low-power, perfectly silent game server. And you can expose your kids to servers, Linux and so forth.

There are many guides to setting up a Minecraft server on a Raspberry Pi, but the information is all over the place, and often obsolete. So I thought I would contribute my own technical guide. It took me a couple of long evenings to set things up, but if you follow my instructions, you can probably get it done in a couple of hours, once you have assembled all the material.

We are going to setup a Minecraft server for the old-school Java-based Minecraft. There are other Minecraft versions (e.g., on mobile devices) but they require different software. To be clear: if you are running Minecraft on a smartphone, a console or a tablet, it is probably not compatible with the regular Minecraft.

My instructions have been tested thoroughly and they work. I recommend you pay close attention to each step. It is not difficult, but you need to be conscientious.

You can take liberties and improvise, but if you do so, please understand that you are likely on your own to fix the problems you create.

Some people like to see a video of the setup:
Wakka Gaming & Tech made a video from this guide.


  • You need a working computer connected to the Internet. My instructions work whether you have a Mac, a Windows PC or a Linux box.
  • You need to buy a Raspberry Pi. I recommend getting a Raspberry Pi 4. Getting the model with 4GB of RAM might be a nice bonus. I tried long and hard to get a stable and fast server running on a first-generation Raspberry Pi, but it was not good. I find that the Raspberry Pi 3 is much better than the Raspberry Pi 2, unsurprisingly. I recommend that you dedicate the Raspberry Pi to the sole purpose of running a single Minecraft server. Trying to run other software, or more than one server, on the same Raspberry Pi is likely to cause troubles. So if you want to do several projects with a Raspberry Pi, then order several Raspberry Pis.
    • You need a power cord to go with the Raspberry Pi.
    • Moreover, you need a micro SD card. I recommend getting, at least, an 8GB card. Given how cheap cards are, you might as well get a larger card so that you do not ever have to worry about running out of space. I recommend getting the fastest card you can find. (Speed is normally indicated as a number, such as 5 or 10. Higher numbers are better.) For good measure, get several cards. SD cards wear out so you should plan on replacing the SD card; avoid re-using older SD cards.
    • I recommend getting a nice plastic box to enclose your Raspberry Pi, just so that it is prettier and sturdier.
    • You might also need an ethernet cable if you do not have one already. If you are going to use the Raspberry Pi, it is best to connect it directly to your router: wifi is slower, more troublesome and less scalable. I have had no end of trouble trying to run a Raspberry Pi server using wifi: I don’t know whether it is possible.
    • Though it is not strictly necessary, I urge you to get a heat sink for the CPU of the Raspberry Pi. The processor of the Raspberry Pi may heat up and when it does, the performance of the computer may drop drastically.
    • An HDMI cable, an HDMI-compatible monitor or TV, a USB keyboard and a USB mouse are also be required at first though not to run the server per se. The Raspberry Pi 4 needs a micro-HDMI to HDMI cable unlike the older Raspberry Pis that relied on a standard HDMI cable.


  • You need to put the latest version of the Linux distribution for the Raspberry Pi, Raspbian, on the SD card. My instructions assume that you get the full version. For some reason, many people prefer the “lite” version, but then they can’t follow my instructions. Please use the full version (the lite and the full versions are both free). You can make things work with the “lite” version and even save a few steps and some storage space, but if you go down the “lite” route, do not complain if my instructions do not work for you. If you have an old version of the operating system, do not try to upgrade it unnecessarily. Starting from a fresh version is best. Simply follow the instructions from the Raspberry Pi website. Downloading the image file may take forever.
  • At first, you will need a monitor or a TV (with an HDMI connection), a keyboard and a mouse connected to the Raspberry Pi. Connect your Raspberry Pi to your router through the ethernet cable. Put the SD card in the Raspberry Pi. If, like it happened to me, the card won’t stay plugged in, just use a rubber band. Do so with some care as you can easily damage the SD card or the Raspberry Pi by pushing the card at the wrong angle or with too much strength. It is really, really important that the card be put in the Raspberry Pi nicely: some boxes that you might put the Raspberry Pi into make it difficult to fit the card just right. If needed, remove the Raspberry Pi from the box you put it in to make sure that everything is plugged in just right. Plug the monitor, the keyboard, and the mouse. Plug the power in and it should start.
  • The Raspberry Pi will launch in a graphical mode with mouse support and everything you expect from a modern operating system: we will soon get rid of this unnecessary luxury. Hopefully, you have Internet access right away. Because I am assuming that you are using an ethernet cable (as opposed to wifi), there should be no configuration needed for Internet access.
  • By default your username is “pi” on this new Raspberry Pi. Do not change it even if you know how. If you do so, you will need to update all the instructions: you are on your own.
  • Go to the terminal. On a Raspberry Pi with a graphical desktop, it can sometimes be found on the Desktop itself maybe under the name LXTERMINAL. You should be able to find it quickly by navigating through the graphical desktop and looking the icons. When it launches, the terminal application starts a “bash shell” (by default). In a shell, you type commands followed by the enter key. Try typing pwd, it should return /home/pi. If so, congratulations! You are on your way to becoming a Linux hacker!
  • (Optional) It helps to know that files in a modern computer are organized into directories (sometimes called folders). Directories can contain other directories, and so forth. On a Raspberry Pi, by default, you have a home directory located at /home/pi. You can create new directories under this home directory. You generally cannot write to files located outside your home directory and its subdirectories, nor can you create new directories everywhere: to do so, you need to invoke administrative privileges which is done by prefixing your commands by the sudo instruction. However, you should only use the sudo when it is strictly necessary as it is a security risk and it affects the file and directory permissions. It might help if you are familiar with the following shell commands:
    • pwd: gives you the current (working directory).
    • echo $HOME: gives you the location of your home directory (this should be /home/pi throughout.
    • cd newdirectory: changes the current directory to newdirectory if it exists.
    • mkdir newdirectory: creates a new directory called newdirectory under the current directory.
    • ls: displays all files and directories in the current directory.
    • cd ..: changes the current directory to the parent directory.
    • rm myfile: permanently deletes the file called myfile.
    • cp myfile1 myfile2: creates a new file called myfile2 which has the same content as myfile1.
    • mv myfile1 myfile2: moves or renames the file myfile1 to myfile1.
  • Install a few extra packages by typing this command line sudo apt-get install netatalk screen avahi-daemon default-jdk, followed by the enter key. Though the command may span more than one line in your browser, enter it as a single line. Do not skip this important step. Please do not get into an argument as to whether you need all three packages: just install them, life is short.
  • Try typing screen -list. If it complains that there is no screen command, go back to the previous step and install it. Otherwise, you should get a message of the type No Sockets found: that’s good!
  • Then type sudo raspi-config. This command starts a little configuration tool.
    1. First, tell it to expand the file system so that it uses all the SD card.
    2. For safety, I recommend changing the default password (the default account is called pi with password raspberry).
    3. You want to tell the Raspberry Pi to boot in the shell: Console Autologin Text console, automatically logged in as 'pi' user.
    4. In Internationalisation Options, you may want to configure the time and locale.
    5. You may want to set the overclocking to the maximum setting, if the option is available. (Overclocking is optional and may cause instabilities and crashes.)
    6. You want to assign the minimum amount of memory to the GPU (16 is enough) from Advanced Options.
    7. Under the advanced options, you may want to check the Hostname value. It defaults to raspberrypi, I assume you are not changing it. You may need to change it if you have several Raspberry Pis on your network.
    8. Make sure that the ssh server is on. The term “ssh” stands for “secure shell”, it is a way to connect to the shell of another machine remotely and securely (with encryption).
    9. A nice trick at this point is to find the IP address of the Raspberry Pi on your network. Type ifconfig|grep "inet ". The result might contain two lines, one line with the string “addr:” and another with a string that looks like “addr:”. In that case, is your IP address (your address will be different). Note that if you can access your router, you should also be able to find the IP address of your Raspberry Pi, but not everybody can or should access their router.

    You can exit raspi-config which should bring you back to the bash shell. Reboot the Raspberry Pi by typing sudo reboot in the bash shell.

  • From your PC or Mac on the same network, you need to connect by ssh to [email protected].
    • On a Mac, just go to Terminal (Finder/Applications/Utilities/Terminal) and type ssh [email protected].
    • If you are using Windows, you can access your Raspberry Pi via ssh by using Putty. (If you have Windows 10, Microsoft makes available a Linux subsystem with full support for ssh. If you can make the Linux subsystem work, then typing ssh [email protected] in its bash shell should work.)

    If, somehow, raspberrypi.local does not resolve, then replace it by the hard-coded IP address we found previously by typing ifconfig. Using a hard-coded IP address is not a good idea because it may change over time. However, temporarily using the hard coded IP address can allow you to make progress (e.g., check the configuration of the Raspberry Pi).

    You should now be in the bash shell on the Raspberry Pi. Once this work, you can unplug the Raspberry Pi from the monitor, the keyboard and the mouse. Your server is now “headless”.

  • From your home directory on the Raspberry Pi, create a directory where you will install the Minecraft files: mkdir minecraft && cd minecraft. (This is a single command, on a single line.) You can install your files elsewhere, but you need to adapt the instructions below accordingly.
  • Download the build file for Spigot (your chosen Minecraft software) using the following command line:

    (Though the command may span several lines in your browser, it is a single line.)

  • Build the server by entering the following command line: java -jar BuildTools.jar (one line followed by the return key). If it complains about not finding the java command, try typing sudo apt install default-jdk (one line followed by the return key) before typing again java -jar BuildTools.jar. Once the java program starts, its will take forever. Go drink coffee. After a long time, in my case, it created a file called spigot-1.9.jar as well as many other files. Type ls spigot*.jar to find how the jar files is called, I will assume that you have spigot-1.9.jar. Adapt the instructions below according to the actual name of the file.
  • Once this is done, start the server for the first time: java -jar -Xms512M -Xmx1008M spigot-1.9.jar nogui. This will create a file called eula.txt. You need to edit it with the command nano eula.txt. Make sure it reads eula=true.
  • Start the server a second time: java -jar -Xms512M -Xmx1008M spigot-1.9.jar nogui. It will take forever again. Go drink more coffee. Once the server return the command prompt, it should be operational. Have a Minecraft player connect to raspberrypi.local. Once you have verified that everything works, type stop.
  • If you made it this far, then you got a minecraft server running on your Raspberry Pi. Fantastic! However, we want the server to keep on running even when we are not connected by ssh to the server. There are many ways to do this, but we will use screen to achieve our goal. It is not the best way, but it should be good enough.
  • We are going to create a convenient script to start the server. Type nano and write the following four lines of code:
    if ! screen -list | grep -q "minecraft"; then
      cd /home/pi/minecraft
      screen -S minecraft -d -m java -jar  -Xms512M -Xmx1008M spigot-1.9.jar nogui 

    It is really important to type the 4-line script (or copy and paste it) accurately. You can also grab the file from GitHub if you prefer.

    The if clause helps to make sure that only one instance runs at any one time (it is not perfect, but should be good enough).

    Some people have trouble copying and pasting the content of the file. As a sanity test, type wc -l The shell should return 4 indicating that the script has 4 lines, if you do not see the number 4, do not continue! If you get any number other than 4, then you did not correctly copied the script, it will not work. I am aware that your browser might represent on the web page the 4 lines as more than 4 lines, but there are exactly 4 lines to be copied.

    We also want to check the syntax of the script, so type bash -n this command should return immediately without any error. Now that we have verified that the script has four lines and has a valid syntax, let us make the script executable: chmod +x

    You did remember that I am assuming that you have a file called spigot-1.9.jar, right? If your file name differs, please adapt the script accordingly. Please read the script again, make sure that everything is ok.

  • To make the server more stable, type nano spigot.yml. Set view-distance: 5. This may or may not be necessary, you can experiment. The downside of this setting is that the clients will get a more limited view.
  • Optionally, you may want to type nano and modify the greeting message given by the motd variable.
  • We want the server to start automatically when the Raspberry Pi reboots, so type sudo nano /etc/rc.local and enter su -l pi -c /home/pi/minecraft/ right before the exit command.
  • Start the server again using the script: ./ while in the bash shell. (I recommend against typing sudo ./ as it would run the server as the root user: you do not want that.) The script will return you to the shell. There should be no error, if there is an error then you need to backtrack and start again: you missed a step somewhere. (These instructions have been thoroughly tested: chances are good that you did not follow them correctly if you are getting an error.)
  • Your minecraft server (Spigot) is managed using its own console. The console operates a bit like the bash shell: you type commands followed by the enter key. It is also used by the server to log its operations, so you can see what it is currently doing. To access the console of the minecraft server type screen -r minecraft, to return to the shell type ctrl-a d. At any point, you can now disconnect from the server. The server is still running. You do not need to remain connected to the Raspberry Pi.
  • Spigot makes use of temporary files (located in /tmp). This can cause performance issues and instabilities on a Raspberry Pi. It may even shorten the life of your SD card. It might be better to have temporary files reside in memory. To alleviate the problem, open the file /etc/fstab with a text editor such as nano as root (e.g., type sudo nano /etc/fstab). It should look something like this:
    proc            /proc           proc    defaults          0       0
    /dev/mmcblk0p6  /boot           vfat    defaults          0       2
    /dev/mmcblk0p7  /               ext4    defaults,noatime  0       1

    The important point is that there should be no line where the second entry is “/tmp”. Then append a new line:

    tmpfs           /tmp            tmpfs   nodev,nosuid,size=1M 0    0

    Where you append/insert this line does not matter, but please note that you need to create a new line. The format of the fstab file requires that there is one entry per line. For this change to take effect, I recommend simply stopping the Minecraft server, by going to the server prompt (type screen -r minecraft if needed) and then typing stop. Then you can safely reboot the Raspberry Pi (e.g., with the sudo reboot command). If you have done everything right, the server should automatically start following a reboot sequence. In the future, the temporary files will get written to /tmp which is actually a disk in memory. Thus, your SD card won’t get touched so often.

  • You are done, congratulations!

And voilà ! The result is a “robust” and low-cost Minecraft server.

If you ever need to stop the server, just log in with ssh, use screen -r minecraft to get to the server prompt and type stop. At the bash prompt, type sudo shutdown -h now. Wait a few seconds, then unplug the Raspberry Pi.

The add a Minecraft plugin, drop the corresponding jar file in the plugins directory under the minecraft directory (/home/pi/minecraft/plugins) and restart the server (type stop in the server prompt and relaunch You can recover plugin jar files from the Internet using the wget or curl commands in a shell followed by the URL such as wget If you misplaced the jar file on the Raspberry Pi, you can move it to the right directory with the mv command: mv theplugin.jar /home/pi/minecraft/plugins. If you have the plugin jar files on your Windows PC, you can use sftp to upload them to the Raspberry Pi from your PC. There are free sftp clients such as WinSCP.

You can easily setup several such servers, just buy more Raspberry Pis!

Next, you can make the server available on the Internet using a service like, and some work on your router to redirect the Minecraft port (25565) from your router to the Raspberry Pi. It is not very difficult to do but it requires you to know a few things about how to configure your router. You should also be aware of the security implications. I am not going to tell you how to do it because the specifics depend on your exact configuration, on how you access the Internet, how your router is configured and so forth. At best, I could describe various scenarios, but if things go wrong, it could leave you without Internet, with security hole, or with a violation of the terms of services of your Internet provider. So you are on your own if you want to expose your server to the Internet at large.

Want to get your Raspberry Pi to do something different? I recommend simply switching to a different SD card containing the latest Linux distribution for Raspberry Pis. It is generally faster to start anew than to reconfigure a machine and given how inexpensive SD cards are. Don’t waste time reusing an existing card.

You may wonder why setting up a Minecraft server is so complicated. Can’t I or others just package the servers so that it is plug and play? We are limited because the copyright owners of Minecraft do want us to ship ready-to-run Minecraft servers. It should be possible, however, to largely automate the steps that I have outlined. I leave it as an exercise for the reader.

Is there any point to all of this? Probably not. Minecraft servers like Spigot are memory hungry and the Raspberry Pi has little memory. However, the project has stretched my imagination and made me think of new possibilities. I used to recycle old PCs as home servers to provide backups and caching for various projects. I got tired of having old, noisy and bulky PC in my home… but I could literally stack a cluster of Raspberry Pi computers in a shoe box. The fact that they are silent and use little power is really a blessing.

Extra: What if you have installed the Minecraft server, and now want to upgrade it? Sadly, there is no built-in support for in-place updates in Spigot as far as I know. When the software does not support updates, many things can go wrong if you try to force an update so I simply recommend against updates. If you need a new version, just reinstall a new version from scratch. If you want to explore with in-place updates despite my contrary advice, one comment to this post describes a possible approach, but I do not recommend it particularly. It is at your own risks.

Further reading: A short version of this blog post is a chapter in the book “Creative projects with Raspberry Pi” by K. Kearney and W. Freeman.

Published by

Daniel Lemire

A computer science professor at the University of Quebec (TELUQ).

317 thoughts on “Setting up a “robust” Minecraft server (Java Edition) on a Raspberry Pi”

  1. Hi I followed your tutorial and everything seemed to install correctly. However when i tried to start the server for the first time i get the message Error: Unable to access jarfile spigot-1.9.jar can you tell me what I am need to do to correct this.

    1. Right. The command: java -jar BuildTools.jar will create a jar file, type ls spigot*.jar to find how the jar file is called, it might not be spigot-1.9.jar if you are installing a different version of spigot.

  2. Hi, thanks for your work! I do have a problem, in the next script:
    if ! screen -list | grep -q “minecraft”; then
    cd /home/pi/minecraft/1.9.2 ( i did ad a “.2”)
    while true; do
    screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M spigot-1.9.2.jar nogui && break ( i did ad a “.2 ” here as wel)
    it says:”no such file or directory” When i look in the minecraft folder, i don’s see a file or folder named 1.9 or 1.9.2.

    any idea’s what i am doing wrong?


  3. Err… Help..!
    Got to the pint of the start-up script and added the part to call it from ‘rc.local’.
    Re-booted the Pi , text scrolls up the screen as normal, gets to the part where it calls the script and then just prints out…
    ‘/home/pi/minecraft/ line 4: screen: command not found’ continuously.
    Any ideas what is wrong, and how do i get back into my Pi?.

  4. Ah… that sorted it. It would help if I read your instructions properly. 🙂
    The Minecraft server is working brilliantly now on my Pi3.
    Thanks for you help and a speedy response.

  5. Awesome work and thank you very much. Is it possible to have multiple worlds (survival/creative etc) with different names so that we can play together or apart and log in using different server properties or similar?

    1. Look up Multiverse Spigot. Put it in your plugins folder (in the folder where the server was set up somewhere) and look up how to use it.

  6. When starting with the lite Raspbian image, you need to install the following additional packages: oracle-java8-jdk, git

    1. Absolutely correct! So glad I saw your comment buried in here! I don’t want to waste valuable resources for a GUI I’ll never use, so I have my Pi multi-server running on lite. Was having a terrible time getting this to work until I saw your comment. I did an apt-get remove openjdk* then apt-get install oracle-java8-jdk and BOOM! IT WORKS!

      Thank You!

      1. I don’t want to waste valuable resources for a GUI I’ll never use

        I guess you refer to disk usage. However, large SD cards are quite cheap. You can get an 8GB SD card for less than 10$.

  7. I have written your script as you have done but I get the error.

    Usage: grep [OPTION]… PATTERN [FILE]…
    Try ‘grep –help’ for more information.

    ./ 4: ./ minecraft: not found

      1. I had the script written wrong but still it didn’t work.

        When I corrected the script it ran the minecraft server but gave errors and crashed.

        I am not sure of the errors as it was going to fast to read.

      2. the CLI should be sudo grep –version

        the version I am running is 2.20

        I am not sure if it is a error with the script or if its the netatalk screen?

        I can boot the server up by itself without the script



      3. I am running the latest Raspbian Jessie (Lite) update also running the latest build of BuildTools.jar and running a raspberry pi 3.

        Not sure what else I can do to get the script to work.

        Do you think a reinstall of Netatalk might work or an older version?



        1. I recommend starting from a clean image and following the instructions carefully, step by step. They are thoroughly tested and definitively work on a Raspberry Pi 3. If you do not want to do this, you will have to find how your system is messed up.

          1. I have installed a new image and the script is not working still.

            I followed the instructions to the letter.

            If I was rude Daniel I am sorry didn’t mean to be.

              1. Hi Daniel,
                I wouldn’t say it definitely works, but it does in most cases.

                For example – netstat shows the pi listening on ports 22 and 25565 but I am unable to connect on the latter. Fing, on the other hand, shows only port 22 open – Connections to 25565 fail. Security/firewall settings on the pi possibly.

                Your instructions, while very detailed, make certain assumptions. The version of raspian, security settings, Minecraft server version. With the most current full version of raspian there appears to be an issue. It is a great starting point though and I thank you for publishing this.

                1. With the most current full version of raspian there appears to be an issue.

                  I did a fresh setup two weeks ago with the latest Raspbian (2018-11-13) and it worked for me, as it had always done. It is possible that something changed in the ecosystem and that my instructions are no longer adequate, and that I was just lucky…

                  However, I would argue that it would be useful for you to qualify what you mean by “I am unable to connect”. Presumably, you started the server and it runs fine. So everything in my instructions worked for you, except that “you are unable to connect”. Ok.

                  Can you elaborate…?

                  For example, which Minecraft client are you using?

                  1. Furthermore, your comment suggests that it is related to the current version. Can we deduce that you did it with an earlier version and that you verified that it worked. Otherwise, how could you tell that the problem is related to the current version of the OS?

  8. Thanks very much for taking the time to develop this and to write it up, by far the most thorough and clear instructions I’ve found. My kids and I got a server up and running in a few hours last weekend.
    Now that the 1.10 update has arrived, I wonder if you have any tips for going about installing the update.
    Thanks again.

    1. I’ve just done this for the first time on our little Pi2 – it can barely handle the load but it’s good enough for some father/son goofing around!

      I’m not using Spigot, I’m using the default minecraft server jar file.
      So: download the new version 1.10 server jar file from
      Put it in the same directory as your previous server file.
      Update the script by changing the filename from the old to the new file.
      I’m not sure if it will generate a new World or not – I started at 1.10 because we just today pulled the long-dormant Pi2 out of its storage.

      1. I know this post was from last year, but for anyone reading this, don’t do what this guy did. The Mojang server is way too slow on the Pi (even a Pi3). Spigot is definitely worth the extra time and effort to build, it’s waaay faster than the default Minecraft server!

        1. I’ve been running a server on a Pi3 using Spigot for nearly a year. Every now and then it kicks me off in the middle of cavorting around the world, but that seems to be happening more recently since updating a few of the plugins. I’m running Multiverse, Multiverse Portals, Multiverse Sign Portals, and Slimefun with a few SF addons. I’ve also started using BetterFoliage and Conquest resource pack on the client side, and the game has never looked better! I just need to figure out why the crashes seem to be happening a little more frequently, but it’s not enough to make the overall experience unpleasant.

  9. Thanks, very helpful guide. If anyone gets a TransportException or some kind of SSL error, the –disable-certificate-check flag can come in handy with BuildTools. GIT errors can be solved by clearing the working folder and starting again. Also in my case I had time to grab a coffee and two sausage rolls, head out for the afternoon, come back, write this comment and it’s still not finished on my Raspberry Pi 3.

      1. I don’t know if it’s just me, but from a Raspbian Lite image, I’ve been overrun with SSL errors. The only way to get BuildTools to start was to disable cert checking; then I had to restart the process several times to get it to complete a build and when I thought it was nearly done it went on to throw a maven plugin download transport cert error. I thought I had it, but it’s just gone and failed now.

  10. Hello Daniel, from Paris.

    I am very thankful for this step by step recipe. The only trouble i do encounter is when after launching the server, I’d like to return to the shell typing “ctrl-a d”. Doesn’t work. But I do suspect a wrong action on my side which I couldn’t figure out.

    And I was wondering if there is a way to change the parameters of the world we created from survival to creative / terrain aspect, etc.

    Thank you again.

    1. The only trouble i do encounter is when after launching the server, I’d like to return to the shell typing “ctrl-a d”.

      If you have followed my instructions, then after starting the server, you should still be in the bash shell.

      If you open a screen to access the server terminal, then, by definition, you will be in a screen session, and those can be closed by hitting “ctrl-a” then “d”.

      And I was wondering if there is a way to change the parameters of the world we created from survival to creative / terrain aspect, etc.

      Of course. You can configure the server in various ways. It is outside the scope of my blog post however.

  11. It is important to note that the directions will not work if you are using Raspi 3 with Jessie Lite.
    So far I’ve had to install several packages including java and git, change classpath etc. and I am still facing errors.
    Exception in thread “main” org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of reset command. {0}

  12. First I want to thank you Daniel.
    So thank you for this guide. I have raspberry pi 3 and right now it is running minecraft server so I can play it with my kids during rainy days.


  13. Is there something more efficient about the Spigot build of Minecraft over the one distributed by Mojang, allowing the former to run better on a Raspberry Pi than the latter?

    1. Most people running a server want the option of customizing it, something that Spigot makes trivial. A vanilla server would probably work well on a Raspberry Pi, but you would not be able to benefit from the Spigot ecosystem.

  14. Daniel,

    Just wanted to say thank you so much! I’m very new to linux, but not new to minecraft. Just bought a Raspberry Pi 3 and was super excited to set it up, but naturally without programming basics, I had no idea how. Thanks to you my server is now up and running. Thanks man!

  15. What’s the reason for installing Netatalk? That is a package used for sharing your stuff with Apple computers – using the RPi as an Apple (AFP) file server, Appletalk print server, etc. It does not seem at all necessary for getting Minecraft-server working.

    1. That’s correct but my instructions should work whether you have a Mac, Windows or Linux PC. If you have a Mac, netatalk simply makes the Raspberry Pi discoverable by Macs and iOS devices (iPhone). Even if you do not need it, it does no harm and it does not require any effort. It is free convenience.

  16. Daniel,

    Thank you so much for your post.

    How to uninstall BuildTools.jar (I executed the command: java -jar BuildTools.jar in my raspberry pi 2 with KODI) . I would like to install it in a new raspberry pi 3 without any other application.

    Thank you in advance.


  17. Perhaps my question is better in this way:

    How to remove the installation of server (…) by executting command: java -jar BuildTools.jar? Should I remove directories (apache-maven, BuildData, Bukkit, CraftBukkit, Spigot and work) which were created by BuildTools? Anything else?

    Thank you in advance,


  18. Great post – thank you! When setting RAMTMP=yes, the tmpfs file already includes some other parameters (commented out). Is it worth uncommenting any of these and/or modifying them? I have a Pi 2. Thanks!

    # Size limits. Please see tmpfs(5) for details on how to configure
    # tmpfs size limits.
    #LOCK_SIZE=5242880 # 5MiB

    # Mount tmpfs on /tmp if there is less than the limit size (in kiB) on
    # the root filesystem (overriding RAMTMP).

  19. I Keep getting a Connection lost error, It reads : Internal Exception: And existing connection was forcibly closed by the remote host. After it boots me off the sever crashes and i need to reboot the server manually and just will crash 10-20 minutes later do you have any idea whats going on?

    1. I recommend restarting from the start, with a fresh image. Please follow the instructions carefully, step by step. They work reliably, but, unfortunately, too many people skip ahead or take liberties.

  20. Hello,

    I’ve followed everything but the server wont run with “java -Xms512M -Xmx1008M -jar spigot-1.10.2.jar nogui”. I need to add a sudo in front.

    The problem is that when I edit the file by doing:
    “sudo screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui && break”
    “screen -S minecraft -d -m sudo java -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui && break”
    the server doesn’t restart when it crashes… I’ve ran out of ideas to try and fix this. Help would be much appreciated.
    Thanks in advance!

    1. I’ve followed everything but the server wont run with “java -Xms512M -Xmx1008M -jar spigot-1.10.2.jar nogui”. I need to add a sudo in front.

      Please start from a fresh image, follow the instructions exactly as they appear without taking any liberty. In particular, do not run the server as root.

  21. For a while now I have needed a script to restart a process running under screen on reboot. While it may sound simple, your script was exactly what I needed. Thanks for that!

  22. Hi, I am using your tutorial and I havent gotten very far yet, right now i am trying to make the server headless using the windows 10 bash shell (I also tried putty) but when I type the command to connect and make the raspi headless, I get this message “Connect to host rasberrypi port 22: is temporarily unavailable” Yes I did enable ssh in raspi config steps. Help please?

      1. i am having a similar issue mine says “unable to open connection to raspberrypi.local Host does not exist” i also tried using the IP address for it as well with the same result.

      1. I checked cpu load with htop, and know what the flag does from my time as a former java-developer.
        is there any good practice to benchmark a minecraft server under identical circumstances, to get robust and significant results?

        1. The main problem we face with respect to running a stable Minecraft server on a Raspberry Pi is running out of resources, including memory. We want to minimize “pauses” caused by garbage collection and, ultimately, we want to reduce the risk that we will run out of memory entirely.

          If you run the server for any length of time with actual users, what you get are people who complain about latency.

          So we want a JVM optimized for low-latency.

          In this context, my question is whether the server flag will improve latency in low-memory conditions?

          No. I do not know how to benchmark it, but I am uneasy about recommending an extra flag without any supporting evidence.

  23. Very intetesting tutoriel, I found here info that I never seen.

    Quick question about Neither world, does it work ? I don’t see in your tutorial that you deactivate it.

    Thanks !

  24. Great tutorial – All though I cant get the startup script working:

    if ! screen -list | grep -q “minecraft”; then
    cd /home/minecraft
    while true; do
    screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui && break

    Yes, I’m running it as user minecraft, therefore the /home/minecraft

    If I run this command in the terminal as user minecraft in home dir, it runs great:

    screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui

    Any suggestion, to point me in the right direction?

          1. same issue, however; when i run the ‘./’ I’m given a syntax error: unexpected end of file

            I used an ssh client to copy and paste the code directly, making only the necessary spigot version change. Still can’t figure it out.

            Code follows:
            if ! screen -list | grep -q “minecraft”; then
            cd /home/pi/minecraft
            while true; do
            screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M
            spigot-1.11.2.jar nogui && break

              1. Hey Just so you know Most people do this on there raspberry pi. What you posted MAY look like 6 lines to you but when i pasted it it took 7 lines Everything is fixed but Not everyone has the same resolution you do. Try using a 1260×1023 monitor and then BOOM 7 lines GET YO FACTS STRAIGHT!

  25. greetings, from the netherlands. Im installing minecraft server for my kids, but do not know anything about the game 😉
    Installed the full raspian version in pi3 and followed your instructions. The server starts up and runs. The minecraft server is found in the minecraft client (on LAN). but cannot connect because of authentication failure. Internet search suggest disabling online-mode. Then the client can connect.
    Any idea what the issue with the authentication ? Is it a problem is the online-mode stays disabled ?

  26. My kid and I followed the instructions, except the netatalk installation as this is only for Apple. And we did do the automated starting of the server at reboot. My kid uses a different user than pi, and he did the whole instructions with this user. We made the script and it worked. But once we adapted the RAMTMP setting and rebooted, we could not run the script anymore. It says: “could not find” while we are in the folder containing the script, and where the jar file is. If we just start the command itself for the server, it works fine. We did do the chmod action.

    1. My instructions assume that the user is “pi”. You can still make it work if you take liberties and change your user name, but you then need to adapt the instructions accordingly.

      I recommend that you follow the instructions as-is.

      1. Thought so. Just bought additional sd cards, so we can try again. Keep you posted. Just thought it was weird that it worked before the reboot.

    2. Try this to start the script:
      This assumes you are in the /minecraft directory.
      The ./ forces the shell to look in the current directory, which doesn’t alway exist in you path.

  27. How do you go about adding mods? tried doing a google search but was not able to find anything that was a straight, cut and dry step by step detailed list of instructions.

  28. hello daniel i thank you very match for the minecraft server.
    everything is working. even

    Ferry a son of Marc

  29. Excellent tutorial.
    Went exactly as planned.

    This is probably the first ever tutorial that actually worked exactly as explained.
    Well done and thank you.

      1. I’m running it using a Pi 3 and a 375gb WD Pi Drive and the following mods: Dynmap, Multiverse, Multiverse Portals, Multiverse Netherportals. We have two fairly large world files we connect using Multiverse.

        I’ve ran concurrently with 6 people (2 local, and 4 remote). As long as we have it set to pause the dynmap renders when people login, we can all play normally with some occasional block update lag. It works about as well as when I used to play mc on the same pc that the mc server was run on. Generating a new Nether portal has caused a crash about a third of the time.

        My friends and I are starting to look into using this method using a 4-node pi cluster. If we have any success I’ll let you know.

  30. So i have the problem ./> line 4> screen> sommand not found and also when i type screen in console it says command not found. any suggestions

  31. Thanks Daniel… Works like a charm…
    Now to find tutorials to make our own mods for the server. Since this is a server, I don’t suppose we can easily create custom mobs for the game? The client will need to know how the mobs work and the custom textures too…

  32. Thanks for the tutorial Daniel. It’s working for me as well.

    And i’m still running in graphic mode. Also running an Apache webserver. And changed my hostname. The server runs well for me.

    A small thing, as a Raspberry Pi and Linux beginner, i had it little difficult with:
    Install a couple of extra packages: sudo apt-get install netatalk screen. Do not skip this important step as we need screen. (The netatalk package is only needed if you have a Mac. In such cases, the netatalk allows your Mac to interact with the Pi more easily on the network.)
    I luckily find out, if you do not have a Mac, you still have to run: sudo apt-get install screen.

    To make the server accessible from the internet. You have to forward 25565 in your router to your local Raspberry-Pi IP address.

    It’s easy if you know some of routers, but if not, it’s difficult to do. Since every home router isn’t the same and Port Forward settings could be in an different place or naming.

    I later found this site: (when searching for RealVNC ports).

    1. I luckily find out, if you do not have a Mac, you still have to run: sudo apt-get install screen.

      My recommendation is to run sudo apt-get install netatalk screen as made clear by the following comment (Do not skip this important step as we need screen.). For some reason, people seem to object to having to install netatalk. I don’t understand why. But if you do object, then sure, type sudo apt-get install screen.

      1. I did not know netatalk and screen are two different applications. Also not knowing you can install mutiple applications in one line.

        For a complete beginner, i would write it as: sudo apt-get install screen. And a second line sudo apt-get install netatalk.

        So i think that is way some people think it’s everything or nothing. And maybe they miss installing screen, because they don’t have a Mac.

        1. I tell people to type sudo apt-get install netatalk screen. I then tell not to skip this important step.

          If one decides to skip the command… I am not exactly sure what else I can do.

  33. Hello. I greatly appreciate this post. Which leads me to my next question… I haven’t played since 1.3.2 (minecraft) and want to host a modded server for myself and some friends. I mention my experience with the older version because I don’t know
    1) how to mod a server
    2) I’ve modded older clients
    3) is it a similar process?
    Thanks in advance, as I can’t seem to find anything on this elsewhere.

  34. I’m running a pi 3 with Raspien and get an error message the jar file doesn’t exist when I search ls spigot*.jar

    Can you assist?

  35. Ho Daniel, I wanted to know if with this server you can also play with a Android client.
    Now I have installed, in my tablet, the v0.16.1 version of the Minecraft Pocket Edition.

  36. So, I compiled it on my Chromebook instead (which only took a few min.), and ran the Spigot jar on my Raspberry Pi. Everything seemed to work, except I was getting some SSL security warnings. I couldn’t figure out how to solve it, so I tried to compile it on the Raspberry Pi itself, which indeed took forever… When it was finally done it didn’t create any jar file… I have no clue how to fix these warnings, hopefully someone can help me out.

    1. My bad, I was running the lite version… Downloaded the full version, and everything’s working fine now!

      Thanks a lot for your awesome guide!

  37. Hello Daniel
    Thanks so very much for creating these instructions! I followed them and everything worked well the first try and my kids have been playing with the server for several months.
    Now it seems that we need to upgrade the server to the latest spigot. Could you please give some advice/help with instructions for how to do that as well?

      1. Just posted instructions on how to update the Spigot file. You’ll need to run the Buildtools command again, pointing the command to the new Spigot file. Just posted instructions at the bottom of the thread.

        The commands have been tested and it works.

  38. Whaaa, can’t play Minecraft anymore.
    Outdated server! I’m still on 1.10.2. Is the message i got.
    Does Spigot automatically change when Minecraft also changes to a new version?

    Already found this post: (from today).

    I will read the post later. Kids are waking up, so daddy time for me. But my biggest question. When i do start al over. How can i create a backup from my current World? It would be nice NOT to start over in Minecraft as well.

    I will post my experiences.

  39. Here’s the fix to update the outdated Spigot file

    All commands to be run in:

    1) rm craftbukkit-1.10.2.jar
    2) rm spigot-1.10.2.jar
    3) java -jar BuildTools.jar –rev 1.11
    4) java -jar -Xms512M -Xmx1008M spigot-1.11.jar nogui

    Don’t forget to update your startup scripts.


  40. And it all works again!!

    Spigot updated their server to version 1.11. With version 1.10.2 i could not play Minecraft anymore. “Outdated server! I’m still on 1.10.2.” Is the message i got.

    What i did:

    I made a backup (copy) of the \world map. But this was not necessary.

    sudo apt-get update
    sudo apt-get upgrade
    (do not know if is necessary)

    After this i started the tutorial from point 11:
    (also not sure if it is necessasy)

    Point 12:

    java -jar BuildTools.jar –rev 1.11
    The “–rev 1.11” is necessary, because else toy still would get a spigot-1.10.2.jar file.

    Point 13:
    The eula.txt still exists with eula=true, so nothing to do here.

    After this point you can start the minecraft server.

    Mention point 15 where you have to change the version number in.

    I did not remove any files. I did not make an new Raspbian image. Just an very ugly update, which is not ugly at all.

    Hope this is clear enough for you.

  41. Hello Daniel
    Thanks so very much for creating these tutorial!
    I followed them and everything of instalation worked well, but how can i connect to the server from android devices?
    Thanks in advanced

  42. Hi, thanks for the guide, It was very usefull to get the base server up and running on the pi
    The next challenge is to put some mods on. This proved to be more challenging than dropping them into the mods folder.
    1) get forge installer 1.7.10. Why 1.7.10? There are more mods for 1.7.10 than of the other MineCraft builds. Create a new dir called something like minecraft1.7.10 and copy it to the server via SFTP.
    2) Run: sudo java -jar forge-1.7.10- –installServer. This will download the corresponding 1.7.10 server and make a universal file
    3) Run: java -jar -Xms512M -Xmx1500M forge-1.7.10- nogui/ to start the server the first time. Change the eula.txt file described above and run again. Your base server is now setup
    4) Get a 1.7.10 mod like copious dogs and copy it into the /minecraft1.7.10/mods dir
    5) stop and start the server. monitor the startup with screen -r minecraft. You can usually see some messages about mods being loaded.

    Client: The client and the server need to be at the same levels of mods and forge. It makes it a pain to get others on the server, but the mods make it much more fun.
    1) On the client you also need the install of forge 1.7.10 with the UI choosing the client.
    2) Download the same copious dogs mod as above version 1.7.10
    3) start minecraft, create a new profile. Choose the forge 1.7.10 version and then open the game directory.
    4) Copy the mod downloaded in step 3 into mods.
    5) Start with the newly created profile and connect the server as before.
    6) Check the inventory to see if you dogs. No dogs then review the steps above.

    After you get the mods you want don’t change them willy-nilly. If you have any remote players then you will need to redistribute them again.

  43. Just wanted to say thank you for this guide. I was able to get a server rolled out for my daughter and her friends after the public server they were on had some very perverted teenagers on it harassing her.

    For those who want to update, its very easy to do by going to the spigotmc site and running the command to update usually linked on the site. Example, to update to the SpigotMC 1.11 server, run the command “sudo java -jar BuildTools.jar –rev 1.11” and then get another cup of coffee while it downloads and compiles.

  44. Many thanks for these instructions. One weirdness I encountered that may be of interest to others: For some reason the router assigned by our ISP uses .home instead of .local as the local domain suffix. This meant that “raspberrypi.local” resolved to an entirely different (and public!) ip address. Fortunately I spotted it before going any further, and was able to confirm the correct local address using ifconfig on the Pi itself, and that “raspberrypi.home” did indeed resolve to the correct address.

  45. Debian Jessie is Systemd based which give you a slightly simpler startup script (as in you can just plug in the pi and have it startup)
    Create the following file /etc/systemd/system/SpigotMC.service with the following contents:
    Description=Spigot MineCraft Server

    ExecStart=/usr/bin/screen -S minecraft -D -m /usr/bin/java -server -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui


    If you create a symbolic link from the latest Spigot to spigot.jar (i.e. ln -sfT spigot-1.10.2.jar spigot.jar), then you can change that in the service and upgrade by updating the symlink.

    Also control-a, control-d will detach from a screen session.

  46. Thank you for the clear and precise tutorial. I’ll ask this to the people who are following this blog as I’m like Daniel and just set up the server for kids and grandkids. I’ve been running 1.9.2 and all was well. After upgrading to 1.11 I can’t get the windows java client to connect. I’ve looked everywhere and I don’t see how to get a Minecraft client on windows 10 to connect to 1.11.
    Anyone out here have an answer?

    Apologies to Daniel if this is too off topic.

    1. Kick self in head:
      I had to change the profile in the Windows client to accept the latest version. I had set it to 1.9.2 a long time ago.

  47. Thanks also for the tutorial. had it working for a bit but must have changed something and make a mistake in one of the lines of code as when the raspberry pi restarts it constantly comes up with

    /home/pi/minecraft/ line 3: screen: command not found

    Is there anyway to stop it automatically running so I can fix it?

    1. … did you not do this command? “sudo apt-get install netatalk screen”? or this one? “sudo apt-get install screen”??? <— is the problem. next time dont skip a step XD

  48. Hi I am trying to get my PC connected to the server by ssh but when i type the name it says that the host does not exist. Please help!

  49. Hi Daniel, thanks for making this very comprehensive and helpful guide.

    I got the server working when I manually started it from the command line but I just can’t seem to get it working with the file. It brings me back to the shell as the instructions said it should but when I type screen -r minecraft it says “There is no screen to be resumed matching minecraft.”

    Any help would be appreciated.

  50. Hello everyone,
    I found surprisingly a way to update everything to the last version of Minecraft.
    Now it would be absolutely great if someone could point me to a way to enable / apply on this Minecraft server, Python scripts…

  51. For everyone getting Errors:
    The new Version 1.11.2. (Dec16/Jan17) seems to be broken. You will get Errors after the “java -jar BuildTools.jar” command (but first your Pi will work for hours …). There is nothing wrong with Daniels guide 🙂
    I just keep on using the old version (i tried the update on a different sd-card) and ignore the “please update your server” message. So you can either use the old version or wait for an update.

    1. Hello Gregger,
      just a quick note to let you know that the Minecraft Launcher 1.6.70 + Minecraft version 1.11.2 is working on the Raspberry Pi 3 I updated ( without understanding a thing ).

  52. Hello Daniel,

    very thorough tutorial! Thank you very much. But since I had a hard time to get the server running after each reboot I thought I share my finding here (I am running Raspbian GNU/Linux 8 (jessie)). I finally got things going with a different approach. I start the server via cron job and not via a call from rc.local.

    This done as follows:

    type “crontab -e” in the terminal and in the editor you must add the following line:

    @reboot /home/pi/minecraft/

    Be sure to have an empty line after this line if it is the last line in the script and save it. An output stating “crontab: installing new crontab” should appear. Finally you should remove the call of the script from the rc.local file.

    Do a reboot and enjoy 🙂

  53. thanks for the tutorial. the server appears to be running but minecraft will not connect to it. the error message says failed to connect to server. unknown host name. I was wondering how to fix this. Thanks

  54. Start the server again using the script: ./ It will return you to the shell. To access the console of the server type screen -r minecraft, to return to the shell type ctrl-a d. At any point, you can now disconnect from the server. The server is still running. You do not need to remain connected to the Raspberry Pi.

    this is the point where it stops working. once i put in ./ it spams me with errors.

    i also have no idea what shell or console mean in this setting.

    the server is also directly connected to my computer and shuts of once i exit out of the terminal. i would love some help if anyone could offer assistance.

  55. So I’m wondering if did something wrong. It’s taking hours to stat the mincraft server on a pi3
    [18:46:40 INFO]: Preparing spawn area: 16%
    [18:46:42 INFO]: Preparing spawn area: 16%
    It dose this every time it starts…
    Any thoughts on how long it should take or where the wheels came off?
    I have one build difference, which is it’s running on retropi build instead the main line (I will be getting another card to test a straight build).

    1. It’s taking hours to stat the mincraft server on a pi3

      I think that “hours” is a big long, but it should definitively take a long time to start the server initially. The instructions say: “Start the server (…) It will take forever (…) Go drink more coffee.”

      1. Yeah, I read that thanks…. but this was a crazy over night build time, also once up rubber banding while connected was unplayable nothing animated or moved right.

        I did fresh build today on noobs and every thing seems to be better. Build times are are seconds not hours per percent… Whole intial load took maybe 5 minutes now.
        I think something with the retropi build was messed up bad and either hogging the CPU or something with the java version.
        Anyway pretty sure starting over on a new card (as suggested in the doc) was the right way to go.

  56. sigh, errors

    Checked out: d4f98a3918e69673b2c0486b5651c5fe912b3c8d
    Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.11.2,, classMappings=bukkit-1.11.2-cl.csrg, memberMappings=bukkit-1.11.2-members.csrg, packageMappings=package.srg, minecraftHash=e576e5eb43cd176158917585200cb37d, decompileCommand=java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -asc=1 -udv=0 {0} {1}, serverUrl=
    Found good Minecraft hash (e576e5eb43cd176158917585200cb37d)
    Found good Minecraft hash (e576e5eb43cd176158917585200cb37d)
    Final mapped jar: work/mapped.22de4839.jar does not exist, creating!
    Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
    at org.objectweb.asm.tree.MethodNode.visitVarInsn(
    at org.objectweb.asm.ClassReader.readCode(
    at org.objectweb.asm.ClassReader.readMethod(
    at org.objectweb.asm.ClassReader.accept(
    at org.objectweb.asm.ClassReader.accept(
    at org.objectweb.asm.ClassReader.readCode(
    at org.objectweb.asm.ClassReader.readMethod(
    at org.objectweb.asm.ClassReader.accept(
    at org.objectweb.asm.ClassReader.accept(
    Exception in thread “main” java.lang.RuntimeException: Error running command, return status !=0: [java, -jar, BuildData/bin/SpecialSource-2.jar, map, -i, work/minecraft_server.1.11.2.jar, -m, BuildData/mappings/bukkit-1.11.2-cl.csrg, -o, work/mapped.22de4839.jar-cl]
    at org.spigotmc.builder.Builder.runProcess(
    at org.spigotmc.builder.Builder.main(

  57. Set up a Pi3 with your instructions a few months ago and everything worked beautifully. Thank you for the detailed instructions! Did a new build recently with latest version of Raspbian and Minecraft 1.11.2. The server came together fine and we have been able to play Minecraft from our local network but I had to set up everything with monitor/keyboard attached. I was never able to access via SSH. SSH was enabled and a port scan showed port 22 is open. Using Putty it seemed to contact the Pi and I got a login prompt but when I entered password is came back with “access denied”. Any suggestions on how to get SSH access to work? Using monitor/keyboard is fine but isn’t very convenient for maintaining the server. Thanks!

  58. Hey Daniel

    tried your guide last night on a raspberry3 and was delighted when i got the server up and running 😀 Great guide.

    But i did have trouble connecting to the server… but after some debugging i found that the fault was on me.
    I did´t know that the server was for minecraft desktop only :-S

    Tried to install a Minecraft PE server called pocketmine using a different guide, but still using elements of your guides (script, screen ,mem setup… )
    I did succeed to get the server up and running, But there were no mobs and i think it was low performance i terms of graphics (lagging when i run fast and loading slowly)

    Do you have any advice regarding PE servers ??

      1. Its okay 🙂

        I took the easy way out.
        Had a almost broken android (asus transformer TF701) were the screen was broken.
        plugged it in and turned down the light on the screen. Started up a minecraftPE game and shared it.
        NOT pretty but it worked for now.

  59. Thank you so much for the help with this!

    One question though: is it okay to drink tea in the steps where you said to drink coffee?

    1. One question though: is it okay to drink tea in the steps where you said to drink coffee?

      I make my coffee from green beans that I have to roast and then grind. This is necessary to make sure that I can be sufficiently patient. I don’t know what the equivalent would be with tea.

      1. yeah good point it’s pretty quick to steep some tea…

        I actually have a quick question or two:

        1. I noticed that I need to be able to SSH into my Pi for the server to become available, but as soon as I’m in I can disconnect it and it still works. Why is this?

        2. A good 70% of my ssh attempts end up with this error:
        “ssh: Could not resolve hostname raspberrypi.local: nodename nor servname provided, or not known”,
        and sometimes this error:
        “ssh: connect to host raspberrypi.local port 22: Host is down”
        Is there any specific reason behind this? I’m on University wifi (both Pi and MacBook Pro) and the connection seems solid (although I realize this would be much nicer and secure on a personal network). For example, when I’m actually on the server or in the just in my Mac terminal with the ssh, connection is steady. But as soon as I exit it and start trying to ssh again, it becomes stubborn. One thought is it may have something to do with other Pis on my university’s network or something like that. I’m not sure though- just a networking noob here.

        1. I noticed that I need to be able to SSH into my Pi for the server to become available, but as soon as I’m in I can disconnect it and it still works. Why is this?

          Minecraft does not use ssh. We use ssh just to manage the server. Without ssh, you would need to connect to the Raspberry Pi physically to manage it (which means actually use a keyboard and a screen connected to it).

          A good 70% of my ssh attempts end up with this error (…) I’m on University wifi (both Pi and MacBook Pro)

          I draw your attention to the following segment in my instructions:

          If you are going to use the Raspberry Pi, it is best to connect it directly to your router: wifi is slower, more troublesome and less scalable. I have had no end of trouble trying to run a Raspberry Pi server using wifi: I don’t know whether it is possible.

  60. Daniel,

    I came across a Raspberry Pi 3 Model B on-the-cheap at MicroCenter. Grabbed it and scoured for a good Minecraft Server guide. Yours was the best I came across.

    I currently have it up and running perfectly! No issues with the guide! Thank-you.

    Even have a free No-Ip service established. The Pi is plugged into a Kill-o-Watt…I’m curious how much power it will consume over time. So far it hangs around 1.7–>1.9 watts. Big whoop!

    Cheers 🙂

  61. Hi Daniel, thanks for these instructions. Worked like a dream and I learned lots too. Also managed to extend it to working with Mods which my boy was very pleased about. Thank you.

  62. Daniel,

    I wrote a quick cron job to do a nightly Raspbian reboot at 4AM. Seems to help free some lost RAM.

    Realized I’m not “stop”ing the server with that… So it’s not doing a proper shutdown. How could I tie your scripts together with an idea like this to ensure it’s always running, yet reboots nightly?


    1. I am not sure that rebooting periodically is generally a good idea. It is should be possible to let a Linux machine run for days, weeks, months… without problem. Certainly, I would not force a reboot as you may corrupt your data files. If you must reboot automatically, consider setting up minecraft as a service (e.g., Doing so is beyond the scope of my tutorial, however.

  63. Very precise tutorial ! Works fine with lastest version of Minecraft (1.11.2).
    I have just a problem with hostname of the raspberry : i connect it with the IP adress.
    It’s not a big problem and not linked with Minecraft (SSH connection work’s also uniquely with IP Adress).

    Thank you again for your tuto !

  64. Hey

    Just created a server using your tutorial and made it available on the internet for my friends (by openning port 25565).
    I had a question tho, is it possible to use a world we already used before? I was thinking about just copy pasting the world folder on the sd card but it looks like a bad practice.

    And thanks a lot for the tutorial.

    1. I had a question tho, is it possible to use a world we already used before? I was thinking about just copy pasting the world folder on the sd card but it looks like a bad practice.

      I think that if you shut down the server before doing what you suggest, it should work fine.

  65. Hello. Thanks for your job, its a awesome tutorial.

    What do you suggest to do for restarting the server if it crash?
    I mean, some script that runs periodically your initial script or something more fine-tuning?


    1. Thanks for your quick answer.

      Can you explain me why it would restart?

      The script checks if there is a “screen” named minecraft, and if there isn’t it launch minecraft in a new screen named minecraft and breaks the loop if it has launched ok.

      After that, the script ends, it’s not running any more. So if minecraft crashes or if the screen get deleted, it wouldn’t relaunch because the script it’s not running anymore.

      Plus, if minecraft crashes, you still have the “minecraft screen” created, so even if the script is still running (don’t know how), it wouldn’t relaunch mincraft because it would find the screen named “minecraft”

      Thanks in advance, I hope you can find few minutes to answer.

      Nice day

      1. I think you mean: what happens if the java command starts the server successfully, but later the server crashes.

        I have not put it to the test, but I think that the following should do:

        until java ... ; do
            sleep 5

        This should be called by screen, of course.

        Plus, if minecraft crashes, you still have the “minecraft screen” created, so even if the script is still running (don’t know how), it wouldn’t relaunch mincraft because it would find the screen named “minecraft”

        I don’t think it is true. If the Java command terminates somehow, the screen thread will terminate as well.

  66. Daniel,

    Just bought my daughter an raspberry, does installing minecraft on rp3 give you additional tools/experiences different from Minecraft other traditional platforms? Or is it a similar experience but it’s just cool that you created a new platform to play on?

    1. I think that I answer this question in the last paragraph of the post. It is not going to provide you with a more powerful Minecraft server, obviously. The benefits, if any, are elsewhere.

      I just did it as a fun demonstration of what could be done.

  67. Great post Daniel, works a treat. Would be great to add an edit/update at the end of the article on how to update the server to the latest build.

  68. Great article, easy and everything worked out good. I do have question on maximum capacity of the player. I see currently it is set to 20 and my son asked if it can be higher. Have you seen the limit with setting you suggested above? I am using Pi 2.

    1. You should expect higher latency and less stability as the number of simultaneous players increase. I have not tested the server with anything close to 20 simultaneous players. I have run out of children.

  69. My son just asked me to set up a Minecraft server for him to use with my 7-year-old grandson. This well-written tutorial sounds like just the thing, especially since I just set up a home file server on a Raspberry Pi and I love the platform. Thanks for these instructions and also for your patience and sense of humor. I’m just glad I’ve been using Unix/Linux since 1978!

  70. I just received the Raspberry Pi 3 that I want to set up as a Minecraft server. I followed your instructions and everything worked fine. The server (spigot-1.11.2) is running fine.

    I did have one minor hiccup: If I connect to my server, which is called “mineserver”, using PuTTY, the server is not found. If I connect to its IP address, PuTTY finds it. If I connect to mineserver.local, PuTTY finds it. OK, that’s what your instructions said. However, I use PuTTY to connect to my first Raspberry Pi (my home file server) as “raspberrypi” and PuTTY finds it, but PuTTY does not find “raspberrypi.local”. I suspect this is due to the installation of avahi-daemon (per your instructions) on the Minecraft server but not on my home file server. Further detail is given at

    Anyway, I’m ready to bring the new Minecraft server to my son’s house to try it out. It should nestle very nicely next to his router!


  71. I have followed all steps, when I type ./ I get a message saying line 1 and line 3 command not found, any clues?

    Other than that, all works a dream!

  72. Hey. I couldn’t get PuTTy to connect to my raspberry pi (running Pixel in GUI mode). So I decided to do the rest on the TV my pi was plugged into without making it headless. I typed java -jar BuildTools.jar into the command line on the Pi and it was downloading working fine. I walked out of the room and I walked in 10 minutes later and the screen was just black. It had a signal and was on, but black. Im scared to do anything because the green light on the Pi 3 is still blinking so I think it is still downloading. Im not sure. What do I do? Please help.

  73. Thanks for these great instructions! We followed every step carefully and the server now works very well on a Raspberry pi 3 with Spigot -1.11.2. As a final step we copied multiple worlds, settings-files and plug-ins etc. from our original laptop based craftbukkit server to the pi and it all seems to work perfectly well with the Spigot server. My son and his friends can now play on where they left off before the transfer to the pi. And they are very happy. Thanks again.!
    BTW: We use a 32 Gb class 10 sd card.

      1. The incremental garbage collector (-Xingcgc) may or may not be a wise choice. It has been deprecated and will no longer be supported in future Java versions. I do not think it is expected to be useful.

        The Xms flag should not harm you if all you are doing on the machine is to run the server.

        Reducing the value passed to “-Xmx” may or may not improve the stability.

  74. Used this tutorial to make Minecraft Server on Orange Pi PC. As for now seems to work well for 2~4 players with view distance of 4.

  75. Daniel,

    I’ve successfully established a server on a local network but I’m having a lot of difficulty trying to get the server to work online. I’ve been pulling my hair out trying to wrap my head around port-forwarding, dynamic DNS, and creating a static IP address for the pi. Any chance you might expand on these topics in the blog post?

    Additionally, if anyone has gotten their server to work online please let me know!


    1. I’ve been pulling my hair out trying to wrap my head around port-forwarding, dynamic DNS, and creating a static IP address for the pi. Any chance you might expand on these topics in the blog post?

      No. No chance.

      Exposing a server on your home network to the Internet involves configuring securely your router/firewall as well as securing the Raspberry Pi to prevent remote exploits.

  76. Not sure if this was addressed in an earlier comment, but do you have any tips on running the server with more RAM (or oppositely why I shouldn’t/why the default is enough). From researching on google, I believe that I would have to just edit the script and add a larger RAM value in the .jar execution, but I’m not too sure. Any help would be greatly appreciated.

    1. Not sure if this was addressed in an earlier comment, but do you have any tips on running the server with more RAM (or oppositely why I shouldn’t/why the default is enough).

      There is no Raspberry Pi with more than a gigabyte of RAM at this time.

  77. This tut is amazing everything has worked until:

    “Java -jar -Xms512M – Xmx1008M spigot-1.11.2.jar nogui”

    Returns the error

    “Unable to access jarfile Xmx1008M

    1. You typed Java -jar -Xms512M – Xmx1008M spigot-1.11.2.jar nogui according to your comment. The tutorial specifies java -jar -Xms512M -Xmx1008M spigot-1.9.2.jar nogui. These are not the same strings.

  78. Hey Daniel,
    thank you for this tutorial it helped me very much, but I need your help. Everything worked until I entered the command to start the server with screen.

    So i wrote this command:

    and then this showed up:
    -bash: ./ Permission denied

    hope you can help me, thanks in advance.

    The command pwd works, now I am hacking into the NSA’s database.

  79. Trying to update to 1.12, the kids tell me clients have stopped working but getting an error getting the new spigot. Tried a couple different ways.

    [email protected]:~/minecraft $ java -jar BuildTools.jar –rev 1.12
    Loading BuildTools version: git-BuildTools-7f7e531-60 (#60)
    [email protected]
    Exception in thread “main” org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: /home/pi/minecraft/BuildData
    at org.spigotmc.builder.Builder.main(

    Directory seems ok and Bulddata is there.

    [email protected]:~/minecraft $ ls
    apache-maven-3.2.5 commands.yml plugins walkerworld_the_end
    banned-ips.json CraftBukkit whitelist.json
    banned-players.json eula.txt Spigot work
    BuildData help.yml spigot-1.11.2.jar world
    BuildTools.jar logs spigot.yml world_nether
    BuildTools.log.txt usercache.json world_the_end
    Bukkit ops.json walkerworld
    bukkit.yml permissions.yml walkerworld_nether

    Appreciate any suggestions, hate to scorch earth. Hopping I’m just missing something simple.


    1. Looks like the part I was missing is you need rm -dRf your old Build directory. Guess I wrongly subconsciously thought it would over overwrite any old stuff.
      I removed BuildData, CraftBukkit and Bukkit. Not sure if the other two needed removal or not, but seems to fetching and building now.

  80. Hey Daniel,
    i’m loving your tutorial but i have run in to a error and can’t seem to fix it.
    when i type screen-r minecraft it says :
    There is no screen to be resumed matching minecraft.
    i have redone all of your steps 2 times now starting again from
    nano /
    i am in [email protected]:~/minecraft $
    can u please help me ?
    many thanks.

      1. Hello daniel,
        i was just typing my comment that i couldent get it working.
        But then i saw that i diden’t change 1.9 to 1.12
        many thanks for your great tutorial

      2. Hey Daniel!

        Thanks for this great tutorial. I have gotten to the same part, with the same problem.

        I have quintuple checked my file, and my jar file (spigot-1.12.2.jar) is named correctly.

        When I start the server with ./ it returns to the prompt as expected, without any errors. However, I can’t connect to the server now. Not with raspberrypi.local, not with it’s local IP address and also not with the global IP address of my router. It seems it doesn’t run.

        When I type screen -r minecraft it returns the same error as Joris is getting: There is no screen to be resumed matching minecraft.

        Could you tell me what’s going wrong? I’m really confident I did everything right.

        Thanks so much in advance,


        1. I am confident that I did everything right

          Ok, so you launched the server initially and it worked, you got the server working. Correct, right? Because this is not clear from your comment.

          Note that these instructions definitively work if you follow them.

          1. Thanks for the response!

            I found the mistake I made. I resumed setting things up right after mkdir minecraft && cd minecraft, so I didn’t realise I wasn’t in /home/pi/minecraft when executing the wget command.

            I was too quick to say I did everything right, but it was a sneaky mistake.

            I’m afraid I’m going to have to wipe my SD clean and start over. Or do you know how to uninstall the spigot package without undoing all the previous settings?

            Thank you,


  81. Daniel,

    I initially used your tutorial months ago but never put it in play. I wound up having to use it again to rebuild the idea from the ground up. Outstanding work! Thank you for taking the time to make it really easy to build the simple server.

  82. Well hello there. 😉
    After a long time experimenting with the Pi, I finally found a good tutorial for once. Everything worked really well, I didn’t even encounter one problem. Thanks for this guide!
    So, I wanted to ask if you could do/already did/can recommend a good tutorial on how to make the server avaible on the internet?
    Thanks a lot!

  83. Hi, I have a little problem.
    When I try to do
    after I did
    “sudo apt-get install netatalk screen avahi-daemon”
    it replies with
    “bash: -list: command not found”
    and I tried reinstalling it… and it did the same thing! If you have any ideas, please reply.

  84. is there a way to set this up so i can play with friends from foreign countries? also how can i configure the server (such as creative mode) can I setup commands? such as /gamemode 1 or /kill

    1. If you only want yourself or certain players to have commands, then just “op” the player.

      From the server command line: op playername[enter]

      That player will now be able to use commands. The file will let you control what level of commands they can use (game only or server control as well).

      You can also set the game mode from the file, so if you want the world in creative, that’s where you do it. The default, I believe, is survival on easy (changed mine to hard).

  85. Oh, and Daniel, thanks for the well written guide.

    I used Raspbian Stretch Lite, which works great.

    For others wanting to use Lite, you’ll need to install Git and Oracle Java. Both are in the repos, but the Java version is older, so I manually installed the latest (although I’m sure the version in the repos would’ve worked fine).

    And if you want to build Spigot for a specific version of Minecraft, add the version after the build command with –rev {version #}. For example, I’m still running 1.12.1, because Optifine is not available for the latest 1.12.2 version yet (and my computer is too slow to play without Optifine), so I built Spigot with this command.

    java -jar BuildTools.jar –rev 1.12.1

    I’m really surprised how well this works. I may just retire the old laptop I’ve been using as a server.

  86. Hey,
    great tutorial!
    But when I run the command :
    Sudo nano /etc/default/tmpfs
    It just gives me a blank file.
    I used WinSCP to check
    but there is no tmpfs file.
    I made sure I installed all packages.
    can you please help me?
    many thanks

      1. I am pretty sure I have the newest version but anyways:

        Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux

        that is the output that I get

        1. Good.

          Open the file /etc/fstab with a text editor such as nano as root (e.g., type sudo nano /etc/fstab). It should look something like this:

          proc            /proc           proc    defaults          0       0
          /dev/mmcblk0p6  /boot           vfat    defaults          0       2
          /dev/mmcblk0p7  /               ext4    defaults,noatime  0       1

          Append a new line:

          tmpfs           /tmp            tmpfs   nodev,nosuid,size=1M 0    0

          Then reboot. It should do the trick.

  87. To edit the /etc/fstab file you need to enter:
    sudo nano /etc/fstab


    sudo nano /etc/default/tmpfs
    as that will try to edit the wrong file.

  88. When I type in

    if ! screen -list | grep -q “minecraft”; then
    cd /home/pi/minecraft
    screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M spigot-1.9.jar nogui

    It says it is 5 lines. Is that OK?

  89. Daniel,
    First of all, thanks for the great tutorial, it is very easy to follow.

    Everything went well for my setup, except that I cannot connect to the server from either of my daughters’ Android tablets. They are running the full (paid) version of Minecraft and when I try to add/connect to the server, it asks for the server name, IP address and port. I used the set server name, I used the same IP address I used for Putty and used port 25565. After logging into xbox live (required by MS), the tablet does not find the local server (it does see the three partner Internet servers). You mention connecting to “raspberrypi.local”, but can you do that from the client? The only issue I see during the server load is “Java HotSpot(TM) Client VM warning: You have loaded library /tmp/ which might have disabled stack guard. The VM will try to fix the stack guard now. It’s highly recommended that you fix the library with ‘execstack -c ‘, or link it with ‘-z noexecstack'”. Aside from that one warning, the server load appears to complete and is running, but I cannot find a way to connect to it. Stopping the server also works as you outlined. Anything else I have overlooked?

      1. It says so at the beginning of the tutorial:

        We are going to setup a Minecraft server for the regular (desktop) Minecraft. There are other Minecraft versions, such as the Pocket Edition, but they require different software.

      2. Thanks for the clarification, I did not realize the tablets were actually running PE. Guess I will need to install the full version on their desktops or use additional Raspberry PIs for clients.

  90. @ Rick G,
    Minecraft PE, along with other versions based on the Bedrock Engine (like the Windows 10 version) are cross-platform compatible now, but they do require a different server.

    Technically there are 2 “Desktop” versions now. The original Java version, which is no longer true Minecraft according to Mojang and Microsoft, and the Windows 10 version, which is one of the true Minecraft versions. All version not using the Bedrock Engine are now considered to be “Editions” (like Java Edition) while all versions based on the Bedrock Engine are now Minecraft (PE, Windows 10, XBox, Ninetendo Switch).

    So “Minecraft” servers are now cross-platform compatible with all versions based on the Bedrock Engine, while the Java Edition server is only compatible with, you guessed it, Java Edition.

    Clear as mud, right?

    As far as I know, Mojang/Microsoft have not released any server software for the Bedrock Engine versions to the public, so you’d have to use a Realm or other commercial server.

    To use the server in this tutorial you’ll have to use the Java Edition of the game, and while it is possible to run that on a Raspberry Pi, it is hard to set up and does not run very well. And for clarity, I’m talking about the game software here, not the server. A Raspberry Pi3 can run a server quite well.

    Running the Java Edition Minecraft game, however, is quite another story. For that you are better off running it on a more typical PC with a powerful CPU, lots of memory and a good graphics card/GPU.

  91. I’ve been playing around with an ASUS Tinker Board for a week or so, and while the hardware is great, the “Linaro” Debian TinkerOS is a steaming pile of poo. After spending quite a lot of time trying to get it to run as well as Raspbian does on my Pi3, I decided that the Tinker Board might be better used as a Minecraft Server.

    After all, you don’t need video or graphics acceleration, or sound, or any of the other things that are barely functional or just plain broken in TinkerOS. You just need to be able to boot up, connect to a network and install Java, which you can do on TinkerOS. So I installed the latest version of Oracle Java and once again used this tutorial to get the server up and running on the Tinker Board.

    A quick initial comparison did not reveal any significant performance difference between my Pi3 server and Tinker Board server, but we did only have 2 people logged in. I imagine the difference would become apparent with more players online, since the Tinker Board is roughly twice as fast as a Pi3, with twice as much RAM (2GB) and true Gigabit Ethernet that’s not sharing bandwidth with the USB ports.

    Most of the tutorial works the same on the Tinker Board, adjusting for Raspberry Pi specific differences, like Raspbian vs TinkerOS (and the fact that TinkerOS is harder to configure).

    You will have to install Java, git, screen, and even nano (or use something else for editing). I recommend you use the webupd8team PPA for Java, since it will update Java like other packages (also install dirmngr if you are going to use the PPA tutorial).

    Building the Spigot sever is certainly faster, but it still takes quite a while. It also launches the server in about half the time. It’s been pretty stable, so far.

    Just thought I’d share this with your readers.

  92. After a year doing other stuff with my Pi, I installed Minecraft on a fresh installation with this manual. And it’s working like a charm again.
    I made a backup of my old world. Copied it to the new installation. (And started the server again.) It took awile for the game to logon, some error about old achievements, some new created instant. But the best, i am in my own world again.

    Nice to be back. And woooh there is much changed in the game. 🙂

  93. Daniel,

    First I’d like to thank you for writing such an in-depth guide on how to get this server running. I’ve been searching the web for almost a year on how to do this and this guide has gotten me the farthest so far. I had used your guide earlier this year to set one up but when more than one person would join, the additional people wouldn’t have any items in their inventory. So now that I’ve gone through pretty much everything else on the web, I’ve come back to your guide. I’ve followed this step for step, verbatim, and can not seem to get this to work. I’ve reformatted my SD card and started from scratch 5 times in the last three days. My problems lies with not being able to connect from my kids android devices. I don’t see the server available and when I try to add it in the server tab it doesn’t see it. Can I send you some logs in order to help my trouble shoot this? Thank you.

    1. My problems lies with not being able to connect from my kids android devices. I don’t see the server available and when I try to add it in the server tab it doesn’t see it. Can I send you some logs in order to help my trouble shoot this?

      I think your comment gives me enough information to troubleshoot this without further information. Let me quote the third paragraph of the guide: We are going to setup a Minecraft server for the regular (desktop) Minecraft. Android devices don’t run what I call the regular (desktop) Minecraft.

      1. Here is the end of the third paragraph:

        To be clear: if you are running Minecraft on a smartphone, a console or a tablet, it is probably not compatible with the regular Minecraft.

        I’m sorry, I don’t know how to deal with these other Minecraft editions.

  94. Thank you so much for this! I had a spare RPi3B laying around, and my daughter wanted to setup a server for her friends to play on. So, following your tutorial after installing Noobs(lite) and the Raspian (full) distro, worked a treat. Oh, you weren’t kidding about getting a coffee, that took about 40 minutes!

    We’re up to spigot1.12.2 as of January 2018, and everything is still relevant.

    Regarding the external connectivity.
    1) I have a dynamic IP address assigned by my ISP
    2) I have an Untangle home server, so I have it forwarding a random external port number to the raspberry PI’s default minecraft receiving port. Doing this on any modern modem is pretty simple check out
    3) The daughter turns the PI on, only when they want to play
    4) The daughter types in “Whats my IP” in google, then tells her friends via steamchat.

    Again, thank you for the great post.

  95. I already have my server running on a raspberry pi 3 with the last distribution of raspbian, I only had problems accessing the hostname by default, so I’m using the assigned ip.

    I opened the ports of the router and I have the server online also through generate a free dns for my domain and with the dynmap plugin I have generated a vision of the map !!.

    For those interested, they can access the server in the latest version available (1.12.2) and check for themselves how a minecraft server works in a raspberry pi 3 !!!

    Interactive Online Map:

    Excellent work, thank you very much !.

    1. The only version of Minecraft that is free is the Raspberry Pi version, which is a really stripped down version designed for educational use. It is not compatible with any other version or multiplayer, so it’s probably not what you want.

      For all other versions you’ll have to pay for it. If you buy the Java Edition (for which this tutorial is written) you will also get the Windows 10 version for free.

      Currently the Java Edition is $26.95, and that’s the one you want to play the server in this tutorial.

  96. Nice tutorial very easy to go along and recreate, now i have a Raspberry Pi 3 running a Minecraft Server YAY 🙂
    Some pitfalls to note:

    running: “java -jar BuildTools.jar” did not work for me, the Spigot install stoped with a fatal error, my solution is running the BulidTool.jar with some extra Java arguments e.g. java -jar -Xms512M -BuildTools.jar.

    Also i had some trouble withe the file, i typed chmod -x, insted of chmod +x, maybe some kind note.

    my 3rd mistake was that i did not set up the Pi for autologin, it seemt that i overred this part in the raspiconfig section. I sugesst some kind of checklist after this section so you can verify your Pi is setup correctly.

    And at last a short question is there a way to check if the /tmp in memory is working ?

  97. My 9 year old son and I walked through this guide today.

    I wanted to show him how to setup a server properly. It worked and was very helpful.

    Thank you for this wonderful guide.

  98. Dr. Lemire,
    I can open the server using “java -jar -Xms512M -Xmx1008M spigot-1.9.jar nogui”. When I give “./” I get a “no such file in directory” error. Is there any significant difference between these two commands or do they both do the same thing? If there is a difference, do you have any ideas where I am going wrong? Thanks for the brilliant guide!

  99. Thank you for these amazing instructions! I followed them and everything worked. I hit one problem but it turned out I didn’t read your instructions correctly and once I made the correction everything was fine 😉 I had wanted to make a Minecraft server on my Raspberry Pi for a while and you made it a breeze setting everything up.

  100. As I have an eight-year-old grandson who is fond of Minecraft, and a multiplying number of 3D printers with attached and mostly-idle Pi3s, I find your narrative of use.

    Also find interest in your venture into offering instructions to a larger audience. 🙂

  101. Brilliant. I had little hope when I tried this because its 2 years old and I never had good experience with 2 year old tutorials. It all worked like a charm, great stuff man. Thanks for posting this

  102. Hey, I just built a Minecraft sever and I noticed that windows has a new update. Now I can’t get into my server. Any suggestions??

    Thank you!!!

  103. I set up everything today, but when I try to connect to the server Minecraft shows me a failed message: Connection timed out: no further Information

    I can’t figure out where this is coming from…

  104. Hi there

    Thank you for this tutorial, its working good for me, except that I can not get it to starte the server on reboot.

    My question is, however: Is it possible to get the server build latest version of spigot when running “sudo java -jar BuildTools.jar”, latest version is 1.13.1, but the version installed is 1.12.2.

    Thanks in advance

    1. Same here. 🙁

      Just installed Minecraft server. BuildTools.jar runs perfect building a 1.12.2 file.
      But the Minecraft game is version 1.13.1.

      Hoping Spigot is updating their files as soon as possible.

        1. It did the trick.

          java -jar BuildTools.jar --rev 1.13.1

          Is forcing to get a new spigot-1.13.1.jar file. This one can be run to finish this hole plan. I tested it and it works. Well not stable, but it could also be possible to the running Domoticz server.

          It was also possible to restore my old november 2017 world backup. :))

  105. Hi,
    I’m a little stuck as when I run the command “java -jar BuildTools.jar” a spigot file is not being created meaning I can’t continue with the tutorial. If you have any thoughts as to why I would really appreciate it!

  106. Can someone tell me what my screen should look like while I’m waiting “forever, coffee run, lunch, etc”?

    After typing sudo java -jar BuildTools.jar --rev 1.12.2 git does its thing, minecraft is built and the server.jar is downloaded, finally my installation is sitting at

    Final mapped jar: work/mapped.cf6b1333.jar does not exist, creating!
    Picked up _JAVA_OPTIONS:

    I can’t tell if it is froze, errored out, or doing what it’s supposed to. I ctrl+C out of the install a few times, started fresh and did it again, and still the same result. I made sure there were no environment variables named _JAVA_OPTIONS for my user and using sudo. I tried different versions of minecraft and BuildTools, with the same result.

    How do I know if the installation is actually ongoing?

    1. I made the same experience and after waiting patienty, I can tell you: it’s not frozen.
      Unfortunately the process is running into some errors later.

      Tests run: 931, Failures: 0, Errors: 0, Skipped: 3
      [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ bukkit ---
      [INFO] Building jar: /home/pi/minecraft/Bukkit/target/bukkit-1.12.2-R0.1-SNAPSHOT.jar
      [INFO] --- maven-shade-plugin:3.1.0:shade (default) @ bukkit ---
      [WARNING] Error injecting:org.apache.maven.plugins.shade.mojo.ShadeMojo
      java.lang.NoClassDefFoundError: org/codehaus/plexus/util/xml/XmlStreamWriter
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(
      at java.lang.Class.getDeclaredConstructors(

      Last year the instructions from Daniel (thanks a lot!) worked quite well.
      I don’t know what happened in the meantime.
      Maybe something in Raspian was changed, impacting these BuildTools or something in the BuildTools / CraftBukkit?!

      If someone has a solution I would be pleased if it could be published here. Thank you!

  107. I did everything as said and it worked perfectly
    but what I also wanted to do a modded server on the pi to
    do you have any tutorial on that?

  108. When I ran the command, “java -jar BuildTools.jar” everything installs except that I see errors at the end of the command line dump.

    Picked up _JAVA_OPTIONS:
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at org.objectweb.asm.ByteVector.<init>(
    at org.objectweb.asm.ClassWriter.toByteArray(
    Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java, -jar, BuildData/bin/SpecialSource-2.jar, map, --only, ., --only, net/minecraft, --auto-synth, -i, work/minecraft_server.1.13.2.jar, -m, BuildData/mappings/bukkit-1.13.2-cl.csrg, -o, work/mapped.72545335.jar-cl]
    at org.spigotmc.builder.Builder.runProcess0(
    at org.spigotmc.builder.Builder.runProcess(
    at org.spigotmc.builder.Builder.main(
    at org.spigotmc.builder.Bootstrap.main(

    Then when I type ls, I see no .jar file with spigot in its name. Any recommendations?

  109. Hi Daniel,

    Thanks for your tutorial! It’s been very helpful thus far. I’m running into some issues running BuildTools.jar and I haven’t been able to find anything online regarding this issue. My Pi 3 is unable to run this command because it only detects 237MB of memory. Running vcgencmd get_mem arm returns 998MB of memory, so I’m not sure why this is occurring. Do you have any tips?

    1. Having the same problem! I build a server following this guide step-by-step so I can confirm this guide works!
      Did it on the same raspberry Pi as I’m using now… maybe something with an update on the Pi itself?

      1. Had the same problem on PI
        I tried to build on windows and got the same error.
        It was fixed by installing the 64 bit java 8, now the Buildtools works in windows.
        Will try to install Java_8_64 bit on PI and post the results

  110. Hi,

    I had the same issue, but I fixed it by running the suggested command in the error to include a specified memory allocation:

    [email protected]:~/minecraft $ java -Xmx224M -jar BuildTools.jar
    BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected 216M.
    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
    [email protected]:~/minecraft $ java -Xmx512M -jar BuildTools.jar

    Then it worked for me. Didn’t have to install a different version of Java, although I did think about it.


  111. Hey. I wanted to start up a server to play with some internet friends on Minecraft. I got to the part where I needed to start up the server and it said it couldn’t access the jar file Also. How does one make this a public server? Thanks!

  112. Does this work with minecraft sp or just minecraft legacy?
    Because I’ve done everything correctly and the server runs, but I just lose connection when I try to join it.

  113. Hi, Just an update for anyone pulling their hair out!, I have just yesterday setup a Pi craft server using many different varying methods posted on the web, I found this thread as the best commentary for the average Pi user. My setup consists of a Raspberry pi 3B+ Raspian Stretch OS latest update from 04-08-2019 (8th of April 2019). Spigot 1.13.2 server installed. I have installed the following:
    – Screen (although helpful Spigot 1.13.2 fails to load in screen I am yet to go through the documentation for Screen to work out how to set it up correctly)
    – I created a plain bash file as the following: (please note going from memory here! beware if copying below!!)
    cd /home/pi/minecraft
    java -Xms512M -Xmx992M -jar spigot-1.13.2.jar

    gave the above .sh file executable permissions (sudo chmod +x)
    created a line before the exit line at the bottom in /etc/rc.local to execute the server at reboot as ./[insertabovefilenamehere].sh.
    (Please note if you are setting this up and want to /OP yourself, you need to have access to the console. In this case prior to rebooting the Pi after you have setup the above start the server by going to the /home/pi/minecraft directory (or wherever you put it) and start the .sh file that you have just created. This will give you access to the console (I cannot get console to work if the server boots on reboot!) I’m sure that Screen may help with this but I have not managed to get it to run in screen mode yet.
    Please note I have changed the above comment in the .sh file from -Xmx1008M to Xmx992M this allows the Pi some memory (16M) for overhead as suggested by many other forum users. Spigot runs freely and I have also had up to two players with no issues view distance is good at 10 with 2 players however I will try and load it up soon and see how it goes.

  114. thank you so much this tutorial was great. easy, simple amd straight forward.

    i do however have a couple questions. the spigot file 1.9 that you used. that means your server runs minecratf 1.9 right?

    mine is labled 1.13.2 and my server opened in 1.13.2 but i was hopping for a 1.14.2 server. is their a easy wa to update the server to a newer version of minecraft?

  115. Hey! thanks for this tutorial but when I try to run java -jar BuildTools.jar it says that command java is not found. Any idea how to fix this?

    1. Quoting from the instructions (first step):

      You need to put the latest version of the Linux distribution for the Raspberry Pi, Raspbian, on the SD card. My instructions assume that you get the full version. For some reason, many people prefer the “lite” version, but then they can’t follow my instructions. Please use the full version (the lite and the full versions are both free).

  116. This works fine on a Pi 4 with 4GB RAM as well.

    I set up a server for my kid for Minecraft 1.12.2 on a Raspberry Pi 2. When I tried to make a new SD-card for the latest stable Spigot server (1.13.2) it complained about too little memory. But the Raspberry Pi 4 just came out, so I got one of those. I skipped the step which assigns the minimum amount of memory to the GPU, because I guessed that there will be enough CPU RAM anyway. Now it works.

  117. Thanks for this tutorial. When I try to connect to the server from another laptop for the first time it gives me the “failed to connect to the server” io.netty.abstractchannel$annotatedconnectexpectation”. I tried direct connect to the IP address that came up when I input screen -list and also tried the Add Server. Both returned this error. Laptop is connected via wi-fi and tried it with the Pi on ethernet and wi-fi on seperate occassions. How do I know if the Pi server is running? Your tutorial said to connect to raspberrypi.local…. do I type that in as the IP address? Where do I input that?

    1. When I disconnect from ethernet and switch to wi-fi, did I stop the server? Do I need to restart it somehow?

        1. Disregard! I must have stopped the server when I switched the pi to wifi. It’s working now, but I did not connect to “raspberrypi.local”, instead I added the server by IP address

  118. My server is running 1.13.2, and almost every time I try to connect I get a connection timed out message. After I try to connect a few times the server crashes, and for a few seconds before the screen terminates, there is a bit that says it failed because it could not find a file with the name “./start”.
    The pi only has access to 2.1 or so amps, I don’t know if that is relevant.

  119. I am setting up a sever on a Pi 4 with 4GB ram and i was wandering if -Xms and -Xmx was the ammount of ram dedicated to the server. If so can i just change it to -Xmx3800M or do i have to do it another way?


      1. Thanks, could you prehaps give me a margin not to exede when it comes to dedicating memory. Furthermore I will only be running the server on the pi so does it still matter if it hogges all the memory.

        1. If the system runs out of memory and you have partitioned enough disk space, it will go to disk which could seriously hurt the performance. Failing that, the system may fail… Thankfully the Linux kernel and other services should be able to run well with a few hundred megabytes. I would expect that keeping 500 MB for the non-minecraft systems should be more than enough.

          1. Um when i start the server with “java -jar -Xms512M -Xmx2800M spigot-1.14.4.jar nogui”
            i get this error
            “java.lang.OutOfMemoryError: Metaspace
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
            at java.lang.ClassLoader.defineClass( ~[?:?]
            at ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.defineClass( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.loadClass( ~[?:?]
            at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[?:?]
            at java.lang.ClassLoader.loadClass( ~[?:?]
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
            at java.lang.ClassLoader.defineClass( ~[?:?]
            at ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.defineClass( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.loadClass( ~[?:?]
            at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[?:?]
            at java.lang.ClassLoader.loadClass( ~[?:?]
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
            at java.lang.ClassLoader.defineClass( ~[?:?]
            at ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.defineClass( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull( ~[?:?]
            at jdk.internal.loader.BuiltinClassLoader.loadClass( ~[?:?]
            at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[?:?]
            at java.lang.ClassLoader.loadClass( ~[?:?]
            at net.minecraft.server.v1_14_R1.RegionFileCache.( ~[spigot-1.14.4.jar:git-Spigot-065a373-763e560]
            at net.minecraft.server.v1_14_R1.IChunkLoader.( ~[spigot-1.14.4.jar:git-Spigot-065a373-763e560]
            at net.minecraft.server.v1_14_R1.PlayerChunkMap.( ~[spigot-1.14.4.jar:git-Spigot-065a373-763e560]
            at net.minecraft.server.v1_14_R1.ChunkProviderServer.( ~[spigot-1.14.4.jar:git-Spigot-065a373-763e560]
            at net.minecraft.server.v1_14_R1.WorldServer.lambda$0( ~[spigot-1.14.4.jar:git-Spigot-065a373-763e560]”

            im using a pi 4 4gb

            1. Are you sure that you have access to the 4GB? The OS is 64-bit or 32-bit? Getting Java to use all of the available memory requires support at the kernel level. Typically, 32-bit systems do not give access to a single process to more than 2GB or 3GB.


              uname -m

              If you have a 64-bit system, you should see aarch64 or the equivalent. If you don’t then you probably can’t use 4GB.

  120. Hello.
    I have been following your tutorial, and everything was installed and started running, on a Raspberry 3b+ with RaspbianBuster (actual version) and Minecraft 1.14.4 (and the same version of the Spigot), almost without problems exept when trying to run java -jar BuidTools.jar where I get the following error:
    BuildTools requires at least 512M of memory to run (1024M recommended), but has only detected 224M. This can often occur if you ar running a 32-bit system, or one with low RAM. Please re-run BuildTools with manually specified memory, e.g: java -Xmx1024M -jar BuidTools.jar“.
    After running it as java -Xmx1000M -jar BuidTools.jar, the rest goes very smoth, exacty as in the tutorial is described (of course, using always the version 1.14.4 instead of the 1.9).
    The real problem comes when I start running the server and playing, as it kicks me out with a “waiting timeout” message (sometimes after 5min or less, sometimes after 20-30min), and it goes offline, not only the MinecraftServer, but also the Raspberry (cannot even log in with VNC), and it does not work at all until it gets manually restarted… but when I come again into the server to play, everything I had in the inventary is lost!! 🙁
    Obviously, after a couple times having to restart manually the server and losing everything (and the time it needs to restart everything), it gets veeeery anoying 🙁
    We are only two persons playing, and the RasPi (as well as both computers) is connected to the router with cable instead of WiFi, as it goes faster.
    Do you have an idea how can this can be solved?? And/or why is it happening??
    Thanks a lot and greetings.

  121. Hey, I was trying to set the server up as a Raspberry Pi 4, with a Minecraft PE. I was unable to connect to the server using the configure server setting from within the PE. Also when I tried one of the Pocket Edition (Pokkit-Master) it wasn’t supported by the type of Raspberry Pi OS. I need some help. Thanks!

  122. Hi Daniel,

    I’m considering buying the Raspberry Pi, either 3 or 4 to host a server as you’ve said. I’m pretty experienced with linux terminal so I may play around with stuff a bit, but I had a question before I start. You mentioned saving tmp files directly to memory instead of writing the files. Does this mean if the Pi loses power (simple power outage or anything) that the world would be lost? Also, I understand this is a low power system, but is there a simple setting change that would allow the server to be turned off when not in use? I’ll likely only use it occasionally, so no need to have it running the other 99% of the time.

    Thanks so much for the guide!

      1. What is it that really prevents world persistence with this system? I’ve never messed around with any kind of minecraft server so I don’t really know how they work under the hood, but I understand typically a server can be restarted and everything remains through the restart. If I have to really dig into that part on my own I can, but what really sets a Pi on an SD card apart from any other desktop on an HDD or SSD?

        1. I explain in my post why I recommend not writing the temporary files to the SD card:

          Spigot makes use of temporary files (located in tmp). This can cause performance issues and instabilities on a Raspberry Pi. It may even shorten the life of your SD card. It might be better to have temporary files reside in memory.

          I understand typically a server can be restarted and everything remains through the restart.

          If properly shut down and properly restarted, yes. If your server crashes, then no. Hence the word “instabilities” in my post.

          Some software is robust to system-wide crashes. Certainly, the software running your bank is probably robust to crashes. A Minecraft server is not engineered with this kind of care.

          (…) what really sets an (…) SD card apart from an (…) HDD or SSD?

          A Raspberry Pi with an SD card is not a reliable system. It will crash. In my experience, you can improve the reliability by sparing the SD card.

          1. What do you mean by “sparing the SD card”? Is the unreliability of the Pi-SD system just the card? If so, is it possible to run the Pi on a small HDD to essentially make it a tiny desktop? Just trying to understand a bit of how the system works.
            As a follow up to the minecraft question, assuming the system works barring crashes, would it be possible to implement save states such that it can be recovered at least to a certain point after a crash?

            1. What do you mean by “sparing the SD card”? Is the unreliability of the Pi-SD system just the card? If so, is it possible to run the Pi on a small HDD to essentially make it a tiny desktop? Just trying to understand a bit of how the system works.

              I expect that the SD card is probably one of the core weaknesses of the system, reliability-wise. However, I have no experience running a Raspberry PI with anything but an SD card so it is hard to know for sure. I have a ROCKPro64 that has its own eMM module and it has a nearly perfect uptime. Much better than a Raspberry Pi. I expect that the SD card is the main difference.

              If you want a more reliable machine, I would probably go with the ROCKPro64. I have a post about how to set one up.

              This being said, if you really care about reliability, then you probably want a genuine server and not a single-card computer.

              it be possible to implement save states

              You will have to investigate this issue with the Spigot documentation. You can request a save or a shut down, but I am unaware of a standard way to generate a safe backup.

  123. Thank you so much for this simple but powerfull guide.

    I managed to launch a Minecraft server 1.4 into my mobile phone (a chinesse one i do have for such task, called F9006) using LinuxDeploy for easy chroot, installing Debian on it.

    Sadly … Running 63687ms or 1273 ticks behind.

    I’ve ensured that all cores where ON forcibly using Kernel Auditor, but seems that is not enough or the ram is not sufficient.

    Can’t connect to the server because i don’t have such game, but seems that 1273 ticks behing is not a good value.

    About sdcard, yes, it’s the weakest point of the RPi system. Even with a suddently power loss it could break. I suggest anyone using RPI seriously to attach a big ass 5V capacitor to their usb power wires …

    Usually, people tend to use noatime on fstab, which tends to more chances to crash if you get a power supply interruption.

    And, using the sdcard only for boot is also totally advised. It’s cheap to use an reuse USB memories wich have better NAND controller.

  124. Hey, I followed everything to the T and it works -almost. it detaches itself to a screen but after it finishes loading on the screen, the screen terminates itself for what feels like no reason, and it definitely has me wondering whats wrong.

  125. Hello,

    the server works, but when I tried to connect to it, it display “Failed to verify username!”. Can someone help me?

    I use a cracked launcher of Minecraft

  126. the reason people prefer the lite version is because it is headless out of the box. you aren’t doing anything that requires a GUI, so the full version is just bloat.

    1. the reason people prefer the lite version is because it is headless out of the box. you aren’t doing anything that requires a GUI, so the full version is just bloat.

      A good fraction of people who can’t make this work are trying to use the lite version and encountering quite bit of difficulties.

      The lite version can be made to work, but it is requires more time and expertise.

  127. Thank you very much for this detailed instructions! but I must have goofed up somewhere and I can’t find to retrace the steps to fix it. I installed the “Download the build file for Spigot” and it downloaded in seconds, but once I tried “java. -jar BuildTools.jar” it couldn’t complete the command
    [email protected]:~/minecraft $ java -jar BuildTools.jar
    -bash: java: command not found”

          1. I’m getting errors:
            Error occurred during initialization of VM
            Server VM is only supported on ARMv7+ VFP
            E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
            Errors were encountered while processing:
            E: Sub-process /usr/bin/dpkg returned an error code (1)

  128. I restarted the entire process, wiped the SD card and reloaded imager,
    here is my error at the first step
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Leave a Reply to John Cancel reply

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

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see