How to Install Portainer on a Raspberry Pi!

Today we are going to look at how to install Docker and Portainer on a Raspberry Pi.

This process is very simple, but we will be using Portainer in future tutorials to setup different docker containers, so this will be the first thing we are going to look at. The Raspberry Pi 4 is pretty powerful for being as small as it is. Combine that with the fact that there are a ton of great docker containers that don’t require powerful CPU’s, running certain Docker containers on a Raspberry Pi becomes a great option for a lot of people.

The steps below will utilize a fresh install of the Raspberry Pi OS. If you aren’t sure how to do that, I have instructions here.

Required Hardware

Raspbery Pi 4: Docker and Portainer can be installed on older Raspberry Pi devices, but the Raspberry Pi 4 has more processing power than older devices which will lead to better performance.

Micro SD Card: Don’t need anything crazy here, just a good Micro SD card with enough storage space.

Raspberry Pi 4 Case: This is one of my favorite cases for the Raspberry Pi 4, but any case will do.

Power Supply: Needed to power your Raspberry Pi.

HDMI Cable: I generally SSH into my Raspberry Pi devices, so this is only required if you intend on connecting your Raspberry Pi to a display.

Instructions - Install Docker and Portainer on a Raspberry Pi

1. Ensure that your Raspberry Pi is up to date by running the commands below.

sudo apt update
sudo apt upgrade

P RPi1

2. The next thing we are going to run is the script to install Docker on our Raspberry Pi. Portainer is a GUI that manages Docker containers, so we need to ensure Docker is installed.

curl -sSL https://get.docker.com | sh

P RPi2

3. After the script completes, we need to give our Pi user account access to Docker.

sudo usermod -aG docker pi

P RPi3

4. After the user has been added, we are going to run a command to download the latest Portainer image for the ARM processor (which is what the Raspberry Pi uses).

sudo docker pull portainer/portainer-ce:linux-arm

P RPi4

5. Our final step is to create a new container that will run Portainer. If you are already using port 9000 on your Raspberry Pi for something else (this is unlikely), you will need to change the ports below.

sudo docker run --restart always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:linux-arm

P RPi5

6. You should now be able to navigate to the IP address of your Raspberry Pi and port 9000 to access Portainer. When you get there, create a username and password.

http://[RASPBERRY_PI_IP_ADDRESS]:9000

portainer raspberry pi

7. Select Local and Connect.

portainer raspberry pi

8. You should now be connected to Portainer!

portainer raspberry pi

Conclusion

This is a pretty straight forward process, but we will be utilizing it in future tutorials. I decided it was best to create a specific tutorial for this rather than installing Docker and Portainer on a Raspberry Pi in all future tutorials. If you have any questions, please leave them in the comments. Stay tuned to see what containers we will be adding to our Raspberry Pi using Portainer! Thanks for reading!

This Post Has 34 Comments

  1. depricated container.
    replace portainer/portainer with portainer/portainer-ce

    1. Funny you say that – I went in and updated that a little while ago because I am releasing a tutorial tomorrow that uses it! Thanks for the comment!

  2. Hi,

    when I try following these steps:

    curl -sSL https://get.docker.com | sh

    I’m receiving:
    [email protected]:~ $ curl -sSL https://get.docker.com | sh
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    More details here: https://curl.haxx.se/docs/sslcerts.html

    curl failed to verify the legitimacy of the server and therefore could not
    establish a secure connection to it. To learn more about this situation and
    how to fix it, please visit the web page mentioned above.

    Any ideas how to install via a different route?

    Thanks

    1. I haven’t seen that error in specific, but it’s definitely a weird one. Are you running a DNS server or something else that’s checking your traffic and allowing/rejecting the connection?

      That page is just a script that runs certain commands to install Docker. You can view the script here: https://get.docker.com/

      Since you will most likely have to run the same commands, I’m not sure you’ll have much success using a different method. Are you using a fresh install of the Raspberry Pi OS?

  3. Thank you so much for keeping this up to date! Lovely tutorial!
    I just wanted to suggest adding this: “docker pull portainer/portainer-ce:linux-arm64”
    for those of us running 64 bit raspberry os

    1. Oh and when deploying the image, change this last bit:
      -v portainer_data:/data portainer/portainer-ce:linux-arm64 <-

      1. Great points, thanks so much! I will try and get this updated this weekend!

  4. Kept getting an error when trying to connect to the local instance saying “cannot connect to docker daemon” on the rpi 4 running the latest raspbian-buster-lite

    Used

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

    thats listed on the portainer documentation instead and it worked like a charm.

    1. Thank you for sharing!

  5. Hey love your guide ok I am a total newb to all this stuff ok to my question I a slowly trying to figure out how to use a domain I purchased from godaddy and setup on cloudflare for the purpose of using it for a few programs main one is using it as the domain address for my mumble server and I am also wondering if I can use this to help me set up an email server citadel to be exact for rocket.chat because you can’t email invite people without it would appreciate any assistance with this I am a total newb so bear with me.

    1. Hello! With a purchased domain, you can expose any services that you’d like. There are better (reverse proxy) ways of doing it, but there multiple ways will work. I have a video on Cloudflare that might answer some of your questions.

Comments are closed.

Close Menu