Advertisements

MineCraftPi – A Raspberry Pi MineCraft Server Image!

So, You want to run a MineCraft server on your Raspberry Pi? Well then you’re in the right place! I’ve compiled a pre-configured image to run on the Raspberry Pi and taken the first steps to optimize your MineCraft server to run on the Raspberry PI. All you got to do? Follow the install directions below to burn the image to a high speed SD card and off you go. Not quite convinced? You can check out this brief youtube video to see what kind of performance to expect from our humble Pi MineCraft server. Further more, I’ve detailed my entire build process if you would like to build your own server from scratch. ~Enjoy.

 

Download MineCraftPi:

Raspberry Pi Model B+/v2: You can download MineCraftPi v3.0: HERE

Raspberry Pi Model B:  You can download MineCraftPi v2.2: HERE

Installing MineCraftPi:

  1. Download Win32DiskImager
  2. Write image to SD Card. (4gb+)
  3. Connect a keyboard & Monitor to your Pi Before booting
  4. MineCraftPi will automatically start your MineCraft Server on boot-up. After a few minutes you should be able to login by entering your Raspberry Pi’s Ip address in the MultiPlayer Section of your MineCraft client.
  5. After a brief test, you will want to proceed to the next section to finish setting things up.

Running MineCraftPi For The First Time:

  • Upon First Boot – The new version of MineCraftPi will do the following:
    • Run BuildTools.jar to compile craftbukkit & spigot
    • Run the ‘mcpi_run_once.sh’ script and add the start.sh script to start on boot
    • Reboot and update your server
  • This will take some time! When it is complete you should get the following notification:
  • Login to your Pi. ( pi : raspberry )
  • Accept the minecraft EULA
    *Ctrl+X & (Yes) to save and exit.
  • Then start your server again (manually to save some time)
  • In the MineCraft console window – Make yourself admin:
  • Next we need to exit our MineCraft Server by Typing “stop”.
  • Login to your Pi. ( pi : raspberry )
  • Run “sudo raspi-config” to expand the file system & Reboot.

 

About The Image:

  • SSH = pi/raspberry
  • Overclocked to “Medium” Setting
  • Java-SDK = v.1.8.0
  • Spigot = v.1.8.x
  • Running No Plugins
  • Supported Models: A, B, B+, B2

 

Quick Tips To Improve Your Performance!

Unlike other builds we’ve shared where you can layer multiple projects over one another (e.g. the Pi is more than powerful enough to serve as a weather/email indicator and a Google Cloud Print server at the same time), running a Minecraft server is a pretty intense operation for the little Pi and we’d strongly recommend dedicating the entire Pi to the process. Minecraft seemslike a simple game, with all its blocky-ness and what not, but it’s actually a pretty complex game beneath the simple skin and required a lot of processing power.

Courtesy of HowToGeek.com

Here are a few other quick notes to improve MineCraftPi performance.

  • Remove any & all additional accessories that are plugged in to your Pi. Things Like BlueTooth Dongles and USB Hard drives may strain our Pi for valuable energy while overclocking.
  • A Faster SD Card. ( Check supported models first @ http://elinux.org/RPi_SD_cards)
  • Can use the World-Edit plugin to limit the size of your map.

 

Below are my cliff notes detailing the image build process.

[learn_more caption=”Getting Ready…”]

1.) Burn the latest image of Raspbian Wheezy to your SD card.

2.) Expand your File-system and customize.

 

3.) Let’s get up to date.

 

[/learn_more][learn_more caption=”Installing Java & Our MineCraft Server”]

Install Java v8:

 

Check That Java Installed Ok…

**For More Details about Java on The Raspberry Pi, Please visit: http://elinux.org/RPi_Java 

 

Install MineCraft Server (spigot)

 

Test New Server & Launch for the first time….

When it has completely loaded, you can type “stop” to exit back to command-line.

 

Create Our MineCraft Startup Script

If that was successful, we’ll want to proceed with creating our start-up script. It is important to note the name of our script is set to “start.sh” for a very good reason. In the next section I briefly cover our server configuration files, one of those configuration files looks for a “start.sh” file by default in order to reboot the server in the event of a crash. So word of advice – Don’t change the name of the script unless you know what you’re doing!

 

Still in the MineCraft folder:

Then just copy and paste our run command for Spigot from before:

Save & Exit.

 

Next we make it executable…

And finally, We test our new script.

 

Credits:

I used a combination of the following 2 websites to get this going. ( Thanks Guys!)

 

 

[/learn_more][learn_more caption=”Configure Our Server Settings….”]

