This article is going to show you how to install Squid Proxy on Ubuntu 22.04. Squid is an HTTP web proxy that caches and forwards data. It can be used for a variety of things, including as speeding up a web server by caching repeated requests, caching web, DNS, and other computer network lookups for a group of individuals sharing network resources, and filtering traffic to help with security.
Squid provides limited support for various other protocols, including Internet Gopher, SSL, TLS, and HTTPS, despite being predominantly used for HTTP and FTP. The SOCKS protocol is not supported by Squid.
How to Install Squid Proxy on Ubuntu 22.04
- First, make sure your system packages are up to date. Run the command below to update your packages.
sudo apt-get update
- Then upgrade.
sudo apt-get upgrade
Sample Output
Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: libfprint-2-tod1 libllvm9 linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic linux-image-5.4.0-26-generic linux-modules-5.4.0-26-generic linux-modules-extra-5.4.0-26-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: language-pack-en language-pack-en-base linux-firmware python-apt-common python3-apt python3-distupgrade ubuntu-drivers-common ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk 9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 117 MB of archives. After this operation, 2,478 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 language-pack-en all 1:20.04+20220211 [1,896 B]
- Using the command below, install the Squid proxy server.
sudo apt install squid
Sample Output
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libfprint-2-tod1 libllvm9 linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic linux-image-5.4.0-26-generic linux-modules-5.4.0-26-generic linux-modules-extra-5.4.0-26-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libdbi-perl libecap3 squid-common squid-langpack Suggested packages: libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl squidclient squid-cgi squid-purge resolvconf smbclient winbind The following NEW packages will be installed: libdbi-perl libecap3 squid squid-common squid-langpack 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 3,670 kB of archives. After this operation, 15.7 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libecap3 amd64 1.0.1-3.2ubuntu1 [17.4 kB]
- If you want to know which squid version you are using, run the command below.
squid --version
- The command below will show you the status of the Squid proxy server.
sudo systemctl status squid
Sample Output
● squid.service - Squid Web Proxy Server Loaded: loaded (/lib/systemd/system/squid.service; enable> Active: active (running) since Fri 2022-02-18 09:47:02 EA> Docs: man:squid(8) Main PID: 23401 (squid) Tasks: 4 (limit: 4588) Memory: 15.2M CGroup: /system.slice/squid.service ├─23401 /usr/sbin/squid -sYC ├─23404 (squid-1) --kid squid-1 -sYC ├─23407 (logfile-daemon) /var/log/squid/access.log └─23408 (pinger) Feb 18 09:47:02 ubuntu squid[23404]: Max Swap size: 0 KB Feb 18 09:47:02 ubuntu squid[23404]: Using Least Load store di> Feb 18 09:47:02 ubuntu squid[23404]: Set Current Directory to > Feb 18 09:47:02 ubuntu squid[23404]: Finished loading MIME typ> Feb 18 09:47:02 ubuntu squid[23404]: HTCP Disabled. Feb 18 09:47:02 ubuntu squid[23404]: Pinger socket opened on F> Feb 18 09:47:02 ubuntu squid[23404]: Squid plugin modules load> Feb 18 09:47:02 ubuntu squid[23404]: Adaptation support is off. Feb 18 09:47:02 ubuntu squid[23404]: Accepting HTTP Socket con> Feb 18 09:47:03 ubuntu squid[23404]: storeLateRelease: release>
- The Squid proxy server service begins immediately once the installation is complete. If it does not start automatically, use the following command to start it manually.
sudo systemctl start squid
- Use the following command to start the Squid proxy server at boot so that when you power on your computer, Squid proxy server will be running.
sudo systemctl enable squid
- Use the following command to terminate the Squid proxy server service.
sudo systemctl stop squid
Uninstall Squid Proxy on Ubuntu on Ubuntu 22.04
- To remove Squid proxy on your Ubuntu 22.04, run the following command.
sudo apt remove squid
- You have reached the end of the article, Congratulations. You have learned how to Install Squid Proxy on Ubuntu 22.04.
Other Tutorials
Install and Configure VNC server on Ubuntu 22.04