Skip to content

Instantly share code, notes, and snippets.

@starbuck93
Last active March 28, 2022 14:48
Show Gist options
  • Save starbuck93/821ce02224c38f8c8944664fbf5f00d4 to your computer and use it in GitHub Desktop.
Save starbuck93/821ce02224c38f8c8944664fbf5f00d4 to your computer and use it in GitHub Desktop.
Update to the latest Portainer CE using docker commands
#!/bin/bash
#Assuimg your current Portainer container name is simply "portainer"
docker stop portainer
docker rm portainer
docker image ls | grep portainer | awk '{print $3}' | xargs -I {} docker image rm {}
docker pull portainer/portainer-ce:latest
docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment