121
Follow below steps.
- Install Docker related component.
- sudo apt-get update
- sudo apt-get install ca-certificates curl gnupg
- sudo install -m 0755 -d /etc/apt/keyrings
- Add repository
- # For Ubuntu
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg
- sudo chmod a+r /etc/apt/keyrings/docker.gpg
- echo \
- “deb [arch=”$(dpkg –print-architecture)” signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
- “$(. /etc/os-release && echo “$VERSION_CODENAME“)” stable” | \
- sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- # For Debian
- curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg
- sudo chmod a+r /etc/apt/keyrings/docker.gpg
- echo \
- “deb [arch=”$(dpkg –print-architecture)” signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
- “$(. /etc/os-release && echo “$VERSION_CODENAME“)” stable” | \
- sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- Install Docker
- sudo apt-get update
- sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Post configuration
- sudo groupadd docker
- sudo usermod -aG docker $USER
- sudo systemctl enable docker
- sudo systemctl start docker
- Test with Hello Word
- sudo docker run hello-world
- Create Docker Volume for Portainer
- docker volume create portainer_data
- Install Portainer
- 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:latest
- Access Portainer WebUI and complete the initial setup.
- https://localhost:9443
Reference:
https://ivonblog.com/posts/install-docker-engine-on-linux/
https://ivonblog.com/posts/portainer-installation/
https://earthly.dev/blog/portainer-for-docker-container-management/