Setting up a “robust” Minecraft server 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 regular (desktop) Minecraft. There are other Minecraft versions, such as the Pocket Edition, but they require different software.

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.

Prerequisites

  • 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 either a Raspberry Pi 2 or a Raspberry Pi 3. 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, so it is recommended first.
    • You need a power cord to go with it.
    • 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.
    • 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.
    • An HDMI cable, an HDMI-compatible monitor or TV, a USB keyboard and a USB mouse are also be required at first.

Instructions

  • You need to put the latest version of the Linux distribution for 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 they also seem to encounter more problems. Please use the full version (the lite and the full versions are both free). 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 files takes 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. 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. Plug the monitor, the keyboard, and the mouse. Plug the power in and it should start. If, like it happened to me, the card won’t stay plugged in, just use a rubber band.
  • 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, 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:127.0.0.1” and another with a string that looks like “addr:192.168.1.87”. In that case, 192.168.1.87 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:

    wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
    

    (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. This 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 minecraft.sh 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 
    fi
    

    It is really important to type the script (or copy and paste it) accurately. You can also grab the minecraft.sh 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 minecraft.sh file. As a sanity test, type wc -l minecraft.sh. The shell should return 4 minecraft.sh indicating that the script has 4 lines, if you do not see the number 4, do not continue! We also want to check the syntax of the script, so type bash -n minecraft.sh: 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 minecraft.sh.

    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 server.properties 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/minecraft.sh right before the exit command.
  • Start the server again using the script: ./minecraft.sh while in the bash shell. It 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 might be better to have temporary files reside in memory. To alleviate the problem, open the file /etc/default/tmpfs with a text editor such as nano (e.g., type sudo nano /etc/default/tmpfs) and insert a line with the following text “RAMTMP=yes“, while making sure that there is no other line with the string RAMTMP=. 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 reboot command). If you have done everything right, the server should automatically start following a reboot sequence.
  • 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 minecraft.sh). 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 http://thedomain.com/theplugin.jar. 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.

Next, you can make the server available on the Internet using a service like dyn.com, 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.

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

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.

186 thoughts on “Setting up a “robust” Minecraft server 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)
    done
    fi
    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?

    Regards

  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/minecraft.sh: 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.

    ./minecraft.sh: 4: ./minecraft.sh: 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

        Cheers

        Sean

      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?

        Cheers

        Sean

        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.

  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 minecraft.net.
      Put it in the same directory as your previous server file.
      Update the minecraft.sh 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.

  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.

    Zbysek

  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.

    Julio

  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,

    Julio

  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.
    #TMPFS_SIZE=20%VM
    #RUN_SIZE=10%
    #LOCK_SIZE=5242880 # 5MiB
    #SHM_SIZE=
    #TMP_SIZE=

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

  19. I Keep getting a Connection lost error, It reads : Internal Exception: Java.io.IOEexception: 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 minecraft.sh file by doing:
    “sudo screen -S minecraft -d -m java -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui && break”
    or
    “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!
    Max

    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
    done
    fi

    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. Hi Daniel,

        Well – the Minecraft server don´t start with the startup script.

        [email protected]:~$ ./minecraft.sh

        No errors, it just don´t start

        The monecraft.sh file has permission 755

        / Dennis

      2. Hi Daniel,

        Well – the Minecraft server don´t start with the startup script.

        [email protected]:~$ ./minecraft.sh

        No errors, it just don´t start

        The minecraft.sh file has permission 755

        1. the Minecraft server don’t start with the startup script

          Do this and report the result:

          [email protected]:~$ ./minecraft.sh
          [email protected]:~$ screen -r minecraft
          
          1. same issue, however; when i run the ‘./minecraft.sh’ 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
            done
            fi

              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 minecraft.sh 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 minecraft.sh” 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:
      ./minecraft.sh
      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.
      Nelson

  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 minecraft.sh

    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 ./minecraft.sh> 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: https://portforward.com/softwareguides/minecraft/portforward-minecraft.htm (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.
    Thanks

  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?
    /Anders

      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: https://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-1-11-released.193887/ (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:
    /home/pi/minecraft

    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.

    Enjoy!

  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:
    wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
    (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-10.13.4.1558-1.7.10-installer.jar –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-10.13.4.1558-1.7.10-universal.jar 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:
    [Unit]
    Description=Spigot MineCraft Server

    [Service]
    User=minecraft
    Group=minecraft
    ExecStart=/usr/bin/screen -S minecraft -D -m /usr/bin/java -server -jar -Xms512M -Xmx1008M spigot-1.10.2.jar nogui
    WorkingDirectory=/home/pi
    Restart=on-failure
    RestartSec=5s

    [Install]
    WantedBy=multi-user.target

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

    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/minecraft.sh: 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 minecraft.sh 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/minecraft.sh

    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 minecraft.sh 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: ./minecraft.sh. 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 ./minecraft.sh 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
    endless
    [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).
    Thanks

    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, accessTransforms=bukkit-1.11.2.at, 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=https://launcher.mojang.com/mc/game/1.11.2/server/f00c294a1576e03fddcac777c3cf4c7d404c4ba4/server.jar)
    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(MethodNode.java:433)
    at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1343)
    at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
    at net.md_5.ss.repo.JarRepo.getClass0(JarRepo.java:38)
    at net.md_5.ss.repo.ClassRepo.getClass(ClassRepo.java:22)
    at net.md_5.ss.repo.AggregateRepo.getClass0(AggregateRepo.java:30)
    at net.md_5.ss.repo.ClassRepo.getClass(ClassRepo.java:22)
    at net.md_5.ss.remapper.EnhancedRemapper.findMethodDeclarer(EnhancedRemapper.java:67)
    at net.md_5.ss.remapper.EnhancedRemapper.mapMethodName(EnhancedRemapper.java:33)
    at net.md_5.ss.remapper.MethodRemapper.visitMethodInsn(MethodRemapper.java:120)
    at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1429)
    at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
    at net.md_5.ss.model.ClassInfo.remap(ClassInfo.java:120)
    at net.md_5.ss.SpecialSource.map(SpecialSource.java:96)
    at net.md_5.ss.SpecialSource.main(SpecialSource.java:44)
    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(Builder.java:561)
    at org.spigotmc.builder.Builder.main(Builder.java:319)

  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?

    Thank-you!

    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., https://github.com/Ahtenus/minecraft-init). 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?

    thanks

  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 https://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/.

    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!

    Thanks.

  71. I have followed all steps, when I type ./minecraft.sh 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.

  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.

Leave a Reply

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