Install Docker and Portainer on Raspberry Pi 3B
Tags: raspberry-pi, dockerTable of Contents
- About Docker and Portainer
- Instructions to install Docker and Portainer
- Docker installation
- Portainer installation
- Reference
About Docker and Portainer
Docker might be a familar term. If this term is new to you, then Docker is a container management service. Dockers are pretty lightweight and have the ability to reduce the size of an application through a smaller footprint of the operating system and the application infrastructure.
Docker containers can be deployed anywhere, on any physical machines,virtual machines or also on the cloud.
Portainer is an opensource container management tool that can be used with Kubernetes,Docker or Docker Swarm. It allows anyone to deploy and manage containers with a userfriendly interface.
Instructions to install Docker and Portainer on Raspberry Pi
Docker installation
Ensure the Raspberry Pi software is upto date by running the below commands
sudo apt update && sudo apt upgrade
When the software update is completed successfully,we can then install docker through the below command.
curl -sSL https://get.docker.com | sh
When the script completes successfully we have to provide the pi account access to Docker.
sudo usermod -aG docker pi
NOTE: If you have configured a different user account replace pi in the above command with the account name
Portainer installation
When the user account has been added successfully , we will now download Portainer image from the Docker hub for ARM processor (which is suitable for Raspberry Pi)
sudo docker pull portainer/portainer-ce:linux-arm
We will now create a new container to run Portainer and configure it to run on port 9000.
If the port 9000 is already in use, please use a different port number in the below command.
sudo docker run --restart always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:linux-arm
Navigate to the IP address of the raspberry pi and port 9000 to access the Portainer admin console
http://[RASPBERRY_PI-<IP-ADDRESS>]:9000
Reference