Host a Local Dev Server on Raspberry Pi 5: Perfect for Student Web Projects
raspberry pidevopseducation

Host a Local Dev Server on Raspberry Pi 5: Perfect for Student Web Projects

ccodeacademy
2026-02-07
9 min read
Advertisement

Turn a Raspberry Pi 5 into a low-cost dev server for student projects. Run NGINX, Docker, self-hosted CI runners, and lightweight databases locally.

Build a low-cost dev server with Raspberry Pi 5 for student projects, CI runners, and lightweight databases

Hook: Students and teachers are tired of patchy cloud credits, long deploy cycles, and fragmented tooling. A Raspberry Pi 5 lets you run a reliable local dev server for web apps, CI runners, and databases for a class or small lab — at a fraction of cloud cost and with real hands-on learning value.

This article gives a practical, step-by-step workflow to set up a Raspberry Pi 5 as a local dev server in 2026. You will get a reproducible stack using NGINX and Docker, run self-hosted CI runners, host Postgres or Redis for projects, use mkcert for trusted TLS on your LAN, and tune performance and security for classroom use.

Why Raspberry Pi 5 is the right choice in 2026

Recent hardware and software trends through late 2025 and early 2026 have made the Raspberry Pi 5 an excellent edge dev node:

  • More compute and I/O than prior Pi models, which means better multi-container performance for Docker and lightweight CI jobs.
  • Better local AI support with optional AI HAT modules in 2025, useful for student projects that experiment with local inference without sending data to the cloud.
  • Large software ecosystem: Ubuntu Server, Raspberry Pi OS, container tooling, and orchestration like k3s are mature on ARM in 2026.
  • Trend toward local-first development: rising cloud costs and a focus on privacy made classrooms adopt on-prem dev servers and self-hosted CI runners for cost control and reproducibility.

Common classroom use cases

  • Host student web apps and static sites for demos and grading.
  • Run self-hosted CI runners so tests run locally without cloud billing surprises.
  • Provide shared databases like Postgres for coursework.
  • Enable group projects with Git push to a local Git server or to GitHub with self-hosted runners.

What you will build

By the end of this tutorial you will have:

  1. A Raspberry Pi 5 running a server OS and Docker.
  2. An NGINX reverse proxy for local domains and TLS via mkcert.
  3. A docker-compose stack that runs a sample Node.js app, Postgres, and a CI runner container.
  4. Basic backup, monitoring, and security hardening suitable for student labs.

Hardware and software checklist

  • Raspberry Pi 5 board (4GB or 8GB recommended for multiple containers)
  • Active cooling and a case with airflow
  • Fast storage: NVMe SSD via adapter or a high-performance microSD card
  • Official power supply recommended
  • LAN network with DHCP reservation or static IP option
  • OS: Raspberry Pi OS Lite or Ubuntu Server 24.04 LTS (both are well supported in 2026)
  • mkcert for trusted local TLS, Docker and docker-compose, NGINX

Quick start: install the OS and prepare the Pi

Start with a clean image and an SSH-enabled headless setup if you prefer remote setup. This example uses Ubuntu Server 24.04 LTS, but Raspberry Pi OS commands are equivalent.

1. Flash OS and enable SSH

sudo dd if=ubuntu-24.04-server-arm64.img of=/dev/sdX bs=4M status=progress; sync
# Put the microSD into the Pi, boot, and SSH into pi.local or the assigned IP

2. Initial hardening and updates

sudo apt update && sudo apt upgrade -y
sudo adduser devadmin
sudo usermod -aG sudo devadmin
# disable password login for root in /etc/ssh/sshd_config and restart sshd
sudo systemctl restart ssh

Tip: Create an ssh key pair on your laptop and copy the public key to the Pi for secure logins.

Install Docker and docker-compose

Docker is the fastest way to host reproducible student stacks. Use the official convenience script and install docker-compose plugin.

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker devadmin
# Install docker compose plugin
sudo apt install -y docker-compose-plugin

Log out and back in to apply group changes, then verify:

docker info
docker compose version

Set up NGINX as a reverse proxy

NGINX will route local domains like project1.local to containers. For trusted TLS on the LAN, use mkcert instead of self-signed certs.

Install mkcert and create local CA

sudo apt install -y libnss3-tools
wget -O mkcert https://github.com/FiloSottile/mkcert/releases/latest/download/mkcert-linux-arm64
chmod +x mkcert && sudo mv mkcert /usr/local/bin/
mkcert -install
mkcert project1.local '*.lab.local'  # generates project1.local.pem and key

Simple NGINX config for a container

sudo apt install -y nginx
sudo tee /etc/nginx/sites-available/project1 > /dev/null <<'NGINX'
server {
  listen 443 ssl;
  server_name project1.local;
  ssl_certificate /home/devadmin/project1.local.pem;
  ssl_certificate_key /home/devadmin/project1.local-key.pem;
  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
  }
}
NGINX
sudo ln -s /etc/nginx/sites-available/project1 /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

This routes project1.local to a container exposing port 3000 on the host network or bound to 127.0.0.1.

Compose a development stack with Docker

Create a docker-compose.yml that contains a sample Node app, Postgres, and a GitHub Actions self-hosted runner container. Keep resource limits so the Pi stays responsive.

