🛠 Serveur multimédia et Domotique avec Docker
Objectives
Transform the Raspberry Pi 5 into a containerized media and home automation server: install Docker, deploy Jellyfin (the VideoCore VII GPU provides a 4Kp60 HEVC decoder and two 4Kp60 micro-HDMI outputs) and Home Assistant, with data persistence on NVMe for heavy workloads.
Hardware
- Raspberry Pi 5 (8 GB recommended) + official 27 W power supply
- NVMe SSD on the PCIe connector (recommended for the database and media library)
- Active Cooler or ventilated case (sustained transcoding = 80-85 °C range)
- Gigabit network; TV on one of the two micro-HDMI ports
Full code
# 1) Installer Docker (dépôt officiel)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER && newgrp docker
# 2) Jellyfin avec accès au périphérique V4L2 (décodage/encodage matériel)
mkdir -p ~/jellyfin/config ~/jellyfin/media
sudo docker run -d --name jellyfin --restart unless-stopped \
-p 8096:8096 \
-v ~/jellyfin/config:/config \
-v ~/jellyfin/media:/media \
--device /dev/dri:/dev/dri \
jellyfin/jellyfin
# 3) Home Assistant OS ou conteneur supervisor
sudo docker run -d --name homeassistant --restart unless-stopped \
--privileged --network host \
-v ~/ha/config:/config \
ghcr.io/home-assistant/home-assistant:stable
# 4) Vérifier l'accès GPU côté conteneur
sudo docker exec -it jellyfin ls -l /dev/dri
Expected verification
docker ps lists both containers as Up. The Jellyfin interface at http://IP_DU_PI:8096 detects the /dev/dri/renderD* device and offers hardware transcoding; a 4K HEVC video plays on the web client without saturating the four cores. Home Assistant responds on port 8123.
Common errors
- Forgetting
--device /dev/dri: Jellyfin transcodes in software and the four Cortex-A76 cores saturate on 4K. - Docker group permissions not applied: restart the session after
usermodor usenewgrp docker. - Media library on microSD: database I/O wears out the card; prefer NVMe (see the NVMe boot tutorial).
- Ports conflicting with the host system (8096/8123 already in use): check with
ss -tlnpbefore publishing. - Overheating during continuous transcoding: without active cooling, thermal throttling at 80-85 °C degrades throughput; install the Active Cooler.
- Old 32-bit ARM images: the Pi 5 (BCM2712) requires arm64 images; check
docker image inspectbefore deploying.
Other tutorials for this board
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython