Skip to content
logo9minuti120x48
Menu
  • Home
  • Tutorial
    • Zaini
    • Stampa 3d
    • ebook
    • Informatica
  • Scritti
    • Racconti
    • Articoli
    • Temi
    • Storia
  • Video
  • Progetti
    • Progetto Carcere
    • Progetto Istruzione
    • Progetto Acque pulite
    • Progetto Tecnologia
    • Progetto Casa
    • Progetto Democrazia
    • Progetto Immigrazione
    • Storia
    • Progetto Storia
  • Chi siamo
    • LinkTree
  • Privacy Policy
    • Cookie Policy (EU)
  • Blog
  • Donazioni
Menu
update portainer cover 1024

How to update Portainer container (easy way)

Posted on 9 Giugno 2020 by Alessandro Oppo

 

Updating your Portainer server it’s pretty easy if you follow this tutorial.

I suppose you didn’t use docker-compose if you don’t know what it is don’t worry, I’ve written both solution in this tutorial.

Before you start go on Portainer web interface Containers>Portainers and check the Volume section.

portainer data

Be sure that you have the portainer_data to /data, otherwise, you are going to lose all your container configurations.

How to stop and delete the Portainer container

Open your terminal and write

sudo docker ps

Now you’ll see all the containers that are running.

docker ps

We need to stop the portainer/portainer container. Your CONTAINER ID is gonna be different from mine, so change it.

You don’t have to write all the id, the first three numbers are enough.
sudo docker stop 498

It should print the same number.

Now we need to remove the container using the rm command.

sudo docker rm 498

Also here it should print the same number.

How to remove and update the Portainer image

Now we need to remove the old image of Portainer. I have seen some tutorials where they don’t do it but they were not working for me.

sudo docker image ls

docker image ls

Now you need to do the same thing but with the IMAGE ID.

sudo docker image rm 2869 --force

docker image rm

Now we can finally run again the Portainer container. Since we deleted the old image it’s going to download the latest one from docker.

We just need to run the same command that we run during the first installation

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

Now your Portainer web interface should be again accessible and updated.

If you successfully updated your Portainer container please leave a message here or vote the tutorial, so I can now if it’s still working or not.

Update Portainer using docker compose

If you are using a docker-compose.yml file like this one you it should be easier to manage everything.

version: '2'

services:
  portainer:
    image: portainer/portainer-ce:latest
    command: -H unix:///var/run/docker.sock
    restart: always
    ports:
      - 9000:9000
      - 8000:8000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

volumes:
  portainer_data:

If these commands don’t help you can follow the previous instructions about how to delete the old image and download the new one.

sudo docker-compose down
sudo docker-compose up -d

If you can’t update Portainer leave a message and I’ll try to help you.

 

Dammi un 5 virtuale, clicca like e condividi.

  • Fai clic qui per condividere su LinkedIn (Si apre in una nuova finestra) LinkedIn
  • Fai clic per condividere su Facebook (Si apre in una nuova finestra) Facebook
  • Fai clic per condividere su X (Si apre in una nuova finestra) X
  • Fai clic qui per condividere su Reddit (Si apre in una nuova finestra) Reddit
  • Fai clic per condividere su WhatsApp (Si apre in una nuova finestra) WhatsApp
  • Fai clic per condividere su Telegram (Si apre in una nuova finestra) Telegram
  • Fai clic per inviare un link a un amico via e-mail (Si apre in una nuova finestra) E-mail

Related

16 thoughts on “How to update Portainer container (easy way)”

  1. testing2 testing2 ha detto:
    16 Gennaio 2021 alle 1:23 pm

    last command doesn’t install the CE version of docker

    Rispondi
    1. Alessandro Alessandro ha detto:
      18 Gennaio 2021 alle 8:32 am

      What do you mean? The last command is the one that install Portainer on Docket… maybe I’ll update the tutorial with the docker compose version.

      Rispondi
    2. adaragao adaragao ha detto:
      23 Febbraio 2021 alle 11:17 am

      just add “-ce” at the end of that command

      Rispondi
  2. aks aks ha detto:
    10 Marzo 2021 alle 6:16 pm

    Specifically, in the last docker run command, change the “portainer/portainer” that specifies the image that will be used to “portainer/portainer-ce:latest”.

    One should also make sure what is used for the second volume mapping argument, i.e. “portainer_data:/data” in this case, matches what the current portainer volume mapping setup is. You find that information in the portainer container details in your current running Portainer interface. Referring back to what one did “in the first installation” is likely impossible.

    Rispondi
    1. Alessandro Alessandro ha detto:
      12 Marzo 2021 alle 6:16 pm

      Thanks, I’ve updated the tutorial!

      Rispondi
  3. Graham Graham ha detto:
    24 Maggio 2021 alle 5:03 pm

    Thanks , as this worked so well,first time of trying!
    Could I be as bold to ask if you could advise on the best way to update nextcloud which is running on raspberry pi in docker

    Rispondi
    1. Alessandro Alessandro ha detto:
      29 Maggio 2021 alle 2:39 pm

      Hello, glad that it worked and thank you for the feedback.

      About NextCloud it should be possible to update it from the web interface, otherwise you could use Watchover.

      Rispondi
  4. Graham Graham ha detto:
    29 Maggio 2021 alle 5:32 pm

    Thanks for reply,I did try to update nextcloud using updater in web interface nothing happened!

    I will try using watchover, should I run docker command or docker compose?
    Apologise for my ignorance,I am learning bit by bit!
    Thanks again

    Rispondi
    1. Alessandro Alessandro ha detto:
      29 Maggio 2021 alle 3:52 pm

      Don’t worry, docker at the beginning is a bit hard.

      For watchover just use the docker run command that it’s provided on their github. It’s just a container that pulls new images.

      Rispondi
    2. Alessandro Alessandro ha detto:
      19 Giugno 2021 alle 1:45 pm

      Sorry for my late reply. You can installa watchover with the docket run command they have on their docker hub page. Don’t worry, docker at the beginning it’s a bit hard.

      Rispondi
  5. Glenn Glenn ha detto:
    1 Luglio 2021 alle 12:46 pm

    Thank you for making this easy Alessandro! Great tutorial. I’m learning Docker as well. It seems like it has an interesting learning curve 🙂

    Rispondi
    1. Alessandro Alessandro ha detto:
      1 Luglio 2021 alle 11:30 am

      I’m glad that it worked and thank you for the feedback! Yeah, docker is a bit hard at the beginning, but you’ll learn a lot.

      Rispondi
  6. jack macdonald jack macdonald ha detto:
    1 Ottobre 2021 alle 2:54 am

    Worked exactly as expected. Thanks very much.

    Rispondi
  7. Rob Moerland Rob Moerland ha detto:
    19 Ottobre 2021 alle 7:07 pm

    Since my parameters for portainer are slightly different than usual, a script called start-portainer.sh always has the docker run command. That way I never forget how to restart it after the upgrade. For which I use this post 🙂

    Rispondi
  8. Dennis Aker Dennis Aker ha detto:
    13 Febbraio 2022 alle 1:12 am

    Worked great for me updating to 2.11.1 not using the docker-compose option. Thanks !!

    Rispondi
    1. Alessandro Alessandro ha detto:
      18 Luglio 2022 alle 4:13 pm

      Glad to know, thanks for the feedback!

      Rispondi

Rispondi a testing2Annulla risposta

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

Scoprici sui social

  • YouTube
  • Telegram
  • Facebook
  • RSS Feed

    Ultimi post

    • Dave dei Vallanzaska: AI, Milano e venti di guerra – Riflessioni su 30 anni di cambiamenti
    • Libri e Social: Intervista a Sam di Rivista Matrioska | Come Creare un Progetto Culturale Online
    • Solo l’occidente conosce la Storia? Dialogo col Professor Adolfo Scotto Di Luzio
    • Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?
    • Siamo quel che facciamo? – racconto breve
    • Il limite è sempre la mente – Racconto breve
    • L’ultimo giorno del carcere – Racconto breve

    Newsletter

    • YouTube
    • Facebook
    • Telegram
    • Dave dei Vallanzaska: AI, Milano e venti di guerra – Riflessioni su 30 anni di cambiamenti
      di Alessandro Oppo
    • Libri e Social: Intervista a Sam di Rivista Matrioska | Come Creare un Progetto Culturale Online
      di Alessandro Oppo
    • Solo l’occidente conosce la Storia? Dialogo col Professor Adolfo Scotto Di Luzio
      di Alessandro Oppo
    • Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?
      di Alessandro Oppo
    • Siamo quel che facciamo? – racconto breve
      di Alessandro Oppo

    ©2025 9minuti | Design: Newspaperly WordPress Theme
    Manage Cookie Consent
    Usiamo cookie per ottimizzare il nostro sito web ed i nostri servizi.
    Cookie funzionali Sempre attivo
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Gestisci opzioni Gestisci servizi Gestisci {vendor_count} fornitori Per saperne di più su questi scopi
    Visualizza preference
    {title} {title} {title}
     

    Caricamento commenti...