Uninstall¶
spawnwp installs into /srv, the host nginx config and systemd. To remove it, work from
the outside in. Back up anything you want to keep first (snapshots,
databases, wp-content).
Destructive
These steps delete all sites, databases and volumes. There is no undo.
1. Destroy the sites¶
From the cockpit, bring each site Down and Destroy it. Or from the shell:
for d in /srv/*/; do
[ -f "$d/compose.yaml" ] || continue
(cd "$d" && docker compose down -v --remove-orphans)
done
2. Remove the project directories¶
3. Remove host services¶
systemctl disable --now wp-cockpit.service docker-prune.timer
rm -f /etc/systemd/system/wp-cockpit.service \
/etc/systemd/system/docker-prune.*
systemctl daemon-reload
4. Remove nginx config¶
Restore your own nginx default site (or remove spawnwp's server blocks for DOMAIN and
COCKPIT_DOMAIN), then:
5. Remove secrets and application files¶
rm -rf /etc/spawnwp /var/lib/spawnwp /opt/spawnwp /usr/local/lib/spawnwp
rm -f /usr/local/bin/spawnwp /root/spawnwp-credentials.txt
6. (Optional) Certificate and packages¶
Docker, nginx and certbot are left installed in case you use them for other things. Remove packages only if you are sure they are unused.