Raspberry Pi

How to install Portainer on Raspberry Pi

Portainer is an open-source universal container management tool used for managing and deleting your docker containers running on Raspberry Pi. A container is a program unit that combines application’s code and other dependencies. Thus, allowing the application to run at a faster rate from one computing environment to another. An image running on a docker environment is referred to as a docker container and thus is pretty helpful in terms of delivering high-level security and putting low overhead on your Raspberry Pi system.

In this tutorial, you will find the easiest way to install Portainer on Raspberry Pi.

Installing Portainer to the Raspberry Pi

The Portainer is a web GUI that manages docker containers, so you need to install docker first before installing Portainer on Raspberry Pi. Later on, you can easily use Portainer on your Raspberry Pi by accessing the dashboard on your device browser.

Follow the below step-by-step guidelines to install Portainer on Raspberry Pi:

Step 1: Update Packages

You must first ensure that your Raspberry Pi packages are updated, which you can confirm using the following command:

$ sudo apt update && sudo apt upgrade -y

This will update the packages on Raspberry Pi.

Step 2: Install Docker on Raspberry Pi

After updating the packages, you are good to install docker on your Raspberry Pi through the following command:

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

Step 3: Give user access to Docker

After installing docker on Raspberry Pi, you will also need to provide user the privilege to access the docker by executing the following command:

$ sudo usermod -aG docker pi

Make sure to use the correct username as in your case it will not be the same.

Step 4: Install Portainer on Raspberry Pi

With docker successfully setup on Raspberry Pi, you are pull out Portainer from the docker command given below:

$ sudo docker pull portainer/portainer-ce:latest

Step 5: Run Portainer

Now, you will need to tell the docker to run the Portainer by passing in some extra parameters through the following command:

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

Step 6: Accessing Portainer on Browser

With the above command successfully executed, you can now access the Portainer dashboard on any browser. It’s better to access the dashboard on the Raspberry Pi browser. You can use the address http://Pi-IPaddress to open up the Portainer dashboard on your browser.

In case, if you don’t know the IP address of your device, use the following command to find it.

$ hostname -I

Now at the installation page, add your username and password, then click on the “Create user” button.

This will open up the Portainer dashboard on your browser.

At this point, you have successfully installed Portainer on Raspberry Pi and you will be able to see your dock container on your home page. In case, if you don’t know how to use Portainer, you should visit the official website to gain some knowledge.

Conclusion

Portainer is a decent piece of software that gives you the freedom to add or delete your docker containers through web GUI easily. You can install it on your Raspberry Pi using the steps mentioned above that require installing docker on your device first, then use the docker command to install Portainer on Raspberry Pi. Once the installation is completed, you can easily access the Portainer dashboard on your system browser using the device’s IP address.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.