Setting up a new machine - Cheatsheets
Updating and upgrading Ubuntu
1
sudo apt update -y && sudo apt upgrade -y
Install a clean installation of Docker
Remove previous/old Docker packages:
1
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
Run the official Docker Install Script
1
2
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
Install Portainer (optional)
Create a docker volume for Portainer:
1
docker volume create portainer_data
Install Portainer:
1
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Install Watchtower (optional)
Install Watchtower to auto-update containers
1
2
3
4
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower --interval 30
This post is licensed under CC BY 4.0 by the author.