Bobcares

Pihole Docker Portainer | Installation & Setup Guide

by | Jun 4, 2022

Pihole Docker Portainer can be easily set up with this quick guide by your side. 

At Bobcares, we offer solutions for every query, big and small, as a part of our Docker Hosting Support Services.

Let’s take a look at how our Docker Support Team is ready to help customers with setting up Pihole Docker Portainer.

What is Pihole Docker Portainer

Pihole offers adblocking services for home as well as small networks. In other words, it blocks known ad serving domains. Furthermore, it can block network requests to untrustworthy domains, especially if the domain name is present in any block list.

It also puts together statistics to offer a better perspective of what is going on in our network. Usually, we do not have access to their information since it is hidden in the router’s web interface. Even if we have access to the router logs, the data is not in a user-friendly format.

Originally, Pihole was meant to run on Raspberry Pi. However, currently, it is supported on different hardware platforms. Today we are going to install Pi-hole on Raspberry Pi via Docker and Portainer. Pihole Docker Portainer installation involves the following steps:

  • Install Docker on Raspberry Pi
  • Install Portainer on Docker
  • Set up Pi-hole via Portainer

Step 1: Install Docker on Raspberry Pi

To begin with, we have to run the following command:

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

Alternatively, we can run docker without the above command via sudo by adding default Raspberry Pi user pi to the docker group.

sudo gpasswd -a pi docker

Then, we have to log out and reboot Raspberry PI to allow the group change to take place.

Step 2: Install Portainer on Docker

  1. Run the following commands to install Portainer:
    docker volume create portainer_data
    docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --restart always portainer/portainer
  2. Then verify if Portainer is running with this command:
    docker ps
  3. Then head to the Portainer web administration page. For example, if Raspberry Pi is at 192.168.1.10, head to http://192.168.1.10:9000.
  4. Next, set up an admin user when we open Portainer for the first time.
  5. After logging in, we have to select Local and choose Connect as seen below:

    Pihole Docker Portainer

Step 3: Set up Pi-hole via Portainer

  1. First, click Containers and then select the Add Container button in the left navigation panel.
  2. Next, enter a name for the new Pihole container and specify the Docker image as pihole/pihole:4.1_armhf.
  3. After that, stick to the default bridge network mode and add 80, 443, 53 as TCP, and 53 as UDP ports manually.
  4. Then, click the Volume tab under Advanced Container Settings.
  5. Next, do not change the values in the Container field.
  6. After that, head to Network options. Here the default is bridge mode. We can also enter a hostname for the device.
  7. Then, enter the DNS server as the Docker container and localhost as the primary DNS server.
  8. At this point we have to set the following environment variables:

    Pihole Docker Portainer Environment variables

  9. Now, we have to select the Restart Policy tab and click Unless Stopped.
  10. Then, select Deploy the container. This will cause Pihole to be up and running in a short while.

According to our Support experts, we can view the admin page by heading to http://192.168.1.10/admin (depending on the location of the Pihole server) . We can easily log in via the web admin password we set above.

[Need assistance with a different issue? We are available 24/7.]

Conclusion

In a nutshell, our skilled Support Engineers at Bobcares took us through the Pihole Docker Portainer installation.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF