How to Install Squid Proxy Server on Ubuntu 18.04

Install Squid Proxy Server on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Squid Proxy Server on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Squid is a full-featured open source web proxy cache server that can be used by SME to large enterprise level networks to cache and proxy for FTP, HTTP, DNS lookups, and other protocols. Squid can also do caching and proxy for SSL requests.

Install Squid Proxy Server on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install Squid Proxy Server.

Squid package is included in the default Ubuntu 18.04 repositories. Execute below command on your server to install SQUID proxy server:

sudo apt install squid

Once the installation is completed, the Squid service will start automatically. To verify that the installation was successful and Squid service is running, follow the command:

sudo systemctl status squid

Step 3. Configuring Squid Proxy Server.

The Squid configuration file is found at /etc/squid/squid.conf.

sudo nano /etc/squid/squid.conf

Edit squid configuration file and change http_port value with new port:

http_port 3128

Navigate to the http_access deny all option. This is currently configured to block all HTTP traffic. This means no web traffic is allowed:

http_access allow all

Navigate to the visible_hostname option. Add any name you’d like to this entry. This is how the server will appear to anyone trying to connect. Whenever you make changes to the configuration file you need to restart the Squid service for the changes to take effect:

sudo systemctl restart squid

Step 4. Configure Firewall Service

For a running firewall service on Ubuntu, open the port on the firewall:

sudo ufw allow 3128/tcp

Step 5. Configure Squid Client.

All this configuration has been done to set up your Squid proxy server. Now, switch to your client machine and open your web browser. If you’re using Firefox, you can find the proxy settings under:

  • Menu > Options > Network Settings > Settings
  • Tick the radio button for Manual proxy configuration.

That’s all you need to do to install Squid Proxy Server on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.