How To Setup Minecraft On The Raspberry Pi

Until recently I had never played Minecraft but it’s popularity meant it was something I felt I had to try. I installed the free pocket edition on my Nexus 7 to try it out and as a result decided to give it a go on the Pi.

MinecraftUsing the Pi to run Minecraft opens up the possibility to interact with the 3D world using Python. This is something that particularly interested me. You can build structures using the normal interface but on the Pi you’ve got the chance to control that world using scripts to create and edit blocks.

The Pi Edition is similar to earlier versions of the Pocket Edition and only offers “Creative” mode. Therefore it’s not as advanced or fancy as the versions you may be used to playing on other platforms.

So lets get started!

Minecraft Pi Edition Header


I suggest starting off with a fresh installation of Raspbian on your SD card. The latest image can be downloaded from

Boot the Pi, login and then type the following command :


This will run the graphical interface. Click the LXTerminal icon to open a terminal window. Use the following command to download the Minecraft package from the official site :


Then use the following to unzip the contents :

tar -zxvf minecraft-pi-0.1.1.tar.gz

This should have created a directory and extracted some files into it. Let’s open that directory :

cd mcpi

Then finally you can run the application using :


The Minecraft window should open and look something like this :

Minecraft Screenshot 01Click “Start Game” to dive in and generate a new world to explore.

Minecraft Screenshot 02Minecraft runs at a fixed resolution so your screen may look different depending on your monitor settings. You can maximise the window and run full screen but this may affect your mouse pointer. Be prepared to start using the keyboard!

Minecraft Screenshot 03

Add Desktop Icon

It’s a bit of a pain to open a command prompt every time you want to play but it is easy to create a short-cut icon on the desktop.

Minecraft Pi Edition IconFirst, save this image to your computer as “minecraft.png” and copy it to your Pi and into your mcpi folder.

Right-click on your LXDE desktop and select “Create New” followed by “Blank File”

Name the file “minecraft.desktop”. Click OK and the short-cut file should appear on the desktop.

Right-click on this new .desktop file and select “Leafpad”. The file will open in the “Leafpad” text editor.

Copy the following code into “Leafpad” :

[Desktop Entry]
Name=Minecraft Pi Edition
Comment=Launch Minecraft Pi Edition!
Exec=sh -c 'cd ~/mcpi && lxterminal -l -t Minecraft -e ./minecraft-pi'

Using the “File” menu save the file and exit “Leafpad”.

The short-cut should now have a nice icon and a title of “Minecraft Pi Edition”.

Minecraft Desktop Icon Example

Double-clicking the icon will launch Minecraft.

Using Minecraft

This isn’t the place to give an extensive guide to using Minecraft but I thought I would present some basics to get you moving around the environment.

ESC  Pause/Menu
W    Move forward
A    Move left
S    Move backwards
D    Move right
E    Show inventory of blocks
1-8  Select items in the quick-bar

Left mouse  Destroy blocks
Right mouse Place blocks

Space  Jump (ascend in fly-mode)
Shift  Sneak (descend in fly-mode)

The mouse can be used to change your point-of-view. The scroll wheel can be used to scroll through the items, the left mouse button being used to select a block. When viewing the inventory you can use the WASD keys to move the selection using the Enter key to select a block.

Double-tapping the Space bar will activate and deactivate fly-mode.

You can exit Minecraft by clicking the [x] in the top right hand corner of the game window.

MinecraftPython API

Now you’ve got Minecraft running take a look at my tutorial on configuring the Python API. This allows you to control the Minecraft world using Python scripts.

It’s a great way to build structures and learn Python at the same time.

This entry was posted in Minecraft, Python, Tutorials & Help and tagged , , . Bookmark the permalink.

