How to Make a Raspberry Pi Minecraft Server

With a little effort, you can play this popular title with friends at home

It’s not tricky to create a Minecraft server on a Raspberry Pi. Still, it requires careful entry of text-based commands. While it doesn't have the power of a home server or a Minecraft Realm, a Raspberry Pi Minecraft server allows several people to play the popular game from their devices.

These instructions set up a server for the Java version of Minecraft. The procedure is different for the mobile version of the game, also known as the Pocket Edition.

Needed Raspberry Pi Hardware

You'll need a Raspberry Pi kit that includes the motherboard, a case, a keyboard, and a mouse. You'll also need an HDMI-enabled monitor to connect to the Raspberry Pi. The cost of these varies. If you want to save money, use any wired mouse or keyboard that you have.

This guide was tested on a Raspberry Pi 4 starter kit from CanaKit. The option with the mouse and keyboard was $99 and included 4 GB of RAM. You can get an earlier version (Raspberry Pi 2 or 3) for less money. If you have less experience with the Pi system and computers in general, choose a kit with all the parts you need.

Minecraft Server Software Essentials

Once you get your Pi, make sure it has an operating system on the Micro SDHC card. The CanaKit Pi comes with the NOOBS OS (a beginner-friendly version of Raspbian, the Debian Linux-based operating system that powers the Pi) installed. If that's not the case for you, follow the instructions provided with your kit (or on the Raspberry Pi website) to download it from the internet.

If you want to access your Minecraft server, you'll need a paid copy of Minecraft for your Mac or PC, and a user name and login for the game. The server provides the world you'll play in, but you'll need a client on your computer to play the game.

You can do the installations below with an SSH connection to the Pi. However, it might be easier to use NOOBS, the graphical user interface (GUI) version of the Raspberry Pi OS, to perform the following steps. It's one less layer of tech to troubleshoot and is easier for beginners.

Set up Your Raspberry Pi

First, you'll enter some commands to get the Pi ready to go.

  1. Connect the Pi to your home internet with Wi-Fi or Ethernet.

  2. Open a Terminal window and type the following commands (press Enter after each command) to make sure the software is up to date. 

    sudo apt-get update
    sudo apt-get upgrade

    Depending on the installation, the second command may take a few minutes. Wait until the lines stop scrolling and the Rasbian prompt appears.

  3. Enter the following to get into the Raspberry Pi configuration settings:

    sudo raspi-config
  4. Select Advanced Options, then choose Memory Split.

  5. If the Memory Split is 16 or higher, leave it as is. If the Memory Split is less than 16, change it to 16 and then save the changes.

  6. Enter the following command to determine your local IP address:

    sudo hostname -I

    Keep track of the number. It allows your users to connect to the Raspberry Pi Minecraft server after you install and configure it.

  7. Enter the following command to install Java:

    sudo apt install default-jdk

If you encounter any errors, do a web search for the exact wording of the error to find a solution.

Install Minecraft Server

Next, you'll download and install the Minecraft server software.

  1. Type the following commands into Terminal, press Enter after each line.

    Commands like this are specific. If any single bit of punctuation or spelling is omitted, the commands won't work. Consider copying and pasting these commands.

    First command:

    sudo mkdir /home/minecraft

    Second command:

    cd /home/minecraft

    Third command:

    sudo wget
  2. Enter the following, then make sure you see a file that looks like BuildTools.jar:

  3. Run the app you downloaded (BuildTools.jar). Type the following into Terminal on the Raspberry Pi. This creates a Minecraft server on the Raspberry Pi. 

    sudo java -Xmx512M -jar BuildTools.jar

    The -Xmx flag sets the memory used for the command. This example uses 512 MB, which is a safe place to start. If your Pi has more RAM, use 1024 MB or 2048 MB.

  4. When it finishes installing, a message appears indicating that the compilation is done.

How to Launch Your Minecraft Server

You're almost ready to launch and run your Minecraft server. From Terminal, make sure you're in the /home/minecraft/ directory, then enter the following command:

sudo java -Xms512M -Xmx1024M -jar /home/minecraft/spigot-1.16.2.jar nogui

If you have a Pi 4 with 4 MB of RAM, you can increase the second term to give the server more room to run in. If you want to try this, use -Xmx2048M as the maximum memory term.

Your version number for Spigot may be different. Use the ls command to check.

The Minecraft server will launch, then fail, because it checks the End User License Agreement (EULA) to see if you've agreed. Since you haven't, it stops. To get around this, open the text document and change the wording.

  1. To open the EULA document, type or paste the following command into Terminal.

    sudo nano eula.txt
  2. Change the word false in the text file to true. Write Out (Control+O) to the same file name. Then, press Control+X to exit.

  3. Run the launch command, and your Minecraft server should launch successfully. Depending on the amount of RAM on your Pi, it takes from a few minutes to many minutes to complete. The second time you launch the server, it will open faster, as it did much of the needed work the first time.

  4. To stop your Minecraft server, enter stop at the cursor while the server is running.

Connect to Your Raspberry Pi Minecraft Server

Now that your server is up and running, all you need to do is connect to it.

  1. Open Minecraft on your Mac or PC and log in with your Minecraft credentials.

  2. Press Play and Minecraft launches on your computer.

    Minecraft on Ubuntu
  3. Choose Multiplayer.

    The Multiplayer button in Minecraft
  4. If you want to enter the server details each time you connect, select Direct Connection. If you want to save the details, select Add Server.

    The Direct Connection and Add Server buttons
  5. Give your Pi server a name, then enter the IP you found in the Hostname step above. Select Done.

  6. Select the server you created, then choose Join Server.

    Minecraft direct connection
  7. Your Minecraft server is running on a Raspberry Pi. Give your friends and family the IP address (as long as they're in your network) so that they can play Minecraft with you.

Was this page helpful?