OPERATING SYSTEMSOS Linux

How to install Portainer on Ubuntu 20.04

Here is series of how to manages containers with tools like portainer and rancher on Docker, Docker swarm and Kubernetes. Here is part one how to install portainer on docker on Ubuntu 20.04 and add second node on management.

Commands:
sudo apt update && sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

docker repos:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

install docker
apt update & apt install docker-ce docker-ce-cli containerd.io

add user docker group:
sudo usermod -aG docker user

reboot

add docker-compose:
sudo curl -L “https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Setup portainer.io
cd ~/

create volume for portainer:
docker volume create portainer_data

launch portainer:
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

for agent only
docker run -d -p 9001:9001 –name portainer_agent –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent

Github to install docker
curl https://releases.rancher.com/install-docker/19.03.sh | sh

source

ubuntu download

Leave a Reply

Your email address will not be published. Required fields are marked *