Portainer is an orchestrator of sorts for both Docker and Kubernetes. We will be focusing on the Docker side of things here in this post. Please be aware that this is my experience with Portainer on Docker and the defacto installation guide. There is already one of those at the Portainer.io site that you can use.
I do a lot of small computing by the way I am always looking for ways to get rid of my older clunky servers most of my docker and kubernetes clusters are on Raspberry Pi's. I have a cluster of 4 RPi's, then a 2 Clusters of Kubernetes, 1 is for Production the other is a PoC (Proof of Concept) build.
Just a side note: I am using a RPi4 8gb model b as my workstation there is an article here showing how to do this.
- OS installed on your VM/RPi4/Server - up to date & upgraded
- Docker-CE installed on your OS (I use Ubuntu Server)
- docker-compose (preferred)
- about an hour of time to play with your new install.
Let's get started!
- sudo mkdir -p projects
- sudo mkdir -p porjects/portainer
- ls -al projects/
you should see a list of files or empty dir.
- sudo touch projects/portainer/portainer-agent-stack.yml
- sudo nano -c projects/portainer/portainer-agent-stack.yml
copy and paste the following in that file
version: '3.2' services: agent: image: portainer/agent volumes: - /var/run/docker.sock:/var/run/docker.sock - /var/lib/docker/volumes:/var/lib/docker/volumes networks: - agent_network deploy: mode: global placement: constraints: [node.platform.os == linux] portainer: image: portainer/portainer-ce command: -H tcp://tasks.agent:9001 --tlsskipverify ports: - "9000:9000" - "8000:8000" volumes: - portainer_data:/data networks: - agent_network deploy: mode: replicated replicas: 1 placement: constraints: [node.role == manager] networks: agent_network: driver: overlay attachable: true volumes: portainer_data:
- ctrl x, y to save the file w/nano
- docker stack deploy -c portainer-agent-stack.yml portainer
- docker ps -a
note: you should see something similar to the following
d63a40841836 portainer/agent:latest "./agent" 6 days ago Up 6 days 0.0.0.0:9001->9001/tcp, :::9001->9001/tcp portainer_agent.vyr6y8y7eedpzyif4x57ulpv3.hy9k4ndk9b3z7ckhiky99u0yh
Now go to the http://ip.of.srvr:9000 type in the username: admin password: admin and change it immediately
At this point you should have a good Portainer instance installed. Very important to deploy on the manager/leader node.
If you need some help, Portainer has forums, slack, discord and github where you can submit your questions or you can ask me as well.
Thank you for your time and patience, we do appreciate it. Have a great day!