Portainer – Update to New Version

For people that followed my walk through on installing and setting up Docker, Docker Compose and Portainer on a new Ubuntu Server, I covered how to do the initial volume and container deployment of Portainer. The Portainer community pushes version updates to fix issues quite often and updating the container can be a little confusing. How do you update the management system that you use to manage the system itself…? Hopefully this will clear up any confusion.


How to know when to update?

When you login to the main Portainer Dashboard, if you look at the bottom left corner of the screen, you will see a “New version available” notification.

When you see this, its time to update!


Update Process

First thing we need to do is download the latest Portainer image.

Login to your current Portainer interface and navigate to “Images” on the left panel.

Locate the image that is currently being used. You will find this by looking at the “Tags” area and find “portainer/portainer-ce:latest”. Click on the “ID” to view details of the image.

At the top of the screen, in the “Image tags” area, click the “Pull from registry” button to download the latest version.

You will then be prompted on “Which registry do you want to use?”, the default “Docker Hub (anonymous)” is fine and click “Update”.

When it is finished downloading, you will see a pop up message in the top right corner of the screen.

You can now see your new image by clicking back to the “Images” screen and it will be listed at the latest tag but the ID will have a “Unused” flag next to it. You will also notice that the current version tag has switched to “none”.

Next we will need to redeploy the container while telling it to use the new version.


Redeploy Portainer Container

First we need to stop the old container. Login to a SSH session on the server you want to upgrade and execute the following command:

docker stop portainer

Then we need to remove the old container so it can be recreated with the new image. Don’t worry, all your settings will be saved into the volume which it will use to re-build the new container.

docker rm portainer

Lastly, we just need to execute the docker run command with all the information needed to rebuild the container.

docker run -d -p 8001:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Thats all there is to it. Now if you go back to the admin interface and login, you should see in the bottom left corner that you are on the new version.


Cleanup

There is a little bit of clean up that you will want to do after you are sure everything is working as expected.

You will need to go back into the “Images” menu and remove the old image to clean up space on your storage. You will find it by looking for the “Tags” which will be “portainer/portainer:none” and the “ID” will have the “Unused” flag next to it.

Related Posts

ByteStash – Code Snippet Organizer

This web application couldn’t have come along at a better time. At my full time job recently I have been doing a LOT of PowerShell scripting on…

Draw.io – Whiteboarding/Diagramming Web Application

I have been using Draw.io for a while now at work to build Flowcharts and Network Diagrams. For being a free to use tool in an online…

Trivy – Docker Image Vulnerability Scanning

Trivy, by Aqua Security, is a scanner application to find any vulnerabilities to better harden your network before you deploy applications. You can install it directly on…

AirTrail – Airline Flight History Tracker and Map

With all my recent travel, I thought this Application would be an good one to cover since I’ve been using it a lot recently. The timing on…

Nginx Proxy Manager – Reverse Proxy

I have been using Nginx Proxy Manager for a few years now. Not sure why it took me this long to write an article about it but…

Setup Uptime-Kuma to monitor Docker Containers

My recent move to NFS shared Docker volumes, which lead to life cycling some older systems, which lead to going back and updating a lot of side…

Leave a Reply

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