Pi Docker

  1. Pi Docker Swarm
  2. Pi Docker Manager
  3. Android On Raspberry Pi Docker
Pi docker nextcloud

Using Docker also improves resource utilization and what lower end clients, such as a Raspberry Pi’s, can do. For example, using Docker, you can successfully create a Raspberry Pi home-server running Plex, Samba, VPN, qBittorrent, Rpi-Monitor, and Pi-hole with very low resource utilization, see below screenshots. The RaspberryPi form factor leads to wires sticking out all 4 sides of the board. This leads to a mess and tangle of wires. The USB ports of the RaspberryPi are not able to supply much power. The Pi will reset if a device is attached that overloads the current limit. The serial port on the Pi is 3.3v. Raspberry Pi board (Courtesy: raspberrypi.org) This is the first in a series of blogs which will take you from getting started with installing Docker on a Raspberry Pi board to running a complete. Improve this doc Balena base images. Balenalib is the central home for 26000+ IoT focused Docker images built specifically for balenaCloud and balenaOS.This set of images provide a way to get up and running quickly and easily, while still providing the option to deploy slim secure images to the edge when you go to production.

This blog post will cover how to setup a Raspberry Pi with Docker support.It will also cover some basic steps that will make it easier to work with your RasPi later on.This setup will work completely without monitor/keyboard for your Raspberry but you need a LAN connection to it.I wrote most commands so they are easily pastable and do not require too much interactive work - you should however carefully read what is going on with each of those commands before you fire them off!

  • Setting up SSH access
  • Additional tweaks to your Pi

Installing Raspbian OS

The first thing you need to do is get an SD Card that runs your Raspberry Pi operating system.To install the OS grab the Raspberry Pi Imager (available for Linux, Windows and Mac) and run it.If you only want to access your raspi remotely it is recommended to use the Raspberry Pi OS Lite from the imager menu.Do not put the card into your raspi just yet - read the next chapter.

Setting up SSH access

It is super helpful to have SSH access on your raspi - especially if you want to place it somewhere you do not see it all the time.There are multiple ways to setup SSH, this one is the SSH from the start approach where we enable SSH (temporarily) right from the first boot and then use an initial SSH connection to enable it permanently.We will use SSH with public/private key authentication and prevent password authentication as a security measure.As an additional light security measure we will change the SSH port.This does not make your system more secure but it will make it less likely to be detected by bots sniffing for SSH servers and spare you some traffic.

Enable SSH for first start

Pi docker images

Before putting the newly formatted card into your Raspberry we need to create an empty file named ssh on the SD card.On MacOS you can do this via:

Next make sure the raspi has a LAN connection to your computer - either direct or via your home network.Then power the board up.

If you are unable to connect via SSH just re-do this step by putting the SD card back into your computer.

Install SSH Keyfile

Create a private/public key pair and install the public key on the Raspberry.

💡 Your home network might require that you add .local to local hostnames i.e. raspberrypi.local

Configuring your host to automatically use the Keyfile

You can configure your host computer to automatically use the newly created keyfile when connecting to your Raspberry.On your computer open nano ~/.ssh/config and add the following entry

In case you change your hostname (later in this tutorial) you may want to change this config too.

Permanently enable SSH server

To make sure you do not have to activate the SSH server manually every time you can activate it permanently using the following commands.

Now you are safe to reboot and still have a working SSH server.

Change SSH port, hostname and disable password authentication

Again starting from your host system

🚨 From now on you need to connect to your Raspberry using port 2221 and the new hostname.

Additional tweaks to your Pi

Expand Filesystem

Make sure Raspbian OS can use the entire SD card.

RaspberryPi Docker

Disable WiFi/Bluetooth

If you do not plan to use it, why not completely deactivate it.

Set default locale

Many tools rely on a configured localization, setting this will prevent annoying warnings.

Enable automatic upgrades

It is important to keep your system up to date.But we all know you will neglect this task, so just automate it.If you have any critical applications you may want to skip this solution and find a more elaborate approach.

Create the following file sudo touch /etc/cron.weekly/autoupdate && sudo chmod 755 /etc/cron.weekly/autoupdate && sudo nano /etc/cron.weekly/autoupdate

Install Docker

On your Rasperry executed the following commands

Now you need to logout (exit) and login again to get access to the docker group.Test if docker works correctly by running

Install docker-compose

Pi Docker Swarm

docker-compose might be useful if you plan to run multiple containers.The default installation option for compose does not provide an ARM solution so we use the fallback via python.

Pi Docker Manager

add ll alias

Looking through directories using ll as an alias for ls -ahl is way more convenient, so you can enable it by modifying the default .bashrc file.

Android On Raspberry Pi Docker

If any of this is outdated or does not work for you please leave a comment or reach out via Twitter.Appreciate the feedback 👋