Update Portainer on Docker

Recently I received the notification that there was a new version for Portainer. Now I’ve most of my containers configured via docker-compose files, which makes it easy to upgrade. Yet never done it without docker-compose files.

If you have installed Portainer the way I’ve done it, like described here under. Than upgrading is quite easy. As all data is persistent, all you have to do is delete the container and recreate it with the new image.

$ docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9000:9000 --name="Portainer" -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

This can be done via docker pull <image>, followed up with docker stop <container_name> and than by docker rm <container_name>. Last but not least: recreate the new container:

$ docker pull portainer/portainer
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Already exists
860ebb866910: Pull complete
Digest: sha256:4ae7f14330b56ffc8728e63d355bc4bc7381417fa45ba0597e5dd32682901080
Status: Downloaded newer image for portainer/portainer:latest
docker.io/portainer/portainer:latest
$ docker stop Portainer
Portainer 
$ docker rm Portainer
Portainer 
$ docker run -d -p 8000:8000 -p 9000:9000 --name="Portainer" -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
1a554c03a01626ac64811b13aefd77788890aec18ebb953fdb5b287aff4aae5d
$

Now your Portainer container is rebuild with the latest image.