DevSecOps Journey: From Static Hosting to Production
How I moved my portfolio site from shared hosting to a fully self-managed, containerized, monitored and secured setup following DevSecOps principles.
Start date: January 2026
Current status: Production live, staging in progress, monitoring & backups running
1. Initial Situation & Goal
- Site was hosted on shared hosting (Ionos)
- Static HTML + Bootstrap template (iPortfolio)
- Goal: move to own VPS, apply DevSecOps practices, document everything for learning & showcase
2. VPS Setup & Hardening
Switched from Rocky Linux to Ubuntu 24.04 LTS for better tooling support.
# Create non-root user
adduser awash
usermod -aG sudo awash
# Disable root login & password auth
sudo nano /etc/ssh/sshd_config
# → PermitRootLogin no
# → PasswordAuthentication no
sudo systemctl restart ssh
# Firewall
sudo ufw allow OpenSSH
sudo ufw enable
Troubleshooting: Forgot to add user to sudo group → got locked out → had to use Ionos console to fix.
3. Containerization
Installed Docker & Compose, created custom Dockerfile, pushed image to Docker Hub.
docker build -t awashawash/awash-portfolio:latest .
docker push awashawash/awash-portfolio:latest
Challenge: Initial push failed due to large video file (>100 MB).
Solution: Removed video from git history with git filter-repo, re-committed & pushed.
4. Cloudflare Integration
HTTPS, HSTS, proxy enabled. Staging subdomain on custom port (8081).
Challenge: DNS for staging subdomain not resolving.
Workaround (temporary): Testing via direct IP + port[](http://217.154.44.73:8081)
5. Security Scanning
Trivy on container image, SonarCloud for static analysis.
trivy image awashawash/awash-portfolio:latest
6. Monitoring
Prometheus + Grafana + Netdata.
Challenge: Prometheus kept restarting.
Solution: Fixed invalid YAML in prometheus.yml (removed misplaced metrics_path).
7. Automated Backups
# Daily at 3:00 AM
0 3 * * * /home/awash/backup-site.sh >> /home/awash/backups/site/backup.log 2>&1
8. Current Status & Next Steps
- Production live
- Staging in progress (port 8081)
- Monitoring & backups running
- Planned: alerting, rate limiting, off-site backups, Dependabot
Lessons Learned
- Always validate YAML syntax before restarting services
- Separate production & staging early
- Document everything – it helps when troubleshooting
- Security first: harden server before exposing services
Work in progress – check back for updates!