Tear down a kziti deployment
Overview
A kziti-managed OpenZiti host eventually reaches end of life, whether you are decommissioning a controller, retiring a private router, or rebuilding from scratch. This guide stops and removes a kziti-managed OpenZiti deployment from a host. You decide whether to keep the persistent OpenZiti state for a later reinstall or wipe the host clean. The procedure applies to single-controller setups, individual high availability (HA) members, and standalone private router hosts.
Prerequisites
Before you begin, confirm the following:
- Shell access to the host that runs the
kziti-managed OpenZiti deployment, with permission to runkzitiandsudo. - Any backups or exports of OpenZiti state that you need to keep, if you intend to delete the data directory. The warning below details the data this procedure can remove.
- Confirmation that the host is not a single HA member you intend to remove while the cluster keeps running. To remove one HA controller and keep the cluster online, follow Remove an HA controller instead. That procedure runs
remove-memberfirst, then teardown.
Solution approach
This guide progresses through the following phases:
- Choose a teardown scope.
- Stop the stack and optionally wipe persistent data.
- Remove the kziti binary.
Detailed steps
Choose a teardown scope
Decide how much state to remove before you run any command:
- Stop the stack only. Stops the containers and removes the Docker Compose project, but keeps the data directory. Choose this scope to reinstall on the same host or to inspect state offline.
- Stop and wipe. Stops the stack and deletes the persistent data directory, leaving the host clean apart from the
kzitibinary.
The --remove-data flag is destructive. It deletes the persistent OpenZiti state on the host, including the controller database, router certificates, and identity material. Confirm that you have any backups or exports you need before you run with this flag.
Stop the stack and optionally wipe persistent data
-
To stop the containers and remove the Docker Compose project while keeping the data directory in place, run the following command:
kziti deploy uninstall --yesThe data directory at
/opt/kziti/datais left intact. If you used a non-default--install-dir, the data directory is<install-dir>/data. -
To stop the stack and also delete the persistent data, run the following command instead:
kziti deploy uninstall --remove-data --yesThis command stops all containers, removes the Docker Compose project, and deletes the data directory. The host is left clean, and only the
kzitibinary remains onPATH.
Remove the kziti binary
To remove the kziti binary from the host as well, run the following command:
sudo rm /usr/local/bin/kziti
Common troubleshooting steps
- The data directory still exists after uninstall. The
kziti deploy uninstall --yescommand keeps the data directory by design. To delete it, rerun the uninstall with the--remove-dataflag. - The uninstall removed data you needed. The
--remove-dataflag permanently deletes the controller database, router certificates, and identity material. Restore from a backup or export taken before the teardown, askziticannot recover this state. - A single HA member was removed but the cluster is now unhealthy. Teardown alone does not remove a member from the cluster quorum. To remove one HA controller cleanly, follow Remove an HA controller, which runs
remove-memberbefore teardown. - The kziti command is still available after teardown. The uninstall commands do not remove the
kzitibinary. Runsudo rm /usr/local/bin/kzitito remove it fromPATH.