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 stop Portainer
$ docker rm 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

Now your Portainer container is rebuild with the latest image.


    1. Mauricio López

      Hey Pieter,
      The procedure is exactly the same:

      docker pull portainer/portainer-ce
      docker stop portainer && docker rm portainer
      docker run -d -p 8000:8000 -p 9000:9000 –name=portainer –restart=unless-stopped –privileged -v “/var/run/docker.sock:/var/run/docker.sock” -v portainer_data:/data portainer/portainer-ce


      Thank you for sharing!


Leave a Reply

Your email address will not be published. Required fields are marked *