Uninstall
Stop All Kasm services.
sudo /opt/kasm/current/bin/stop
Remove any Kasm session containers.
sudo docker rm -f $(sudo docker container ls -qa --filter="label=kasm.kasmid")
Note
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.16.1
Remove the Kasm docker images.
sudo docker rmi redis:5-alpine sudo docker rmi postgres:14-alpine sudo docker rmi kasmweb/nginx:latest sudo docker rmi kasmweb/share:1.16.1 sudo docker rmi kasmweb/agent:1.16.1 sudo docker rmi kasmweb/manager:1.16.1 sudo docker rmi kasmweb/api:1.16.1 sudo docker rmi $(sudo docker images --filter "label=com.kasmweb.image=true" -q)
Remove the Kasm installation directory structure.
sudo rm -rf /opt/kasm/
Remove the Kasm User Accounts.
sudo deluser kasm_db
sudo deluser kasm