Upgrade a Docker Swarm Deployment
Always match the agent version to Portainer Server version. i.e., while installing or upgrading to Portainer 2.6 make sure all the agents are also version 2.6.
Steps to upgrade Portainer and or Portainer agent deployed into Docker Swarm as a service.
Run the following on manager node of your docker swarm cluster
docker service ls
Make note of the service names for Portainer
To upgrade Portainer to the latest version, run the command below (You may need to replace Service Name portainer_portainer to match your setup)
docker service update --image portainer/portainer-ee --force portainer_portainer
To upgrade Portainer Agent to the latest version, run the command below (You may need to replace Service Name portainer_agent to match your setup)
docker service update --image portainer/agent --force portainer_agent
That will deploy the newest version of Portainer on your system, using the persistent data and upgrade the DB
Now you can go to http://your-server-address:9000 and login. You should notice that the bottom left corner looks different than it did before. There is no more update nag and the version is no longer shown next to the Portainer logo.