How to install Docker and Portainer on Raspberry

Docker  an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

Portainer – powerfull portainer management tool. Deploy, configure, troubleshoot and secure containers in minutes on Kubernetes, Docker, and Swarm in any data center, cloud, network edge or IIOT device. 

Here are the steps how to install Docker and Portainer on the Raspberry Pi running Ubuntu 23.04


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sudo apt update -y
sudo apt upgrade -y
echo -e "Installing requirements on the host ..."
sudo apt install curl wget git -y
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update
apt-cache policy docker-ce

sudo apt install docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${user}

docker volume create portainer_data
docker volume inspect portainer_data

docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Once this is completed, open browser on your Raspberry Pi and navigate to http://Raspberry-IP:9000. You will be taken to the login page to Portainer where you can user the default credentials for initial login as as admin and create your password.

Once you sign in in upper left corner you will see an option to upgrade your Portainer into Business edition. It is a free upgrade and in my opinion worth upgrade. Just click there and complete a short form to receive your free license. You can click on the popup or you can go directly to PORTAINER.IO and request the license, it will cover 5 nodes and add few extra useful features.