🛠 Un serveur maison qui consomme 2,5 W : Docker léger sur la PINE A64
Objectives
Transform the PINE A64 into a small permanent server: the board was marketed in 2016 as "the cheapest 64-bit ARM platform for running Docker" (with HypriotOS at the time), its officially measured power consumption is approximately 2.5 W, and the mainline kernel runs Docker without any exotic requirements. The real engineering challenge here is not Docker but the hardware constraints: 512 MB to 2 GB of RAM, no embedded flash (everything lives on the microSD), and 10/100 networking on the base version. You will size, install, and secure a lightweight service: an MQTT broker + a backup cron job.
Hardware
- 1 × PINE A64/A64+ (2 GB recommended for Docker; the 512 MB model is effectively limited to Arch/Debian and very few containers)
- 1 × verified quality microSD (h2testw/f3) — the official wiki itself links to these counterfeit detection tools
- 5 V 2 A barrel power supply (never use micro-USB for a server: voltage drops = random SD/USB failures)
- Ethernet (gigabit only on A64+)
Complete Code
# Armbian : installer Docker (dépôt officiel docker.com, arm64)
curl -fsSL https://get.docker.com | sudo sh
# Broker MQTT Mosquitto en conteneur (service sobre, adapté à la carte)
sudo docker run -d --name mosquitto --restart unless-stopped \
-p 1883:1883 eclipse-mosquitto:2
# Sauvegarde quotidienne de l'état des conteneurs sur le PC du réseau :
crontab -e
# 0 3 * * * tar czf /root/etc-backup.tgz /etc && scp /root/etc-backup.tgz pc:/backups/pine64/
# Sur un modèle 512 MB, ajouter du swap pour survivre aux pointes :
sudo fallocate -l 1G /swapfile && sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
# Vérifier la RAM disponible avant d'empiler les conteneurs :
free -h && docker stats --no-stream
Expected Verification
docker ps shows Mosquitto Up, reachable from the LAN (mosquitto_sub -h <ip> -t test on the PC). The board consumes ~2.5 W at idle — amounting to a few euros per year in electricity for permanent service. free -h helps size the next steps: with 2 GB you can stack a few lightweight containers; with 512 MB, stick to a single service and use swap. On the base board, remember that the network caps at ~94 Mbit/s (iperf3 tutorial) before considering it for a file server.
Common Mistakes
- Building a server on a counterfeit microSD: SD card failure is the #1 failure mode for this class of boards (Armbian makes it their top support topic) — use a branded, tested card, and perform regular backups of /etc.
- Overloading a 512 MB model: the Wikipedia page is clear, this model "only works with Arch Linux and Debian distributions"; Android/Ubuntu Touch workloads require 1 GB+ — and Docker dies first from OOM there.
- Powering via micro-USB "because it works": for a 24/7 service, voltage drop in the thin cable eventually leads to SD corruption; the 5 V 2 A barrel supply is there for a reason.
- Exposing the broker to the Internet without TLS: MQTT on port 1883 in plain text = readable credentials; stay on the LAN or use an encrypted tunnel.
- Forgetting the board is 10/100 (base version) and complaining about NAS performance: the limit is physical (RTL8201 PHY), not software.
- Letting the rootfs fill up the microSD: the first-boot resize in Armbian is handled, but Docker logs keep growing — configure
--log-opt max-size.
Other tutorials for this board
- Premier boot d'Armbian sur la PINE A64 (microSD, console série, rootfs)
- PINE A64 ou PINE A64+ ? Le pièg du réseau gigabit dès le premier regard
- Faire clignoter une LED avec libgpiod (numérotation GPIO du A64 : PB0 = 32)
- Benchmark Ethernet iperf3 : mesurer le piège 10/100 vs gigabit
- Lire un capteur I²C (BME280) sur le bus i2c-1 du connecteur Pi-2
- Construire sa propre image Armbian pour la PINE A64 (armbian/build)
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash