Hi dear visitor, if you are using the Portainer I am sure sometimes you saw a message something like in the below picture:

As you can see, I have a notification that says the new version is available in 2.18.2, no worries we can handle that easily by using the below commands:
docker ps
docker stop portainer_ID
docker rm portainer_ID
docker rmi portainer/image: version
Now you can run that container without any changes regarding your data by using the below command:
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