Uninstall the Watchflare Hub
Remove the Watchflare Hub from Docker or a systemd binary install. Includes database backup, volume deletion, agent cleanup, and firewall port removal.
Before removing the Hub, decide whether you want to preserve your data. The Hub stores everything — metrics history, host registrations, users, alert rules, TLS certificates, and package inventory — in two Docker named volumes: pgdata (TimescaleDB) and pki_data (PKI certificates).
Back up your data first
If there is any chance you will reinstall later, export a database dump before proceeding:
docker exec watchflare-postgres pg_dump -U watchflare watchflare > watchflare-backup.sql Store the dump somewhere outside the Docker host. The pki_data volume is equally important — agents are registered against the CA it contains. Without the original CA, re-registered agents must be re-enrolled from scratch.
To back up the PKI volume:
docker run --rm -v pki_data:/data -v $(pwd):/backup alpine \
tar czf /backup/pki-backup.tar.gz -C /data . Stop and remove containers
This stops and removes the containers and network, but keeps all data intact (database and TLS certificates stay in their Docker volumes):
docker compose down You can bring the Hub back up at any time with docker compose up -d — all hosts, metrics, and configuration will still be there.
Remove everything including data
This removes containers, network, and all Docker volumes:
docker compose down -v Danger
This permanently and irrecoverably deletes all metrics history, host registrations, users, package inventory, alert rules, and TLS certificates. Agents registered against this Hub will no longer be able to connect — they must be re-registered against a new installation.
What each volume contains:
| Volume | Contents |
|---|---|
pgdata | TimescaleDB data — all metrics, hosts, users, alert rules, package inventory |
pki_data | Hub CA private key, CA certificate, server certificate and key |
Remove the Docker image
docker rmi ghcr.io/watchflare-io/watchflare:latest
docker rmi timescale/timescaledb:latest-pg16 Clean up config files
Remove the .env and docker-compose.yml from the server:
rm docker-compose.yml .env If you opened ports in a firewall for the Hub (8080, 50051), close them:
# ufw example
sudo ufw delete allow 8080/tcp
sudo ufw delete allow 50051/tcp Verify removal
Confirm no Hub containers or volumes remain:
docker ps -a | grep watchflare
docker volume ls | grep -E 'pgdata|pki_data' Both commands should return no output.
Binary install (Linux — systemd)
Back up your data
pg_dump -h localhost -U watchflare watchflare > watchflare-backup.sql If TimescaleDB runs in Docker:
docker exec watchflare-postgres pg_dump -U watchflare watchflare > watchflare-backup.sql Stop and remove the service
sudo systemctl stop watchflare-hub
sudo systemctl disable watchflare-hub
sudo rm /etc/systemd/system/watchflare-hub.service
sudo systemctl daemon-reload Remove the binary and config
sudo rm /usr/local/bin/watchflare-hub
sudo rm -rf /etc/watchflare
sudo rm -rf /var/lib/watchflare Warning
/var/lib/watchflare contains the auto-generated TLS CA and certificates. Agents registered against this CA will no longer be able to connect after removal.
Remove the system user (optional)
sudo userdel watchflare Close firewall ports
# ufw example
sudo ufw delete allow 8080/tcp
sudo ufw delete allow 50051/tcp Uninstall agents
Removing the Hub does not uninstall agents running on monitored hosts. Their service will keep trying to reconnect until stopped. To remove agents: