Uninstall the Watchflare Agent
Fully remove the Watchflare agent from Linux or macOS — stops the service, removes binary and config files, with optional data and user cleanup.
sudo watchflare-agent uninstallLinux
The uninstall command is interactive. It stops and removes the service, deletes the binary, and asks separately whether to remove the data directory, config directory, log file, and system user:
sudo watchflare-agent uninstall === Watchflare Agent Uninstallation ===
[1/6] Checking permissions...
→ Running as root
[2/6] Removing service...
[3/6] Removing binary...
[4/6] Data and configuration...
Remove data directory (/var/lib/watchflare)? (y/N):
Remove configuration directory (/etc/watchflare)? (y/N):
[5/6] Log files...
Remove log file (/var/log/watchflare-agent.log)? (y/N):
[6/6] System user...
Remove system user 'watchflare'? (y/N):
What each prompt controls:
| Prompt | What it removes | Answer N to… |
|--------|----------------|--------------|
| Data directory | WAL file, package state | Keep metrics buffer intact |
| Config directory | agent.conf, ca.pem | Preserve registration credentials |
| Log file | /var/log/watchflare-agent.log | Keep logs for troubleshooting |
| System user | watchflare system user | Keep if reinstalling soon |
Answering N to the config directory preserves agent.conf and ca.pem. If you reinstall the agent on this host later with the same agent_id and agent_key, it will reconnect to the Hub without a new registration.
Note
The host is not automatically removed from the Hub after uninstalling the agent. It will appear as offline on the Hosts page. Delete it manually if you no longer need it.
Verify removal on Linux
Check that no files remain:
which watchflare-agent # should return nothing
ls /etc/watchflare 2>/dev/null # should not exist (if you answered Y)
ls /var/lib/watchflare 2>/dev/null
systemctl status watchflare-agent 2>/dev/null macOS
Stop the service and uninstall via Homebrew:
brew services stop watchflare-agent
brew uninstall watchflare-agent To also remove config and data files:
rm -rf $(brew --prefix)/etc/watchflare
rm -rf $(brew --prefix)/var/watchflare
rm -f $(brew --prefix)/var/log/watchflare-agent.log Verify removal on macOS
which watchflare-agent # should return nothing
ls $(brew --prefix)/etc/watchflare 2>/dev/null # should not exist
brew services list | grep watchflare # should return nothing Remove the host from the dashboard
Uninstalling the agent does not remove the host from the Hub. To delete it:
- Open the host's detail page in the dashboard.
- Click the ⋯ menu → Delete host.
Deleting the host removes all its metrics history, package inventory, and alert rules from the database.
Re-enroll the same host
If you want to reinstall the agent on this host without going through a new registration:
- Answer N to all data/config removal prompts during uninstall (Linux), or skip the
rm -rfcommands (macOS). - Reinstall the agent binary.
- The agent will reconnect using the saved
agent_id,agent_key, andca.pem— no new registration token needed.
If you removed the config directory, you will need to create a new host in the dashboard and run the register command with a fresh token.