← All projects

Homelab project

Self-hosted Webserver

The portfolio you are looking at runs on a Raspberry Pi at home. I set up the domain, DNS, web server, HTTPS and the SSH protection myself and keep it running.

Type
Homelab, running in production
Hardware
Raspberry Pi
Stack
Linux, nginx, Certbot
DNS
deSEC with DynDNS

01

Domain & DNS

  • Registered a domain and moved its DNS to deSEC.
  • Set up A/AAAA, CNAME and NS records pointing to the Raspberry Pi.
  • Keep the record on the current home IP with DynDNS via ddclient.
Diagram: browser, router with port forwarding, Raspberry Pi with nginx
Request path from the browser to the Pi

02

Web server & HTTPS

  • Installed nginx to serve the static site.
  • Configured server blocks for HTTP and HTTPS with an automatic redirect to HTTPS.
  • Secured the site with a Let’s Encrypt certificate via Certbot.
  • Enabled automatic certificate renewal.
# nginx server block (simplified)
server {
    server_name runejendral.com www.runejendral.com;

    root /var/www/runejendral.com;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/runejendral.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/runejendral.com/privkey.pem;
}

03

Security & testing

  • Protected SSH access with fail2ban.
  • Tested domain and HTTPS from outside the home network.
  • Linux
  • Raspberry Pi
  • nginx
  • Certbot
  • deSEC
  • ddclient
  • fail2ban
  • SSH
Raspberry Pi
# ddclient
protocol=dyndns2
use=web
server=update.dedyn.io
login=runejendral.com
# password=<HIDDEN>
runejendral.com

# fail2ban: jail.local
[sshd]
enabled = true
port = ******
filter = sshd
logpath = /var/log/auth.log
maxretry = 5
ignoreip = 127.0.0.1/8 ::1

Interested in working together?