How to Install Portainer on a Raspberry Pi!

  • Post author:WunderTech
  • Post published:August 30, 2020
  • Post last modified:November 2, 2022
  • Post category:Raspberry Pi
  • Reading time:7 mins read
  • Post comments:34 Comments

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

How to install Portainer on a Raspberry Pi is very simple, but we will be using Portainer in future tutorials to set up 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 CPUs, and 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.

The links below are Amazon affiliate links which means that I earn a percentage of each sale at no cost to you. Thank you for your support.

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.

How to Install 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
how to install portainer on a raspberry pi - command to update and upgrade raspberry pi os

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
command to install docker

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

sudo usermod -aG docker pi
mody permissions for docker user

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
download the latest portainer image

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
create the portainer command using the container downloaded

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 - accessing the portainer web gui

7. Select Local and Connect.

portainer raspberry pi - local docker environment

8. You should now be connected to Portainer!

portainer raspberry pi web interface

Conclusion – How to Install Portainer on a Raspberry Pi

This tutorial showed how to install Portainer on a Raspberry Pi. This is a pretty straightforward 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.

There are so many Docker containers that you can run, and a Raspberry Pi is a perfect little, low powered home server. You’ll be amazed at how much it can handle and in a future video, I’ll be showing how adding multiple containers to your Raspberry Pi is easy and straightforward way.

If you have any questions on how to install Portainer on a Raspberry Pi, please leave them in the comments of the YouTube video above. Stay tuned to see what containers we will be adding to our Raspberry Pi using Portainer! Thanks for reading!

WunderTech

WunderTech is a website that provides tutorials and guides on various NAS, server, networking, and infrastructure-related topics. WunderTech is maintained by Frank Joseph, an IT professional with 14+ years of experience in corporate IT and application management. He focuses on sharing his experience with others on his WunderTech website and YouTube page. Frank holds a Bachelor of Science in Computer Information Systems and a master of Business Administration (MBA).

