Executive summary
I built REZZA as an operating platform for service businesses. I moved production workloads from managed hosting into a self-controlled environment designed for clearer operations, staging safety, monitoring, recovery, and secure AI-assisted operations.
Initial situation
The application and WordPress properties were distributed across managed providers. That model offered convenience, but limited infrastructure control, tied deployments to platform conventions, and fragmented visibility. The migration was a tradeoff: more control and portability in exchange for direct operational responsibility.
Objectives
- Move production to a self-managed VPS
- Build separate staging
- Preserve and safely restore PostgreSQL data
- Deploy background workers
- Move WordPress properties
- Implement HTTPS and reverse proxying
- Harden the server
- Centralize monitoring and alerting
- Establish backups and verification
- Create repeatable operations
- Add bounded, read-only AI-assisted investigation
- Prepare for future AI workloads and clients
Target architecture
Production uses a Python/Flask web application behind Gunicorn, PostgreSQL, a background worker, and persistent application data. Staging has separate containers, data, variables, protected access, and no-index headers. WordPress sites use separate containers, MariaDB databases, and private networks. Prometheus, Grafana, Node Exporter, cAdvisor, and Blackbox Exporter supply operational visibility. Portainer is protected, and the Docker socket is never publicly exposed.
Migration phases
- VPS provisioning
- Ubuntu updates and baseline hardening
- SSH hardening
- Firewall configuration
- Fail2ban
- Docker installation
- Reverse proxy and TLS
- WordPress migration
- REZZA staging deployment
- PostgreSQL migration
- Production deployment
- Background worker deployment
- DNS cutover
- Monitoring
- Backups
- Staging certification and restored-production rehearsal
- Constrained operations control plane
- Read-only capacity investigation
- Validation
- Previous platform suspension after verification
- Documentation and operational review
Challenges and resolutions
Database transaction failures
A failed statement can leave a database transaction unusable until rollback. Diagnosis focused on the first error, explicit rollback behavior, and making data operations safe to retry.
Environment-variable gaps
Mail, payment, security, and service settings can affect startup or individual features. A configuration inventory and validation process caught omissions without exposing values.
CORS and CSP
Broad policies expose unnecessary origins; overly narrow policies break legitimate behavior. First-party origins and required connections were explicitly scoped.
Reverse proxy and trusted hosts
Host validation and forwarded headers were aligned so the application could identify legitimate HTTPS requests without trusting arbitrary headers.
Docker networking
Databases and internal services stayed on private networks. Public bindings were limited to the reverse-proxy path and explicitly required management access.
Git branch and deployment separation
Staging and production use distinct branches, settings, databases, and deployment steps to prevent accidental cross-release.
Evidence versus inference
Operational measurements were classified as KNOWN, LIKELY, POSSIBLE, or UNKNOWN. A large category could justify investigation, but never an automatic claim about root cause.
Operational authority
Read-only observation was separated from remediation. Fixed wrappers exposed bounded aggregates while deletion, restart, arbitrary paths, secrets, and raw infrastructure control remained unavailable.
DNS cutover
Records, TTLs, certificates, application readiness, and rollback were sequenced before traffic moved.
WordPress migration
Files and databases were moved together, URLs and permissions validated, and each site retained an isolated network and database.
Secure AI operations
The operations control plane answers narrowly defined owner questions with fixed, read-only measurements. For disk pressure, it can compare aggregate Docker, database, backup, log, application-storage, and residual usage without exposing filenames, credentials, environment files, database contents, or the Docker socket.
Evidence and action are intentionally separate. Findings preserve uncertainty, and any cleanup, restart, configuration change, or production mutation requires a distinct owner-authorized workflow.
Outcomes
The migration produced greater infrastructure control, reduced vendor dependency, isolated environments, centralized monitoring, stronger security visibility, a repeatable deployment workflow, certification gates, and a constrained foundation for AI-assisted operations.
Lessons
Infrastructure ownership is valuable only when paired with disciplined patching, observability, tested recovery, documentation, and clear operational responsibility. AI can improve evidence gathering, but it should not erase uncertainty or blur the boundary between investigation and action.
