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

Pinchflat – Channel Monitoring YouTube Downloader

Pinchflat is a self-hosted app for downloading YouTube content built using yt-dlp. It’s designed to be lightweight, self-contained, and easy to use. You set up rules for…

SearXNG – Internet Metasearch Engine

SearXNG is a free internet metasearch engine which aggregates results from more than 70 search services. Here is the Wikipedia page on how metasearch engines work. With…

Tandoor Recipes

Tandoor is powerful container that allows you to take control of your cooking. The main purpose for the application is to manage recipes but you can also…

Kanboard – Project Management Software

I orginally found this container after DBTech created a video for his deployment guide. I have been using the software for a few months now and really…

Manyfold – 3D Printing Model Manager

Manyfold is an open source, web application for managing your collection of 3D modeling file, particularly focused on 3D Printing models. Backstory time, a few months ago,…

WireGuard Server – VPN Docker Container

I have been running a WireGuard VPN Server inside a Docker Container for about 2 years now. I never did an article on it because it was…

Leave a Reply

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