Upgrading on Docker Swarm
Always match the agent version to the Portainer Server version. In other words, when you're installing or upgrading to Portainer 2.7.0 make sure all of the agents are also on version 2.7.0.
To upgrade the Portainer Server and the agents on Docker Swarm, first run the following command on the manager node of your Docker Swarm cluster:
1
docker service ls
Copied!
Make note of the service names for Portainer. You will need them later.
1
ID NAME MODE REPLICAS IMAGE PORTS
2
tb9gtxc647fw portainer-agent_agent global 3/3 portainer/agent:latest
3
m3a3mtuy55ed portainer_portainer replicated 1/1 portainer/portainer-ee:latest *:8000->8000/tcp, *:9000->9000/tcp
Copied!
To upgrade Portainer Server to the latest version, run the command below (replace the portainer_portainer service name if your setup differs):
1
docker service update --image portainer/portainer-ee --force portainer_portainer
Copied!
To upgrade the Portainer Agent to the latest version, run the command below (replace the portainer_agent service name if your setup differs):
1
docker service update --image portainer/agent --force portainer_agent
Copied!
This will deploy the newest version of Portainer and the agent across your swarm and upgrade the Portainer database to match.
When this is finished, go to http://your-server-address:9000 and log in. You should notice that the update notification has disappeared and the version number has been updated.
Last modified 6d ago
Copy link