Introduction
Docker is a powerful platform that allows you to deploy and manage applications inside containers – lightweight, isolated environments that can run anywhere. This makes experimenting, developing, and deploying applications easier and more consistent across different systems.
Portainer provides a simple web-based interface to manage Docker. With Portainer, you don’t have to rely entirely on terminal commands – starting, monitoring, and removing containers can all be done with just a few clicks.
Raspberry Pi, often known as a mini computer for learning and experimentation, can also be transformed into a fully functional mini server. By combining Docker + Portainer, your Raspberry Pi becomes a flexible environment for application deployment and container management.
In this guide, I’ll walk you step by step through the installation of Docker and Portainer on Raspberry Pi – from the initial setup to managing containers via a web interface.
Read more
- How to Install and Configure Snipe-IT Tool on Ubuntu / Debian
- How to Install and Configure GLPI 10 on Debian
- How to Install and Configure Microsoft SQL 2022 on Ubuntu 22.04 LTS
Update the system
First, make sure your Raspberry Pi system is up to date:
sudo apt update
sudo apt upgrade -y
Install some required tools:
sudo apt install -y curl vim
Install Docker on Raspberry Pi
Next, let’s install Docker using the official installation script:
curl -fsSL https://get.docker.com -o get-docker.sh
Run the script:
sudo sh get-docker.sh
If repository warnings appear, simply update again and re-run the script:
sudo apt update --allow-releaseinfo-change
sudo sh get-docker.sh
Once installation is complete, verify your Docker version:
docker --version
Now start and enable Docker so that it runs on system boot:
sudo systemctl start docker
sudo systemctl enable docker
Check the service status:
systemctl status docker
If the status shows Active (running), Docker is ready to use.
Install Docker Compose plugin
To manage multiple containers easily, we’ll install the Docker Compose plugin — a tool that lets you define and run entire applications using a single docker-compose.yml
file.
Install it with:
sudo apt install -y docker-compose-plugin
Check the version:
sudo docker compose version
If a version is displayed, the plugin has been installed successfully.
Install Portainer
Now let’s set up Portainer, the tool that gives you an intuitive web UI to manage your containers.
First, create a directory for Portainer:
mkdir -p ~/portainer
cd ~/portainer
Inside this directory, create a docker-compose.yml
file:
touch docker-compose.yml
vim docker-compose.yml
Paste the following content into the file:
services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: always
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
volumes:
portainer_data:
Save and exit, then start Portainer with:
sudo docker compose up -d
Verify the container is running:
sudo docker ps
If you see a container named portainer
, the installation was successful.
Access Portainer
Open your browser and go to:
http://<IP_RaspberryPi>:9000
On your first visit, Portainer will ask you to:
- Create an admin account.
- Choose a Docker environment to connect.
Once setup is complete, navigate to the Containers section in the left menu to view all running containers on your Raspberry Pi.
Conclusion
With just a few steps, you’ve successfully transformed your tiny Raspberry Pi into a mini container server powered by Docker and Portainer.
From here, you can easily deploy a variety of services such as Nextcloud, Home Assistant, Pi-hole, or even small-scale AI projects.
Think of this as just the beginning. With Docker and Portainer, your Raspberry Pi now has nearly endless possibilities — unlocking a whole new world of applications for you to explore.
Thanks you!!!