This Post Has 34 Comments

  1. David

    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. WunderTech

      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.

  2. Alex

    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. WunderTech

      Thank you for sharing!

  3. Noor

    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. Noor

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

      1. WunderTech

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

  4. Anthony Park

    Hi,

    when I try following these steps:

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

    I’m receiving:
    pi@HyperBian:~ $ 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. WunderTech

      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?

  5. Peter

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

    1. WunderTech

      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!

  6. Oscar

    I figures it out, I didn’t get it to work with the first suggestion in the guide you linked to. I had to dig a bit deeper and find this guide: https://medium.com/@gauravsj9/how-to-install-specific-docker-version-on-linux-machine-d0ec2d4095

    Then I could install the latest available version of 19. These are the steps I used:

    I had to find the version to use:
    sudo apt-cache policy docker-ce

    and for me it was 5:19.03.14~3-0~raspbian-buster

    Then I could do:

    sudo apt-get install docker-ce=5:19.03.14~3-0~raspbian-buster

    Note: Remember to remove the old version you had. Instructions in this guide: https://medium.com/@gauravsj9/how-to-install-specific-docker-version-on-linux-machine-d0ec2d4095

    Then the rest of this guide worked perfectly!

    1. WunderTech

      Awesome! Thanks so much for sharing the solution!

  7. Oscar

    Hi,

    I have the same problem as Thomas, sadly I can’t seem to get around it. I have a fresh install using this guide and I chose to install a specific version of docker using the guide you posted in the latest comment. But I still get the same problem sadly.

    I have had any time to look into it?

    /Oscar H

  8. Thomas

    Thanks for your help and the link. I will look into the details in the link.

  9. Thomas

    The container seems to be working and it is Docker version 20.10.1. I tried the hello world and the this docker run -it ubuntu bash. See more info below:

    Client: Docker Engine – Community
    Version: 20.10.1
    API version: 1.41
    Go version: go1.13.15
    Git commit: 831ebea
    Built: Tue Dec 15 04:35:27 2020
    OS/Arch: linux/arm
    Context: default
    Experimental: true

    Server: Docker Engine – Community
    Engine:
    Version: 20.10.1
    API version: 1.41 (minimum version 1.12)
    Go version: go1.13.15
    Git commit: f001486
    Built: Tue Dec 15 04:33:02 2020
    OS/Arch: linux/arm
    Experimental: false
    containerd:
    Version: 1.4.3
    GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
    runc:
    Version: 1.0.0-rc92
    GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
    docker-init:
    Version: 0.19.0
    GitCommit: de40ad0

    pi@raspberrypi:~ $ sudo docker run hello-world
    Unable to find image ‘hello-world:latest’ locally
    latest: Pulling from library/hello-world
    4ee5c797bcd7: Pull complete
    Digest: sha256:1a523af650137b8accdaed439c17d684df61ee4d74feac151b5b337bd29e7eec
    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!
    This message shows that your installation appears to be working correctly.

    When i try to access Portainer in a browser, using http://192.168.86.9:9100/ it gives the message: This site can’t be reached 192.168.86.9 refused to connect.

    . . .and the IP is ok . . .
    pi@raspberrypi:~ $ ping 192.168.86.9
    PING 192.168.86.9 (192.168.86.9) 56(84) bytes of data.
    64 bytes from 192.168.86.9: icmp_seq=1 ttl=64 time=0.192 ms

    How do I downgrade, if you think that is the solution?

    1. WunderTech

      That’s a great question. My Raspberry Pi is packed away right now (I’m in the process of moving), but you’re probably better off uninstalling Docker and reinstalling it using an older version.

      This thread should show you how to do it (I’m sorry that I can’t test it): https://forums.docker.com/t/how-can-i-install-a-specific-version-of-the-docker-engine/1993

      With that said, you also have the option of waiting a little while and running periodic updates to see if the issue is resolved in a newer version.

      Sorry for the somewhat empty response. I wish I could provide further details, but if there’s anything I can do to help, please let me know!

  10. phil

    When trying to create the container to hold Portainer using the command above I get the following error

    WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
    7ea9b314c564c8be6cd1f649e9537d30379a802595f3963ae01195d64d8ed6a8

    I’m using Docker Version: 20.10.1 Raspbian v10 (buster)

    1. WunderTech

      From what I’m reading, this is a new issue caused by Docker 20.10. Does the container work properly? Or does it throw that error and then never start?

      Let me know and we can continue troubleshooting!

  11. Thomas

    I have a Raspberry Pi4 (ARMv7) and follow your instruction but get an Waring/error. Do you have any ideas on how to fix this? See the copy from the terminal window below:NB: I want to use e.g. port 9100 since I use port 9000 for something else:

    pi@raspberrypi:~ $ sudo docker pull portainer/portainer:linux-arm
    linux-arm: Pulling from portainer/portainer
    Digest: sha256:9366dcbe948ad8ca977b0e31507a4b138837bb480ef78e9ee8bfe0101d4fcf63
    Status: Image is up to date for portainer/portainer:linux-arm
    docker.io/portainer/portainer:linux-arm

    pi@raspberrypi:~ $ sudo docker run –restart always -d -p 9100:9100 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:linux-arm
    WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
    03737d9f6e7bf62a23d653880a6f0a40e82bc63d7be84cc46c66fb057ca86e63

    1. WunderTech

      From what I’m searching, this is a “new” error for a lot of people running Docker on a Raspberry Pi. Are you running Docker 20.10 by any chance? I am thinking that downgrading might be the only temporary solution. Does everything work or it won’t continue the install?

      Let me know and we can continue troubleshooting!

      1. Bruno Georges

        I had the same message. It still started and I could connect without problems.

  12. Alvin Crown

    Hi – Not able to “navigate to the IP address of your Raspberry Pi and port 9000 to access Portainer”.

    Using browser I get error
    “This site can’t provide a secure connection192.168.1.125 sent an invalid response.
    ERR_SSL_PROTOCOL_ERROR”.
    Solution was to use http:// rather than https://

    1. WunderTech

      You are correct – I have a habit of typing https so I apologize for the mistake. I have updated the tutorial to reflect this. Thanks so much for the feedback!

  13. Dan

    Couple of things:-

    1) should you update your steps for portainer 2.0 / portainer-ce

    2) I get a dpkg error Code 1 at the end of The “ curl -sSL https://get.docker.com | sh” script

    1. WunderTech

      Thanks for reading!

      1. I have been restraining from updating the the documentation to Portainer 2.0 because I’ve had a lot of problems with it on my Raspberry Pi. I don’t want to indirectly break any of the containers that people might have running, so until I can isolate what my issues are, I am holding off on updating the documentation.

      2. What error are you receiving?

      Let me know and we can continue troubleshooting!

      1. Kevin

        I also got the error Dan is describing and I think because of that when I try the command “sudo docker pull portainer/portainer:linux-arm” I get “Cannot connect to the Docker daemon at ect ect is the docker running?”

        1. WunderTech

          That’s definitely a weird issue and I’m not entirely sure why it’s happening. It almost sounds like Docker isn’t running. Does Docker install properly? If it does, can you try and run this command and see if it works?

          service start docker

          Let me know and we can continue troubleshooting!

    2. Badger

      Had the exact same problem, and it ended up being solved by updating my Raspberry Pi (3B+). “rpi-update”

      1. przemek

        Worked for me, too! Thanks!

  14. DJ

    i ran all commands successfully or so i thought. nothing happens when i pull up the ip address for portainer can you help?

    1. WunderTech

      Did you receive any errors during the installation process? If not, are you willing to start from a fresh micro SD card to try again? It’s tough to troubleshoot since there aren’t that many commands, but if you received specific errors, we can look into those errors.

      Let me know and we will continue troubleshooting!

  15. Domenick

    Will Portainer work well on a Synology NAS?

    1. WunderTech

      Portainer does work on a Synology NAS. I set it up a while ago but noticed that I wasn’t really using it so I removed it. If I get some time, I will look into some of the features it offers that the Synology Docker GUI doesn’t. Thanks for checking out the tutorial!

Leave a Reply