Installation of Pi-Hole in a Jail on FreeNAS server

Excelent to be here. Place where I am shure can finde a answer to my qwestion.
And if I’m here… An Direct qwestion…

I wil gladly run the pi-hole on my internal network. I’m using FreeNAS on an HP ProLiant hardwarebox to serv my home network and als run it on smal bussines. ( Shares; storages; MediaServers; cloudservers… etc)
Nowe I had a qwestion from the bussines of is it posible to block som ads on the mobile phone of the bussines… Did som resarch and fiind the Pi-Hole a grate!
But have now problem…
FreeNAS is running on the FreeBSD ( an linux instances ) FreeNAS use a Jails to store and run instances of webbased software… FreeNAS version 9.10.2-U6 on FreeBSD version10
Made a Jail and loged on with root permisions. If I run command from yours website 'curl -sSL https://install.pi-hole.net | bash" I get error “Command not found” mostli installing software on Jails is command 'pkg install …'
Do you have an answer or the way to install pi-hole on FreeNAS Jail to run it?
Any help is great

Kind regards,
Niko Stjepanovic

We don’t currently support FreeBSD installations, but if that’s the only output of the command then I’d assume that curl is not installed.

@Mcat12: THNX foor your’s replay.
Curl is part of the Jail installation on FreeNAS

"root@PiHole:~ # curl -sSL https://install.pi-hole.net | bash
bash: Command not found.
curl: (23) Failed writing body (0 != 2759)
root@PiHole:~ # ls
.cshrc .history .k5login .login .profile
root@PiHole:~ # pkg info
alsa-lib-1.1.2 ALSA compatibility library
apr-1.6.2.1.6.0 Apache Portability Library
ca_root_nss-3.32 Root certificate bundle from the Mozilla Project
curl-7.55.0 Command line tool and library for transferring data with URLs"
You can see that version 7.55.0 of curl is running on the Jail.
after input of command is the output:

“root@PiHole:~ # curl -sSL https://install.pi-hole.net | bash
bash: Command not found.
curl: (23) Failed writing body (0 != 2759)”

Is there something els necesseri to run on jail like databas or webserver or…???

But always thnx.

Reading up, FreeNAS might not have bash installed default:

https://www.freebsd.org/doc/en/articles/linux-users/shells.html

Could try to pipe to sh instead eg:

curl -sSL https://install.pi-hole.net | sh

@deHakkelaar,

THNX a lot. It give me good direction.
Using given information and sugestions I try …

root@PiHole:~ # curl -sSL https://install.pi-hole.net | sh
Syntax error: word unexpected (expecting “)”)
curl: (23) Failed writing body (0 != 2759)

Not worked for FreeNAS of Jail

Have installed bash on the Jail and after tath give command …

"root@PiHole:~ # curl -sSL https://install.pi-hole.net | bash

    .;;,.
    .ccccc:,.
     :cccclll:.      ..,,
      :ccccclll.   ;ooodc
       'ccll:;ll .oooodc
         .;cll.;;looo:.
             .. ','.
            .',,,,,,'.
          .',,,,,,,,,,.
        .',,,,,,,,,,,,....
      ....''',,,,,,,'.......
    .........  ....  .........
    ..........      ..........
    ..........      ..........
    .........  ....  .........
      ........,,,,,,,'......
        ....',,,,,,,,,,,,.
           .',,,,,,,,,'.
            .',,,,,,'.
              ..'''.

:::
::: You are root.
OS distribution not supported"

Bad enough …
Need to search for another solutions or pi-hole wil try to mad adusmants to run also on FreeNAS and FreeBSD.

You’re going to run into issues with the installer not being able to install packages for FreeBSD because they use different packaging system.
And the installer probably cant cope with how services/daemons are managed on FreeBSD.
But I believe FreeNAS can run Docker.
If so , you could run a Docker Pi-Hole instance.
Quick google:

https://hub.docker.com/r/freenas/pi-hole/

freenas coral was a test, now it’s an abandoned project
anyway every docker image was lunching a vm of boot2docker

yes it still possible to run docker via VM on freenas
now they use rancher (which is way better :wink:

I also found this : https://protoxin.net/setting-up-a-freebsd-dns-adblocker/

not sure if you solved your problem by now but I just saw your post and wanted to tell you that it is possible to install pihole in a VM running on freenas.

I have installed a small VM running ubuntu server. gave it 512 mb ram and 1 core and I installed pihole in there without a problem.

Works like a charm!

The Pihole software is able to run on inside a virtual machine on a supported guest operating system (e.g. Debian) on a FreeBsd host (like FreeNas). This is route is based on virutualization. Once a FreeBsd port of the Pihole software is available Pihole can run inside a Iocage jail on e.g. FreeNas. Iocage jails are the default application container on FreeBsd, another application container is Docker. The major advantage of running Pihole inside an application container instead in a virtual machine is that application containerization has a smaller memory and CPU footprint.

I prefer application containerization over virtualization because of less resource requirements. My FreeNas host is under dimmensioned in memory. Please consider porting Pihole to FreeBsd.

The FreeNas plugin feature is a way of adding functionality to FreeNas in a user frendly way (no command line involved). Providing a FreeNas plugin for installing and configuring (e.g. adding mount points to the jail) would be the ultimate integration of Pihole in FreeNas. For me this would be a nice to have feature, the FreeBsd port together with a small howto install and configure Pihole on FreeBsd would be the minimum requirement.

Check the Feature Requests and see if there is one on your needs. If not, please open a new one.

None of the developers have any experience with BSDs so we’d need someone from that community to assist with porting.

2 Likes

I just got in a NanoPi R2S that I was hoping to get OpnSense on. So first step is FreeBSD 13 current to see if it even boots. No promises in any kind of way but I may be able to at least give you an answer of if Pi-hole on BSD is possible.

I'm wondering, did you ever successfully install it in iocage on FreeNAS? I'm also planning to do that.

Just in case it could be useful to anyone here, I managed to install Pi-hole on a thin Alpine Linux VM in FreeNAS/TrueNAS Core: Install on "non-supported" distro?