Ports of your call – How to setup docker with Portainer and as unprivileged user on a Raspberry (Linux)
Be it HomeAssistant, mosqitto, NodeRed – I use docker to run them on a Raspberry and thanks to Portainer I can manage them with a a nice WebUI. It has been some time I set it up and as needed it again and had forgotten some of it I decided to make a short todo list to remember it for the next time 🙂
Access the console of your Pi – locally or remotely. I am using Putty to connect to it from a Windows maching and logged in.
Run docker install script or go to https://docs.docker.com/engine/install/raspberry-pi-os/#install-using-the-convenience-script
“curl -sSL https://get.docker.com | sh”
Allow current user to use docker without sudo: https://docs.docker.com/engine/install/linux-postinstall/
“sudo groupadd docker”
“sudo usermod -aG docker $USER”
Install Portainer: https://docs.portainer.io/start/install-ce/server/docker/linux
“docker volume create portainer_data”
“docker run -d -p 8000:8000 -p 9443:9443 –name portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest”
After this concludes successfully you can access the Portainer WebUi with <IP>:8000. Set a password for the admin user and you are good to go.
If you forgot the password for it just delete the portainer container and its volume, recreate it and pull the container image again and you can set it.
You can run docker on a Raspberry Pi Zero, but there’s no Portainer image for this architecture (linux/arm/v6).