General Settings:

If you wish to craft your own configure file from scratch, You can find a list of all the available options @ http://minecraft.gamepedia.com/Server.properties.

Below is my config file for reference.

 

Spigot Server Settings:

You can find a great primer on configuring spigot @
http://www.spigotmc.org/wiki/spigot-configuration-spigot-yml/?redirect=spigot-configuration

 

Below is my File:

To Summarize, I only changed the following settings from default:

 

[/learn_more][learn_more caption=”Plugins”]

 

 

Install Java v7 (alternative)

Check Java Version / Verify Install
 

Create Our Plugins Folder:

First we need to create and move to the plugins folder.

 

Plugins Included in the Image:

No Spawn Chunks:

To list all the Plugins currently active on your server simply type “plugins” in the command line after your server starts:
MineCraftPi_Active_Plugins


 

 

Not Included in the Image:

These are plugins that looked interesting to me but have yet to test out on the Raspberry Pi Server… If I’m missing any of the major ones – please let me know!

 

Mine Backup:

Dynmap:

WorldBorder:

WorldEdit:

WorldGaurd: (worldedit must be installed first)

 

[/learn_more][learn_more caption=”Install Directions v1.8″]

**This section is a work in progress – preparing for the new 1.8 version!

Follow the “Getting Ready” Step from above as usual.

 

Install Java & Git

Then Verify…
**Note: Java & Git already installed in latest Raspbian base image^ 

 

Create MineCraft & Plugins Folder

 

Download BuildTools

 

Create “start.sh” script

Create the script.

Then add the following to the start.sh script:

Ctrl+X & Yes to save and exit.

Then make the script executable:

 

Create “mcpi_run_once” script (To build spigot.jar)

Create the script:

Add the following to the “run once” script:

Then make it executable:

Add the Script to init.d to autostart on boot-up.

Test the script:

 

Create run once script…

This is a bit of an extra step – Since I didn’t want to just pull the power and package the image. Currently I can’t force update-rc.d programs to only start on boot…. So this script is a temporary fix.

Add the following:

Then make it executable And add it to update-rc.d:

 

 

Test New Server & Launch for the first time….

 

Remove Auto Update From Boot

If you truly wish to remove it you can do the following manually…

**Note: If you do remove this – It is recommended that you run this manually once per week to keep the server up to date!

[/learn_more]

 

Additional Configuration

 

Backing Up Your MineCraft Server

There are a few different ways to back-up your MineCraft server, depending on what you are trying to accomplish…

 

1.) On Demand backups with win32diskimager.

This method simply involves powering down your Raspberry Pi and plugging your SD card into a reader on your PC. Then when you run win32diskimager, simply hit the “read” button to create a copy (aka backup) of your image. 

 

2.) Create a Backup Job with Cron to run scheduled Backups while your Pi is running!

3.) Use the MineCraft Backup Plugin.

 

Set Static IP Address(wired)

1.) SSH into your Pi.

2.) Then we want to edit the network interfaces:

 

3.) You’ll see some settings that look like this:

Replace the line: iface eth0 inet dhcp
with: iface eth0 inet static

4.) Then specify the address, netmask, network, broadcast and gateway, like this:

iface eth0 inet static
address 10.0.1.64
netmask 255.255.255.0
network 10.0.1.0
broadcast 10.0.1.255
gateway 10.0.1.1

**If you are unsure what the above settings should be, You can run the following from another machine on your network.

 

5.) Finally, Reboot and make sure that you can ping the new static IP address. Then make sure your Pi can reach the inter-webs!

Make Your Server Available on the Internet

So what good is having your own MineCraft server if you can’t share it with your friends – right?

1.) If you haven’t already done so, You will want to make sure that your server has a fixed IP address.

2.) After you’ve set your static IP address, you will need to setup port forwarding on your router so anyone outside your network can access your server. Since this process varies based on your individual router model, your best bet is to look up a port forwarding guide on portforward.com.

3.) Essentially what you are looking to do is login to your router and setup port forwarding to your MineCraft servers IP address like so:

MineCraftPi_PortForwarding_example

Make sure that:

  • Internal & External ports are set to “25565
  • Protocol = TCP
  • IP address = Your MineCraftPi IP address!

 

The easiest way to tell if your MineCraft Server is accessible to the outside world is to have a friend connect. Grab your external IP address by following the directions below and have your friend try to connect.

  • Go to WhatsMyIp And grab your external IP address.
  • Open up MineCraft > Go to MultiPlayer > Add Server
  • Try to connect to: <your external IP address>:25565
    Example: 
    173.89.44.120:25565

If you don’t have any friends online to test with and are a bit impatient like myself, You can  use this website to verify your port forwarding setup. If port forwarding is setup correctly and your MineCraft Server is started, others should be able to connect!

 

To Have Your MineCraft Server Auto-Start on Boot

If you wish to have your MineCraft Server autostart on boot simply run the following command:

And un-comment the following line:

 

Note:
If there is an update available for spigot, auto-booting will pause and wait for a user prompt to acknowledge the update warning regarding backing up you server before proceeding with the update. You will need to have a monitor and keyboard connected to your pi to proceed!

Source:  raspberry-projects.com

 

Image Change Log

MineCraftPi – v1.0

  • Installed JavaSDK & Spigot MineCraft Server
  • Optimized server settings for use on Raspberry Pi
  • Added NoSpawnChunks plugin
  • Created run script to improve uptime. (Run script will kick off if server crashes)
  • Added Optional ability to auto-start MineCraft on Boot.

MineCraftPi – v2.3

  • Re-built image from Scratch!
  • Now compatible with B+ / v2 Pi models.
  • Now Running latest version of Spigot v1.8
  • Start.sh now auto-updates server version.
  • World-Border no longer enabled by default. (testing if necessary with latest Pi models)
  • Run script still enabled to reboot if server crashes. (enabled by default now)

Advertisements

228 Comments

  1. CRendonK
  2. JEDENSMORE
      • JEDENSMORE
            • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
              • JEDENSMORE
  3. David Faulkner
      • David Faulkner
  4. Jake
      • Jake
  5. Kristen
      • Kristen
  6. Jesper
      • Jesper
  7. Abel Sanchez
    • Jay
  8. Marko Kovacevic
    • Abel Sanchez
  9. Chris
      • Chris
          • Chris
  10. Vikram Sharma
  11. Enrique Camou
  12. OneWhoWaits
    • Shayne
  13. Shayne
    • Shayne
        • Shayne
  14. MADROX
  15. Zain
    • Zain
        • Zain
  16. The Dude
  17. Mik
      • Mik
  18. geronimo larralde
  19. wongman44
  20. Enrico
      • Enrico
  21. Alex
      • Alex
  22. Aaron
          • Patrick Cote
              • saitho
              • Guest
  23. Cy
    • JCT
    • Cy
  24. Alex
  25. Blake
  26. Shane Lester
      • Shane Lester
  27. Camerron
  28. Camerron
      • BusterNaeslund
  29. Cameron
  30. Kai
  31. Cameron
  32. BusterNaeslund
  33. John Pattison
  34. mrepic552
  35. Patrick Cote
  36. landy
  37. Chris
  38. theredbrain
  39. x92127
      • Brian
  40. Sean O
      • Sean O
            • Sean O
  41. Curiosity
  42. rogerjbos
      • rogerjbos
          • rogerjbos
              • rogerjbos
  43. Johan Kuiper
      • Amit P
  44. Peter Fitz AUST
      • Peter Fitz AUST
          • Peter Fitz AUST
  45. Peter Fitz AUST
    • Peter Fitzsimmonds
  46. FOSNL
    • FOSNL
  47. Julien
      • Julien
          • Julien
  48. Matt
  49. orallo
    • Matt
    • Amit P
  50. Deborah Timmis Csj
    • Deborah Timmis Csj
      • Deborah Timmis Csj
          • Deborah Timmis Csj
              • Deborah Timmis Csj
    • Deborah Timmis Csj
  51. Deborah Timmis Csj
  52. Amit P
  53. Amit P
  54. Anneb
  55. Armando A. Garcia
      • Armando A. Garcia
  56. Cory Bancroft
  57. Philbert De Zwart
    • Cory Bancroft
        • Richard
  58. Dax Vines
    • Gerik C.
  59. Demian
  60. William Kestle
  61. Dean Paczewitz
  62. Dean Paczewitz
  63. Pellesnurr
  64. Moggalito
  65. beritberit
  66. Daniel Jørgensen
  67. Daniel Nowak
  68. David McKeitch
  69. David McKeitch
      • David McKeitch
      • William Kestle
  70. Valentijn Garritsen
    • David Schott
  71. sebbbe
    • sebbbe
      • sebbbe
        • Manuel Müller (MucMoe)
  72. Rinusch
  73. Manuel Müller
  74. Dennis_van_dam
    • Hugo M
  75. Zayveeo5e
  76. Tennison Seybold