🛠 Serveur web léger et conteneurs
Objectives
Turn the ODROID-C2 into the house's little server: a light website behind nginx, containerized execution with Podman (Docker also works on ARMv8 images), leveraging the C2's two hardware assets — real Gigabit Ethernet and the eMMC slot — on its 2 GB of DDR3.
Hardware
- ODROID-C2 running Armbian or DietPi (ARMv8/aarch64), system on an eMMC module
- Stable 5 V / 2 A power supply (USB spikes to be avoided)
- Wired Gigabit network; the board has no built-in Wi-Fi
- Optional: USB dongle, but the 4 USB2 ports share a GL852G hub
Full code
# 1) nginx + site static
sudo apt update && sudo apt install -y nginx
echo '<html><body><h1>Serveur ODROID-C2 (S905, GbE)</h1></body></html>' \
| sudo tee /var/www/html/index.html
systemctl status nginx --no-pager
# 2) Podman (podman-docker fournit l'alias docker)
sudo apt install -y podman
podman run -d --name whoami --restart always -p 8080:80 \
--pull=always quay.io/podman-static/whoami 2>/dev/null || \
podman run -d --name test -p 8080:80 nginx:alpine
# 3) memoire : 2 Go partagés — limiter chaque conteneur
podman update --memory 256m test 2>/dev/null || true
free -h
# 4) ecrire peu : logs en RAM (rclone/rsyslog vers le disque par rotation)
sudo sed -i 's#^.*"/var/log/nginx/access.log"#/var/log/nginx/access.log#' /etc/logrotate.d/nginx 2>/dev/null || true
# 5) test depuis un poste : curl http://<ip-du-c2>/ et :8080
Expected verification
curl http://IP/ returns the nginx page, the container answers on 8080. iperf3 toward the board exceeds 600 Mbit/s: the GbE link (RTL8211F) is not the bottleneck, microSD storage would be. free -h shows the footprint under control within the 2 GB.
Common errors
- Booting the server on a cheap microSD: slow I/O (SDR50/SDR100 in mainline) and wear — eMMC is the fix provided by the DTS (HS200).
- Leaving vendor images (kernel 3.14, Ubuntu 16.04) exposed: too old, ban them from the network.
- Stacking containers without memory limits: the OOM killer strikes at 2 GB.
- Expecting anything from the Mali-450 GPU in mainline: proprietary blobs only, useless for a server.
- >
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash