🛠 Héberger des conteneurs Docker et un serveur web sur NVMe
Objectives
Turn the Orange Pi 3B into a small 24/7 server: install Docker (arm64), move image storage onto the NVMe SSD (more durable than microSD), and expose a nginx web server on the network via gigabit Ethernet.
Hardware
- Orange Pi 3B running Armbian bookworm arm64, preferably 4 or 8 GB of RAM
- NVMe SSD mounted as rootfs (see the NVMe boot tutorial) or a data partition
- Local network; 5 V / 3 A power supply
Full code
# 1. Docker officiel (arm64) — script get.docker.com ou paquets Debian
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=arm64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io
# 2. Stockage Docker sur le SSD (si / n'y est pas déjà)
sudo mkdir -p /srv/docker && sudo tee /etc/docker/daemon.json <<'EOF'
{ "data-root": "/srv/docker" }
EOF
sudo systemctl restart docker
# 3. Serveur web + redémarrage automatique
docker run -d --name web --restart unless-stopped -p 80:80 \
-v /srv/www:/usr/share/nginx/html:ro nginx:alpine
echo '<h1>Orange Pi 3B — RK3566</h1>' | sudo tee /srv/www/index.html
# 4. Vérification
sudo docker ps && curl -s http://localhost/ && ip -br addr
Expected verification
docker ps shows the web container "Up"; curl http://localhost/ returns the page title; from a machine on the network, http://IP-de-la-carte/ displays the page. After sudo reboot, the container restarts on its own (--restart unless-stopped).
Common errors
- Forgetting
arch=arm64in the APT source: "multiple architectures" or x86 image not found (the RK3566 is ARMv8 64-bit). - Leaving
data-rooton the microSD: premature wear of the card; the NVMe is there for that (reminder: slot limited to PCIe 2.1 x1, ~500 MB/s). - Port 80 already taken by a systemd server (
ss -tlnp | grep :80). - Firewall/box: test locally before publishing the service on the Internet; do not expose Docker directly.
- Confusing the vendor image (Mali blob, RKNN) and Armbian (panfrost): RKNN-style NPU images only run on the vendor kernel — useful if you containerize edge-AI later.
Other tutorials for this board
- Faire clignoter une LED via le GPIO avec libgpiod
- Lire un bouton poussoir et afficher l'état dans la console
- Premier script Python : bouton + LED avec python3-libgpiod
- Variation d'intensité d'une LED avec un signal PWM
- Interroger un capteur I2C sur les broches 3/5 du connecteur
- Configurer Ethernet gigabit et Wi-Fi puis se connecter en SSH
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash