How do I remove Portainer?
This will guide you through removing Portainer from Docker Standalone, Docker Swarm and Kubernetes environments.
Docker Standalone
1. Remove Portainer
Stop the Portainer container
To remove the Portainer server, first, stop the running Portainer container by executing the following docker stop command:
docker stop portainerDelete the Portainer container
Once the Portainer container is stopped, you can delete it using the following rm command:
docker rm portainerRemove Portainer Agents
Stop the Portainer Agent container
To remove the Portainer Agent, first, stop the running Portainer Agent container using the following docker stop command:
docker stop portainer_agentFor Edge Agents:
docker stop portainer_edge_agentDelete the Portainer Agent container
Once the Portainer Agent container is stopped, you can delete it using the following rm command:
docker rm portainer_agentFor Edge Agents:
docker rm portainer_edge_agentDocker Swarm
Remove the Docker Swarm stack
For Portainer deployments via Docker Swarm and deployed via the Portainer stack, which includes Portainer, Portainer Agent, and the agent network, can be deleted using the following command.
docker stack rm portainerRemove the Edge Agent service
If you are running Portainer Edge Agents, the service for this needs to be removed before removing the Docker Swarm stack.
docker service rm portainer_edge_agentRemove the Docker Swarm volume
The Portainer data volume can now be removed by running the following command.
Please note that this command will permanently delete your Portainer data volume.
docker volume rm portainer_portainer_dataKubernetes Deployment
Remove the Portainer namespace
Portainer deployments created via Kubernetes can be removed by deleting the Portainer namespace. This process is the same whether Portainer was deployed via Helm or YAML.
This will remove all resources under the Portainer namespace, including Edge Agents.
Please be aware that deleting namespaces in Kubernetes can result in the permanent loss of all resources within that namespace. Proceed with caution and ensure backups are in place if needed.
kubectl delete namespace portainerWas this helpful?