Here’s how I secure my Spwig instance on Hetzner:
SSL Setup
- Go to Settings > Site Settings > Domain & SSL
- Enter your domain and select Let’s Encrypt
- Input your admin email (critical for renewal alerts)
- Spwig handles certificate verification, NGINX config, and auto-renewal
*My Hetzner setup requires port 80 to be open for Let’s Encrypt validation. I recommend using the default Docker Compose setup which includes NGINX reverse proxy with SSL termination.
Automated Backups
I use a cron job to run daily backups:
0 2 * * * /usr/bin/docker-compose -f /path/to/spwig-compose.yml exec db pg_dump -Fc -U spwig_user spwig_db | gzip > /backups/spwig-db-$(date +%Y%m%d).dump.gz
*Store backups on Hetzner storage with rsync:
rsync -avz /backups/ user@hetzner-storage:/spwig-backups/
Verify integrity with checksums:
sha256sum /backups/*.dump.gz > /backups/checksums.txt
Monitoring
I use Prometheus to scrape metrics from:
- PostgreSQL (via pg_exporter)
- Docker container stats
- NGINX (via nginx_exporter)
Grafana dashboards show:
- Database query latency
- Container CPU/memory usage
- SSL certificate expiration dates
*For log analysis, I run Logwatch daily to check for failed login attempts or unusual API activity.