Run Docker on Raspberry Pi

This guide will explain how to run Docker on Raspberry Pi

Posted by Tobias L. Maier on October 29, 2016

Download Raspbian Lite

The light version is enough, as we will use the OS only to start and manage Docker. Download it from https://www.raspberrypi.org/downloads/raspbian/

$ curl -L -O https://downloads.raspberrypi.org/raspbian_lite_latest raspbian_lite_latest.zip

Install ApplePi-Baker on Mac OS X

This is being used to “bake” the Linux image previously downloaded onto the SD

$ brew cask install applepi-baker

Start the application, everything else is self-explanatory.

Configure Wifi

We want to run Raspberry Pi in a headless mode. This means we need to configure the Wifi credentials prior starting the system.

Follow the instructions at https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

The Linux file system is not visible on MacOS X. I mounted the SD card onto a Virtual Machine with Linux. There I was easily able to edit the files.

Start Raspberry Pi

Unmount the SD card from Mac, insert it into the Raspberry Pi and start the Raspberry Pi.

SSH into the Raspberry Pi

Default username: pi, Password: raspberry

$ ssh pi@<your IP address>

Install Docker

As described at https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/, use the following command to install Docker:

$ curl -sSL https://get.docker.com | sh

Confirm Docker runs successfully

Start the Docker daemon

$ sudo service docker start

Now everything is ready to go. Confirm this with the following command:

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

What next?

  • Improve the security of your Raspberry Pi, by replacing the SSH login with username:password with a SSH certificate
  • Configure your Docker client on your computer to directly connect to your Raspberry Pi Docker instance
  • Find some interesting containers and try them out. Most Raspberry Pi-specific containers start with “rpi-” in the name