Project: VPS platform

Take stock instead of starting over

Starting point

My VPS ran two WordPress sites behind a shared nginx. The server had grown over months, and the Compose file no longer matched what was actually running.

The trigger was an outage with two separate causes: a Git commit had moved the nginx configuration files, so after a restart the server ran without any server blocks, and the certificates had silently expired on 21 February 2026 because the renewal hooks pointed at a file that no longer existed. That is a different fault from the one described in Certificates that actually renew: there, the hooks later pointed, after the move to Traefik, at a container that no longer existed.

State before the migration: one nginx does everything, two separate databases, bind mounts instead of volumes Browser :80 / :443 VPS Docker network: wpnet nginx reverse proxy for both sites WordPress odabas.ch WordPress waverider52.com :3306 :3306 MariaDB odabasdb, own MariaDB waveriderdb, own bind mount: ./data/* bind mount: ./data/* container bind mount on the host, not a Docker volume

This is what it looked like before the migration.

Decision

Before I change anything, I want to know what is really running. I reconstruct the current state from the running containers and make it the foundation in the Git repository.

Implementation

  • docker inspect gives me images, networks, volumes and environment variables of every container.
  • From that I build a new docker-compose.yml and check it against the live system.
  • The nginx configuration, the Let’s Encrypt renewal and a mail alert via msmtp are repaired, plus a kernel update.

Takeaway

Infrastructure as code starts with an honest inventory. A Compose file that does not match the live system is worse than none at all.