24 Responses to How To Setup Minecraft On The Raspberry Pi

  1. Tim Smith says:

    It was this version that got my daughter hooked on Minecraft (I have to take full responsibility!)
    I was a little disappointed with the limitations of this version compared to the full versions on PC and iPad until I discovered that you can access Minecraft with a Python API.
    I’m a long way from being an expert, what I have learnt has mostly come from
    Stuff About Code
    My project is to combine Minecraft with the GPIO to shine different LEDs depending on what I’m standing on. Stuff About Code has some very cool examples including clocks that update in realtime

    • Matt says:

      I think lots of people might be disappointed as the official information doesn’t quite make it clear this is a basic version. I’ve not played the full-featured versions so I haven’t been spoilt with new features. The Python API is what interested me. The “Stuff About Code” has some excellent information and I’m sure will help me get started. Just need to think of a novel Python idea to try out. Interfacing with real hardware offers some cool possibilities!

  2. Chris says:

    Hello, very useful post. My son is playing it on the Raspberry Pi but is not sure how to save the world he has created. Therefore, he has to start in a new world every time. Is this the way the R-pi version works or is there a way to save your world?


    • Karl Beykirch says:

      We have the same problem (can’t save worlds). Have you found an answer? Does anyone know?
      Could there be a problem with permissions on one or some of the Minecraft directories?

      • Karl Beykirch says:

        Well, no one replied at all, but just in case someone finds this: I solved it. The problem was ownership/permissions of the invisible .minecraft directory and subdirectories.

  3. Sam Clayson says:

    When I try to extract the tar file using tar -zxvf minecraft-pi-0.1.1.tar.gz, an error occurs saying:

    tar (child): minecraft-pi-0.1.1.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now

    Any ideas on why this may be?

    • Matt says:

      If it is saying “No such file or directory” then the tar.gz file isn’t there or it’s got a different name. Type “ls” to list the files in the current directory and double-check.

    • Dan says:

      I had exactly the same problem. I found this was because i clicked the download link from the minecraft website. I then followed these instructions from the beginning and it worked no problem. Basically, delete whatever you have now and start again using the steps here!

    • mike says:

      clear out the files that may be already down loaded…use the wget
      right in the terminal don’t send it to a file just type it in and execute. I was having the same issue. Once I did this I was able to decompress the file and it worked! Good luck

  4. Catherine says:

    Hi I’ve got Minecraft working on my R Pi following your instructions above. Only thong that hasn’t worked saving the minecraft.png file . It saves as a blank file. Any suggestions? Thanks!

  5. Gordon Johnny says:

    I get to the part where I put in “./minecraft-pi” and it gives me the following error message: “./minecraft-pi : cannot execute binary file” does anyone know what to do with that?

  6. wrichards says:

    any chance this would work under retropie? or is it set in the raspian windows?

  7. Alex says:

    When I type in that command into LXTerminal it says it’s connecting to but then it says Connection refused.

    Did the file get removed?

  8. Kevin says:

    On my Raspberry Pi, Minecraft Pi is preinstalled on the desktop. When I double click the icon, a black box appears and the game does not load. I am talking to the Pi over VNC, if that makes a difference.

  9. marc says:

    I wonder if anyone can help me. My children and I are trying to get minecraft to work on an pi. We are able to launch it, but after the world is created the pointer is very sluggish and we can only make a couple of selections using keys before the pi freezes and we have to reboot. It is B model with 512MB. We are overclocking it set at Turbo and the GPU memory is split to 256. As far as I can see it is hardfloat. I got the kids very excited about minecraft and would really like to get it working. Any suggestions very welcome.

    • Matt says:

      Turn the overclocking off and see if it works OK then. It could be a problem with the power supply so if you’ve got an alternative give that a try as well. Also are you using the latest Raspbian image?

  10. Adrian says:

    Thanks to all the contributors for Mindcraft pi, I had no idea it would be such a hit with the kids. I love the fact it’s an in to python script too, (lots for us to learn) :-) (I am running the latest wheezy image and mind craft came preloaded.)

    I’m running my pi on an old TV and have been tweaking the config.txt file in /boot/ to position the display image on the screen.
    I believe mindcraft is using the overscan commands in config.txt, to position the image on the screen relative to its launch window, so it displays off to one side – and is scaled way beiger than the screen. I can adjust it by resizing the window to get it to fit, but this is more than a 7 year old can do given one can’t see the window behind the mindcraft screen.

    I am looking for some script I can add to the Icon file to have it launch at a cretin size and position to avoid the need to adjusting the window size at start up.
    I’ve found this ( which I have yet to test that will allow me to set the window size, but I was wondering how does one set the window position? (and size if there is another way)

    Any help welcome.
    And many thanks.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>