🛠 Serveur web léger et conteneurs

ODROID-C4 (Hardkernel) · avance · Schéma : IMG-odroid-c4-avance-3-odroidc4-serveur-web.svg — ODROID-C4 en serveur : nginx et deux conteneurs Podman sur Armbian, port Ethernet Gigabit relié au réseau local, flèches HTTPS entrantes.

Objectives

Turn the ODROID-C4 into a small home web server: serve a static site with nginx behind systemd, then isolate applications in Podman containers. The board's strengths for this role: 4 Cortex-A55 cores with Armv8 crypto extensions (accelerated SHA for TLS), Gigabit Ethernet, eMMC for I/O, and only ≈ 1.8 W at idle.

Hardware

Complete Code

#!/usr/bin/env bash
# 1) Site statique nginx
sudo mkdir -p /srv/www && echo '<h1>ODROID-C4 opérationnel</h1>' | sudo tee /srv/www/index.html
sudo tee /etc/nginx/sites-available/c4 >/dev/null <<'EOF'
server { listen 80; root /srv/www; index index.html;
  location /health { return 200 "ok\n"; }
}
EOF
sudo ln -sf /etc/nginx/sites-available/c4 /etc/nginx/sites-enabled/c4
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl enable --now nginx && sudo systemctl reload nginx

# 2) Conteneur Podman (rootless) avec démarrage au boot
podman run -d --name wiki -p 8080:80 --restart=always nginx:alpine
sudo loginctl enable-linger $USER   # garder les conteneurs au démarrage

# 3) Vérification
systemctl is-active nginx

Expected Verification

From a machine on the network: curl -i http://<IP-du-C4>/health returns HTTP/1.1 200 OK followed by ok, and the homepage displays in the browser. curl http://<IP>:8080 responds from the container. podman ps lists the container in Up state; after sudo reboot, both services come back without intervention thanks to enable and --restart=always.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials