# Uninstall Falak

> Remove the Falak control plane from its host, with or without its data, and remove the agent from managed servers.

Source: https://falak.sh/docs/operations/uninstall/

## Remove the control plane

```bash
sudo falak-ctl backup      # optional; copy the file off the host
cd /opt/falak && sudo docker compose -p falak --env-file .env -f deploy/compose.yml --profile observability down -v
sudo rm -rf /opt/falak /usr/local/bin/falak-ctl /etc/cron.d/falak-backup
```

`down -v` deletes every volume: the database, the Fleet CA and certificates. Leave out `-v` to keep the data.

Docker itself stays installed.

## Managed servers

Servers keep running your apps after the control plane is gone. To remove the agent from a server:

```bash
sudo systemctl disable --now falak-agent
sudo rm -f /usr/local/bin/falak-agent /usr/local/bin/falak-agent.prev /etc/systemd/system/falak-agent.service
sudo rm -rf /etc/falak
```

Sites under `/srv/falak/sites`, FrankenPHP/Caddy, databases and packages remain until you remove them. Cloud machines created by Falak are not destroyed by uninstalling; delete servers in Falak first if you want that.
