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.

5 comments

    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

      Marcel,

      Thank you for sharing!

      Regards

    2. galih brilliantara

      i succesfully UPDATE to 2.0.1

      sudo su
      docker volume create portainer_data
      docker pull portainer/portainer-ce
      docker stop portainer && docker rm portainer
      docker run -d -p 8000:8000 -p 9000:9000 –name=portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Leave a Reply

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

Leave the field below empty!