How to install and configure Squid Proxy in Ubuntu, Linux Mint

Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.

A proxy is necessarily a system that sits between your computer, and the computer you want to connect to. By using a proxy server, the web traffic runs through the proxy server on its way to the target address on a different server. The request then returns through the target server via the same proxy server showing the website to you.

Here are a few things that proxy can do for you.

  • The first benefit and the one that everyone gets attracted towards is that it hides your real IP address from any websites or servers that you visit. That way, that server cannot figure out your real location. If you really like this one, I think you’re up to some sneaky stuff. Just try not to get to prison.
  • Next, you can use it to add or break rules of your network! You can visit some websites that may have been blocked by your network administrator, or add websites to a ‘blacklist’ that you don’t want the network users to visit.
  • Finally, proxies also ‘cache’, or essentially store some amount of data from the websites that are visited. What does this do? Well, if you visit a website and the data from it is stored, and you visit it next time, your system can show the website directly from the stored data! A connection to the server won’t even be required.

So that’s basically what a proxy does. As a result of all this, it makes your system and network much more secure, fast, and reduces the response time.

Squid Proxy Server

Now that we have understood the deal with proxies, let’s talk about Squid. Squid Proxy Server is a full-featured proxy that is really popular in the Linux community. That is because it has everything that could possibly be wanted from a program of its kind.

Squid supports all major protocols. First one, the HTTP (Hyper-Text Transfer Protocol), which brings you the websites that you visit. Next, FTP (File Transfer Protocol), which is responsible for all kinds of downloads and uploads. Moreover, it caches data of SSL (Secure Sockets Layer). It is the protocol that ensures a secure connection. Finally, it also caches DNS (Domain Name System) data, which fetches the IP address of the websites that you visit. This makes the response time faster even further.

This might be a bit overwhelming for beginners, but if you notice through the descriptions, it basically covers everything that you do on the internet.

Now let’s begin with the installation.

Install and configure Squid Proxy in Ubuntu, Debian, and Mint

Step 1 – Installing and starting services.

First, update your system. This is not absolutely essential, but its good practice.

sudo apt-get update

Now install Squid.

sudo apt-get install squid

Now you need to start and enable the service. So, enter these codes:

sudo systemctl start squid
sudo systemctl enable squid

Now for the testing (again good practice):

sudo systemctl status squid

The output should look something like this.

Screenshot of status check of Squid.
This is what the status check looks like in Linux Mint.

I wish it were this easy. But it’s not. By default, Squid’s settings are not configured properly, so we will have to configure it before we can use it. So let’s see what things need to be done.

Step 2 – Changing the default port

Now open the Squid configuration file with whatever text editor you’re comfortable with. For Ubuntu, the default is Gedit, for Mint Xed. I recommend using Gedit. If you don’t have it, you can install it using the following command:

sudo apt-get install gedit

Now to open the file:

sudo gedit /etc/squid/squid.conf

Sample output

Squid configuration file.
This is what the Squid configuration file looks like. Don’t read too much of it, it will boggle your mind.

Now look up, or better yet, use the find feature to find the line that has ‘http_port 3128’. You can use the find feature by pressing CTRL + F in Gedit (and most of the other graphical text editors). The default port of Squid is 3128 and it is recommended to change it otherwise your system could be a bit vulnerable to attacks.

So replace the 3128 with the port that you want. Make sure to look up that port number on the internet, otherwise you might overlap some other important protocol’s port. We are using 8888 as an example.

Sample output

HTTP Port changing.
Changing the HTTP Port is highly recommended.

Step 3 – Controlling Access Control Lists

So much for the easy part. Now we have to add rules to the configuration files that will determine which users are allowed to access the system and which are not.

We will first specify the network range. Find a line using the keywords ‘acl localnet’. This must be what comes up:

Sample output

Network Range Selection
‘acl localnet’ part of the configuration file.

To find out what your network range is, fire up another terminal and write:

sudo ifconfig

So from your IP address, replace the last part with ‘0’, and that is your network range. For example, my IP address is So my network range is In the line, I have to add This includes all devices in this sub-network.

Now below all the lines starting with ‘acl’, add a line that adds your network range.

acl mint src

I have used the username ‘mint’. You can use anything for it. Now we provide access to the username ‘mint’.

http_access allow mint

This should do it. Now save the file.

Sample output

Configured .conf file.
Now the .conf file has been configured. *Phew*!

Now we restart the Squid service.

sudo systemctl restart squid

This should enable the users of the sub-network to use the proxy.

And viola! You have successfully installed the proxy. This is basically it for installing the proxy, and blacklisting websites, allowing and disallowing certain users, and other advanced functions. How did your installation go? Do let us know your feedback in the comments below.

Pulkit Chandak
Pulkit Chandak is a Linux enthusiast and has been using and experimenting with open source software and hardware too since a long time. He is a huge admirer of open source software and wants to ventilate it to all around him. He is interested in reviewing and writing tutorials on Linux and its many distributions. He believes that freedom in software leads to freedom of the mind from the chains of limits.


Please enter your comment!
Please enter your name here




Top 10 Reasons to use Xfce as your Desktop Environment

There are many choices for desktop environments for Linux based operating systems. Mainly, you can install any DE of your choice on most of the Linux based distributions, even if they are not offered as a package officially. In our recent articles, we discussed the best of KDE and Cinnamon. In this article, we wish to present to you the top reasons why you should consider Xfce as your desktop environment.

The 10 Best Linux Network Monitoring Tools

Having total control over your network is essential to prevent programs from overusing your network resources and slowing down the overall performance. This is why you should install a network monitoring tool on your system, giving you a visual overview of everything that's happening on your network. Networking Tools are like swiss-knife for the system administrators for troubleshooting system issues.

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."

Setting up NFS Server on Ubuntu Server

We have put together a detailed step-by-step tutorial that will guide you on how to install and set up NFS Server on Ubuntu so you too can start sharing data with other client systems. It is divided into sections, the first part discussing how to set up the host server and the second part showing you how to set up the client-side. For this tutorial, we will be using Ubuntu 20.04 LTS.

Crontab in Linux Explained With Examples

Crontab is the Linux equivalent of the Window's Task Scheduler. It can help you set up a task to run automatically at a regular...


Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

10 ways to use the Chown command with examples

Any file in a Linux system belongs to a particular owner(s) and a group. It is one of the many features that maintain security in Linux systems. For example; If a file belongs to say UserA, then UserB cannot manipulate the data depending on any additional permissions set unless the user has permission to do that.

7 Best Ways to Kill Unresponsive Programs in Linux

For dealing with a frozen app or desktop, you can't use the CTRL+ALT+DEL in Linux system. Instead, there are powerful alternatives that come in handy in frustrating situations. We pick the best methods available for you.

5 Best Music Players for Linux

For sure, there will be Linux users out there who cannot live without music. If you're one of those people, you would know how important it is to have a good music player installed on your computer system. In this article, we present to you the five Best Music Players for Linux, which will hopefully be able to satisfy each of our readers' needs.

Top 10 reasons to use KDE as your Desktop Environment

In this article, we will take a look at yet another popular desktop environment, KDE. It's one of the most amazing Linux Desktop environments available in the market.