Docker Image: Portainer
1. What is Portainer
Portainer is a universal container management tool that can work with both Docker and Kubernetes to make the deployment and management of containerized applications and services easier and more efficient.
Portainer hides the complexity of managing containers behind an easy-to-use UI. By removing the need to use the CLI, write YAML or understand manifests, Portainer makes deploying apps and troubleshooting problems so easy that anyone can do it.
| Requires docker container support |
-
Original install doc can be found here.
2. Install Portainer Client
-
Install a
Portainerclient on any server that hosts docker. ThePortainerclient will allow for management via aPortainerserver. -
Start the container via one of the following:
-
Start via the docker command
-
Unix
sudo docker run -d -p 9001:9001 --name The-Portainer-Agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest -
Windows
docker run -d -p 9001:9001 --name The-Portainer-Agent --restart=always -v C:\:C:\host -v C:\ProgramData\docker\volumes:C:\ProgramData\docker\volumes -v \\.\pipe\docker_engine:\\.\pipe\docker_engine portainer/agent:latest
-
-
Start via the docker-compose command
-
Compose the start file
-
Unix
version: "3.5" services: # Define a Portainer agent portainer_docker_agent: image: portainer/agent:latest container_name: The-Portainer-Agent ports: - 9001:9001 volumes: - /var/run/docker.sock:/var/run/docker.sock - /var/lib/docker/volumes:/var/lib/docker/volumes restart: always -
Windows
-
-
Start the container
sudo docker-compose up -d
-
-
3. Install Portainer Server
-
Create a volume for the Portainer Server’s DB
sudo docker volume create portainer_data -
Start the container via one of the following:
-
Start via the docker command
sudo docker run -d -p 8000:8000 -p 9443:9443 --name The-Portainer-Server --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest -
Start via the docker-compose command
-
Create a
docker-compose.ymlfile with the following contents:version: "3" services: portainer: container_name: The-Portainer-Server image: portainer/portainer-ce:latest #command: -H tcp://tasks.agent:9443 --tlsskipverify ports: - 8000:8000 - 9443:9443 security_opt: - no-new-privileges:true volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - ./My-Portainer/data:/data -
Start the container
sudo docker-compose up -d
-
-
-
Open the Firewall for port 9443:
-
Navigate to the containers web page:
https://localhost:9443