Uninstall
This guide covers fully removing Kasm Workspaces from your environment. Follow the section that matches how Kasm was deployed.
Single- and Multi-Server
Use these steps to remove a Kasm installation that was deployed directly to a host using the Kasm installer.
Stop Kasm services
sudo systemctl stop kasm.service
sudo systemctl stop kasm-network-plugin.service
Remove the Kasm systemd service units
sudo systemctl disable kasm.service
sudo systemctl disable kasm-network-plugin.service
sudo rm /etc/systemd/system/kasm.service
sudo rm /etc/systemd/system/kasm-network-plugin.service
sudo systemctl daemon-reload
Remove Kasm session containers
sudo docker rm -f $(sudo docker container ls -qa --filter="label=kasm.kasmid")
If there are no session containers to remove, you will get an error that "docker rm requires at least 1 argument", which means that the command ran successfully.
Remove Kasm service containers
export KASM_UID=$(id kasm -u)
export KASM_GID=$(id kasm -g)
sudo -E docker compose -f /opt/kasm/current/docker/docker-compose.yaml rm
Remove the Kasm Docker network
sudo docker network rm kasm_default_network
Remove the Kasm sidecar Docker network plugin
plugin_name=$(sudo docker network inspect kasm_sidecar_network --format '{{.Driver}}')
sudo docker network rm kasm_sidecar_network
sudo docker plugin disable $plugin_name
sudo docker plugin rm $plugin_name
sudo rm -rf /var/log/kasm-sidecar
sudo rm -rf /var/run/kasm-sidecar
Remove the Kasm database Docker volume
sudo docker volume rm kasm_db_1.19.0
Remove the Kasm Docker images
sudo docker rmi postgres:14-alpine
sudo docker rmi kasmweb/nginx:latest
sudo docker rmi kasmweb/share:1.19.0
sudo docker rmi kasmweb/agent:1.19.0
sudo docker rmi kasmweb/manager:1.19.0
sudo docker rmi kasmweb/api:1.19.0
sudo docker rmi $(sudo docker images --filter "label=com.kasmweb.image=true" -q)
Remove the Kasm installation directory
sudo rm -rf /opt/kasm/
Remove Kasm user accounts
sudo deluser kasm_db
sudo deluser kasm
Kubernetes
Use these steps to remove a Kasm deployment installed with the Kasm Helm chart. helm uninstall removes the chart's managed resources but leaves a few items behind that must be cleaned up separately.
Uninstall the Helm release
helm uninstall {RELEASE_NAME} -n {NAMESPACE}
Remove the Kasm secret
The {RELEASE_NAME}-secrets secret holds the admin password, database password, and service tokens. It is not managed by Helm and is not removed by helm uninstall:
kubectl delete secret {RELEASE_NAME}-secrets -n {NAMESPACE}
(Optional) Remove the database PVC
If you used the built-in PostgreSQL database, the PVC backing it may still be present depending on your storage class's reclaim policy. List remaining PVCs and delete as needed:
kubectl get pvc -n {NAMESPACE}
kubectl delete pvc {PVC_NAME} -n {NAMESPACE}
Deleting the database PVC permanently removes all Kasm state, including user accounts, session history, and configuration. Back it up first if you may want to restore later.
Delete the namespace (nuclear option)
To clean up the secret, any leftover PVCs, and anything else still in the namespace in a single step, delete the namespace itself:
kubectl delete namespace {NAMESPACE}