RPI Docker
Posted by kll on February 10 2026 09:00:26
Docker for Raspberry Pi for adding web-services and other work environments the clean way
( i try on RPI3 and RPI4 )
after setup RPI4 like here
i use Docker for install a web-server NGINX
to serve my HTML / JS / Processing examples from Learn WEB
and to learn more about Docker
and to use it to keep a setup clean while handle test installations..
Extended Blog
prepare the RPI for use Docker
now 3 manual steps
* Docker
* Portainer
* Nginx
but if you are sure you need
* docker and
* web-tools and
* IOT tools
you might here start with IOT STACK to do it all menu-driven
curl -fsSL https://raw.githubusercontent.com/SensorsIot/IOTstack/master/install.sh | bash
but first time, here we do it manually:
Docker
to
install Docker
on RPI4 Desktop newest setup:
Update your system first
sudo apt update && sudo apt upgrade -y
Download and run the install script
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker $USER
so NOT need 'sudo' for docker commands
now can use alias dinfo in
nano .bash_aliases
dinfo='echo "___ INFO" && docker info && echo "___ CONTAINER" && docker ps --all && echo "___ IMAGES" && docker images && echo "___ NETWORKS" && docker network ls && echo "___ VOLUMES" && docker volume ls'
and for maintenance install
portainer
sudo docker volume create portainer_data
sudo 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:lts
try browser:
https://192.168.1.104:9443 ( accept risk... )
setup:
user: admin
pw: < adminpw> ( requires 12 char long )
well, for not forget that you have installed docker and portainer on your RPI4
better tell at every login via same .bash_aliases
a link like http://myIP:myPort
printed to terminal
* can be copied ( for remote browser ) or
* used to open local browser in desktop via context menu 'OPEN URL'

try
Docker CLI tutorial BASICS
after that understanding can try to use 'portainer' to create containers.
try:
[local (live) ]
[Templates] [Application]
...
now you see already many containers you could install,
but pls check:
[Settings]
[Add Templates]
URL https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/template/portainer-v2-arm64.json [enter]
and get all the good stuff for RPI
already do some initial setting in portainer
[Environments][details]
Name:
i change from local to RPI4
Public IP:
192.168.1.104
[Update Environment]
NGINX webserver Container CLI setup
if you need to test some web-work on local network need to run a web-server
prepare a user dir:
mkdir /home/pi/Projects/nginx/
cd /home/pi/Projects/nginx/
and make a
nano index.html
file in it ( containing minimal a text line ) .
setup docker NGINX web-server:
sudo docker run -it --restart unless-stopped -d -p 8080:80 --name web -v ~/Projects/nginx:/usr/share/nginx/html nginx
and call it from other network browser via:
http://192.168.1.104:8080/
for remote copy/edit of web-content ( index.html ... )
can use above SAMBA file share.
RPI via browser
while we are using this RPI4 headless from a PC
* remote SSH terminal
* remote VNC desktop
add now with the docker /
* portainer
* nginx
web services
we might want optional use also web services for OS operations,
not because it is better,
but if we play from some restricted device like a Chromebook / a smart TV / a android tablet
where we need to do ALL via a browser.
* a web-terminal
cockpit
sudo apt install cockpit
from browser try:
https://192.168.1.104:9090
see lots of info about your Pi,
and also a terminal
( but sadly some info pages just flicker ( refresh constantly? )
* a web-file-manager
filebrowser
sudo docker run -d --name filebrowser --restart=always -v /home/pi/Projects:/srv -v /home/pi/.filebrowser:/database -v /home/pi/.filebrowser:/config -e PUID=$(id -u) -e PGID=$(id -g) -p 8088:80 filebrowser/filebrowser:v2-s6
docker logs filebrowser
and find the default admin login password
http://192.168.1.104:8088
now after login in 'admin'
can set new password !must be 12 char long!
the good thing about container is you can play with many things without risking your setup system,
* get any image, like from
Docker Hub
* make a container
* * PLAY
* stop container
* delete container
* delete image
( via CLI or portainer )
and for real REMOTE ACCESS ( like VNC in Chrome browser )
use Raspberry Pi Connect