version: '3.8'
services:
  web:
    image: node:18-bullseye
    working_dir: /usr/src/app
    volumes:
      - ./app:/usr/src/app
    command: sh -c 'npm install && npm run dev'
    ports:
      - "3000:3000"
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 256M

  db:
    image: postgres:15
    environment:
      POSTGRES_DB: devdb
      POSTGRES_USER: dev
      POSTGRES_PASSWORD: devpass
    volumes:
      - db-data:/var/lib/postgresql/data
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 512M

  runner:
    image: ghcr.io/actions/runner:latest
    environment:
      - RUNNER_NAME=pi5-runner
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped

volumes:
  db-data:

Save this as docker-compose.yml and run:

docker compose up -d

Adjust resource limits to keep multiple student stacks running. In a classroom, you can centralize shared DBs and spawn per-student web app containers on demand.

Register a self-hosted CI runner

Self-hosted runners reduce CI credits and enable reproducible environments. Two common options:

  • GitHub Actions: create a registration token in repo or org settings and configure the runner. The official runner image can run in Docker or directly on the host.
  • GitLab CI: install gitlab-runner and register it with a token. The runner can use Docker executor.

GitHub Actions runner quick register

# Generate token in GitHub repo - Settings -> Actions -> Runners
# Follow the registration commands shown by GitHub; typical steps:
./config.sh --url https://github.com/org/repo --token YOUR_TOKEN --unattended --name pi5-runner
./run.sh

Or run the official Docker image and pass the token via environment variables. Keep runners in a protected network and limit permissions for classroom use.

Data persistence and backups

Students will lose work without backups. Use scheduled database dumps and a simple rsync to an external drive or a NAS.

# nightly dump script /usr/local/bin/pg_dump_daily.sh
#!/bin/sh
PGPASSWORD=devpass pg_dump -U dev -h 127.0.0.1 devdb | gzip > /home/devadmin/backups/devdb-$(date +%F).sql.gz

# add to cron
0 3 * * * /usr/local/bin/pg_dump_daily.sh

For larger classes, consider block-level backup with borg or an object-store backup target.

Monitoring and resource tuning

Lightweight monitoring helps spot noisy containers and keep the Pi responsive. Install netdata or run htop and glances for quick checks.

bash <(curl -Ss https://my-netdata.io/kickstart.sh)
# or install glances
sudo apt install -y glances

Configure swap carefully. Pi 5 performance improves with a small swap file for headroom, but avoid heavy swapping.

Security best practices for the classroom

  • SSH keys only: disable password auth and disallow root login.
  • Firewall: enable ufw and allow only needed ports 22, 80, 443 and runner ports if used.
  • Isolate student projects: use container limits and separate volumes per user; consider user namespaces.
  • Update regularly: apply security patches and reboot during off hours.

Advanced: scale with k3s or multiple Pi 5 nodes

If your lab needs more capacity, cluster multiple Raspberry Pi 5 nodes with k3s or Docker Swarm. k3s is lightweight and popular in 2026 for edge clusters.

Pro tip: use a shared NFS or an S3-compatible object store for persistent volumes across nodes to avoid data loss when pods move.

Troubleshooting checklist

  • Container not starting: check docker logs with docker compose logs service
  • Low memory: inspect top or glances, reduce container memory limits, increase swap if necessary
  • DNS and local names not resolving: try avahi-daemon for .local hostnames or configure router DHCP reservation
  • CI job failing due to missing build tools: prebuild a runner image that includes required toolchains

A short classroom case study

In Fall 2025 a university class of 24 students used three Raspberry Pi 5 nodes to host per-student web apps and a shared Postgres instance. The instructor configured one Pi as the CI host and two as app nodes. Students pushed code to GitHub while self-hosted runners on the Pis executed tests and built artifacts. Outcomes:

  • Zero cloud bills for semester CI runs compared to an estimated 500 USD if using cloud runners
  • Faster feedback loops for students because jobs ran on local network latency
  • Hands-on learning about deployment, security, and resource constraints

Actionable checklist to get started in one afternoon

  1. Flash Ubuntu Server 24.04 or Raspberry Pi OS and secure it with SSH keys.
  2. Install Docker and docker-compose, and add your dev user to the docker group.
  3. Install mkcert and generate certs for project domains on the LAN.
  4. Deploy a small docker-compose with a web app and Postgres, then configure NGINX to route to the app.
  5. Register a self-hosted runner for GitHub or GitLab and run a basic CI job to validate the pipeline.
  6. Set up backups, monitoring, and a firewall rule to protect the Pi.

Expect these trends to grow through 2026 and beyond:

Final tips

Start small and iterate. Use one Pi as the canonical dev server, then replicate the pattern for more nodes. Treat the server as a teaching tool: let students modify Dockerfiles, write migrators, and debug CI. That hands-on exposure is often more valuable than cloud credits.

Key takeaways

  • Raspberry Pi 5 is powerful enough in 2026 to host dev servers for student projects with NGINX, Docker, and self-hosted CI.
  • Use mkcert for trusted TLS on your LAN, and respect container resource limits to keep the Pi responsive.
  • Self-hosted CI runners save costs and teach reproducible deployment workflows.

Ready to set up your Pi? Start with the quick checklist above, deploy a single student app, and expand once you see predictable results.

Call to action

Try this on a spare Raspberry Pi 5 this weekend. Build the stack, push a sample repo, and run a CI job. Share your docker-compose and NGINX config in your class repository or community forum. If you want a starter repo and prebuilt images to speed setup, sign up for our newsletter at codeacademy.site for reproducible templates and classroom-ready scripts.

Advertisement

Related Topics

#raspberry pi#devops#education
c

codeacademy

Contributor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.

Advertisement
2026-02-07T01:07:49.457Z