Setting up a Raspberry Pi as an ad-blocking privacy server (Privoxy)

Why do we need another ad-blocking server for Raspberry Pi? This one uses Privoxy to act as a ” non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk.”

Please follow these other tutorials in order:

  1. Install the OS onto your SD card

  2. Boot the Pi and configure it
    Don’t forget to change the default password for the ‘pi’ acccount!!!

  3. Verify that you can reach the Internet through your Pi: Execute


    to make sure that you can see the outside world.

Install Privoxy on your pi with the following command:

sudo apt-get install privoxy

Install Privoxy on the Raspbery Pi

Edit Privoxy configuration file as appropriate for your situation. I like to set the “hostname” and “enable-remote-toggle 1” settings since I run several servers at home and like to be able to toggle Privoxy on and off without logging into the server itself.

sudo vi /etc/privoxy/config

Search for “listen-address” and edit as appropriate. If you are using your Pi as a proxy for other computers, make sure that you change “localhost” to reflect the address of the interface that you want to listen on.

Edit the listen-address in the privoxy config file

Restart the Privoxy service with the following command:

sudo service privoxy restart

Restart Privoxy Service

Configure your web browser as appropriate to use the Privoxy server at the address you chose above, with the port 8118. Then, open a browser window and enter the address to go to the proxy configuration page. Here is what my screen looks like:

Privoxy Config web page

You will notice that my server name is “onion-pi” (as I configured the “hostname” setting in the config file above) with the IP address of The standard port for Privoxy to run on is 8118, though you can change that in the configuration file. I highly recommend reading through it at some point, and fine tuning your proxy to best suit your needs.

Once you have Privoxy running on your Raspberry Pi, the final step is to make it run at boot time. To do that, enter the following command:

sudo update-rc.d privoxy defaults

Install Privoxy to run at boot time

The final check is to reboot and make sure that Privoxy comes back up. You can do this by either going to the configuration web address, the shortcut to that address p.p or by checking from the command line with ps -ef|grep privoxy

CC BY-SA 4.0 Setting up a Raspberry Pi as an ad-blocking privacy server (Privoxy) by Geordon VanTassle is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

3 Responses to “Setting up a Raspberry Pi as an ad-blocking privacy server (Privoxy)”

Leave a Reply

%d bloggers like this: