How to Update Portainer: Step-by-Step Instructions

How to Update Portainer: Step-by-Step Instructions

Let’s talk about Portainer, a fantastic tool for managing Docker containers. We’re going to keep it simple and show you how to update it to the latest and greatest version. Ready? Let’s go!

Before We Begin First, make sure you have these things:

  1. Portainer already installed and running.
  2. Access to the server or computer where you’ve got Portainer set up.
  3. The right permissions to do the update.

Step 1: Backing Up (It’s a Good Idea)

While updating usually goes smoothly, it’s smart to back up your Portainer data, just in case. Here’s how:

  1. Find where your Portainer data lives.
  2. Make a copy of the whole folder or select the important stuff like your Portainer database and config files.
  3. Keep these backup files safe.

Step 2: Stop and Remove the Existing Portainer Container

To update Portainer, you need to stop and remove the existing Portainer container. Perform the following steps:

  • Open a terminal or SSH into the server where Portainer is running.
  • Run the following command to stop the Portainer container:
docker stop portainer
  • Once the container is stopped, remove it using the following command:
docker rm portainer

Step 3: Pull the Latest Portainer Image

To update Portainer, you need to pull the latest Portainer image from Docker Hub. Follow these steps:

Run the following command to pull the latest Portainer image:

docker pull portainer/portainer-ce:latest

This command fetches the latest version of Portainer from Docker Hub.

Step 4: Start the Updated Portainer Container

Now that you have the latest Portainer image, you can start the updated container. Perform the following steps:

  • Run the following command to start the updated Portainer container:
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:latest

This command starts the Portainer container with the necessary parameters and mounts the Docker socket and Portainer data volume.

  • Wait for a few seconds to allow Portainer to start up properly.

Step 5: Verify the Portainer Update

Once the container is up and running, verify that the Portainer update was successful. Follow these steps:

  1. Open a web browser and access the Portainer web interface by visiting http://<your_server_ip>:9000.
  2. Log in using your Portainer credentials.
Published