Current Date:17 September, 2021

How to update Portainer on Docker to Version 2.0

You would have noticed a notification in the last week in Portainer saying a new version is available but how the heck do you install the update?

In the next five minutes I’ll show you how to update Portainer in Docker using the CLI.

When I initially installed Portainer, I followed the official documentation which was to run the following commands:

$ 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

How to update Portainer on Docker via CLI

  1. SSH into your docker server or instance
  2. We need to stop the running Portainer container first
$ docker stop Portainer
  1. Next we need to remove the Portainer Container
$ docker rm Portainer
  1. Next we need to pull the latest Portainer image
$ docker pull portainer/portainer-ce

You should get the following message if it was successful:

Status: Downloaded newer image for portainer/portainer-ce:latest
docker.io/portainer/portainer-ce:latest
  1. Now we create the container using the existing data volume
$ 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-ce

You will now be able to login to your Portainer container using your existing credentials and the message in the bottom left will disappear.

SUPPORT ME!

If you’d like to support TECHmarC, or if you’re using an adblocker, I ask you to consider whitelisting my website.

The ads displayed on this site help go towards keeping the website alive. I know its a small ask but every little contribution helps! You can also support me by Buying me a Coffee!

 

Buy me a coffeeBuy me a coffee