Content in this post is a follow-up of How To install Docker on Raspberry Pi (Debian-based OS)
Table of Contents
Step 1: Open a terminal window on your Raspberry Pi
Step 2: Pull the Portainer image from Docker Hub
sudo docker pull portainer/portainer-ce:linux-arm64
Step 3: Run the Portainer container
sudo docker run -d -p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data portainer/portainer-ce:linux-arm64
This command will start a Portainer container and map port 9000 on your Raspberry Pi to port 9000 on the container. It also creates a named container called “portainer” and makes sure it always restarts in case of a system reboot or any other issues.
Additionally, it is also mounting the Docker socket, which is required for Portainer to communicate with the Docker daemon.
Access and Setup Portainer
Step 4: Open a web browser and navigate to http://[Raspberry Pi IP]:9000
Step 5: You will be prompted to set a password for the admin account. After setting the password, you will be taken to the Portainer dashboard.
Step 6: You can now use Portainer to manage your Docker containers and images on your Raspberry Pi.
Note: If you want to access the portainer webui from outside your local network, you have to forward port 9000 on your router to your raspberry pi IP (not recommended).
You have successfully installed and configured Portainer on your Raspberry Pi. You can now use Portainer to manage your Docker containers and images on your Raspberry Pi.