Install Squidguard 1.4 On Debain 8 (Jessie)

(Last Updated On: 17 September 2016)

It is very useful to be able to block users on your network from accessing millions of websites with nefarious content. A great way to accomplish this is with a proxy server like Squid. Squid is a free and powerful proxy server that is capable of blocking users from accessing web content. A great way of enhancing Squid’s ability to block unwanted websites, domains and IP addresses is to install SquidGuard. SquidGuard is an add-on program for the Squid proxy server (see my previous article on Squid).

SquidGuard works with databases of blacklists to block, filter, and redirect requested URLs and domains. You manually download and add blacklist files to SquidGuard and compile them into the SquidGuard database, then Squid can redirect web requests, checking them against SquidGuard’s database of blacklisted websites, domains and IP addresses. It seems like this process would slow down a network, but SquidGuard is an extremely fast web content filter with the ability to check web requests against millions of blacklisted sites in a matter of seconds. There is great information about SquidGuard’s capabilities on the SquidGuard website, including links to download the program, well written installation and configuration instructions, and links to websites that maintain blacklists.

Make sure squid proxy has been installed. Installing Squid

Make sure BerkeleyDB 4.8 has been installed. Installing BerkeleyDB 4.8


Download and Configure SquidGuard

Download SquidGuard and patch file

Extract all the four files

Copy first patch

Copy second patch

Then compile it



The blacklists are the heart of every URL filter. Squidgurd supports both free and commercial distributions of blacklists on the net or create and use your own (or any combination of them). List of free databases:

  1. MESD blacklists (free).
  2. Shalla’s Blacklists (free for non commercial/private use).
  3. Urlblacklist (commercial)

Use wget command to download blacklists from as follows:

Sample outputs:

Untar tar ball, enter:

Sample outputs:

In this example, install porn blacklist as follows using the cp command:

Backup file /usr/local/squidGuard/squidGuard.conf

Edit file squidGuard.conf

Here is a sample configuration file:

Finally, create the database from text files as follows:

Set permissions so that squid can read the files using chown command:


Configure Squid

I’m assuming that Squid is installed and configured properly. Edit /etc/squid/squid.conf, enter:

You need to specify the location of the executable for the URL rewriter using url_rewrite_program as follows:

Finally, reload the squid proxy server:









Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.