Squid proxy: install, configure and run it
Squid is a free, open-source caching proxy for the web. You install one package, edit one file (squid.conf), and point clients at port 3128. The current stable release is Squid 7.8, published on October 30, 2026; distribution packages are usually a little older and work fine for most setups.
Which version you get
The Squid project only supports the latest stable release, so security fixes land there first. Distributions backport fixes into their own packages. As of November 2026:
| Distribution | Package version |
|---|---|
| Debian 13 (trixie) | 6.13 |
| Debian testing (forky) | 7.7 |
| Ubuntu 24.04 LTS | 6.14 |
| Ubuntu 26.04 LTS (updates) | 7.7 |
Install the package
# Debian, Ubuntu
sudo apt install squid
# RHEL, Rocky Linux, AlmaLinux
sudo dnf install squid
sudo systemctl enable --now squid
sudo firewall-cmd --permanent --add-port=3128/tcp
sudo firewall-cmd --reload
Debian also ships squid-openssl, a build with full SSL-Bump support; you only need it for HTTPS interception. The configuration lives in /etc/squid/squid.conf. Copy it before you edit it.
A minimal squid.conf
http_port 3128
acl localnet src 192.168.1.0/24 # your LAN
acl SSL_ports port 443
acl Safe_ports port 80 443 1025-65535
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localnet
http_access allow localhost
http_access deny all
cache_mem 256 MB
cache_dir ufs /var/spool/squid 10000 16 256
Three rules matter most:
- Order decides. Squid checks
http_accesslines top to bottom and stops at the first match. If nothing matches, it does the opposite of the last line, so always end withhttp_access deny all. - Never allow everyone. An open proxy gets found and abused within days. Allow only your own networks.
- No cache_dir means memory only. Without a
cache_dirline, Squid caches in RAM only. The line above gives a 10,000 MB disk cache with 16 first-level and 256 second-level directories. The directory must exist and belong to the Squid user; then runsudo squid -zto build the structure. On RHEL with SELinux, a non-default directory also needs thesquid_cache_tlabel.
Reload, logs and testing
sudo squid -k parse # check the syntax first
sudo squid -k reconfigure # apply changes without a restart
sudo tail -f /var/log/squid/access.log
curl -sI -x http://192.168.1.10:3128 http://example.com/
curl -sI -x http://192.168.1.10:3128 https://example.com/
Each request adds a line to access.log. TCP_MISS/200 means Squid fetched the page; TCP_HIT or TCP_MEM_HIT means it came from the cache; TCP_TUNNEL is an HTTPS connection passed through unread; TCP_DENIED means an http_access rule refused it. Errors and startup messages go to cache.log. More answers are in the Squid FAQ.
Where Squid came from
Squid grew out of the Harvest cache daemon from the ARPA-funded Harvest research project of the early 1990s. In the mid-1990s the National Science Foundation funded web-caching research at UC San Diego (grant NCR-9796082, with Duane Wessels as a co-investigator), and the NLANR team ran a hierarchy of caches, known as IRCache, alongside Squid's development. When that funding ended, volunteers, donations and paid contracts kept the project going. Today the Squid Software Foundation oversees it. You can read more in our NLANR history page. This site is independent and has no link to the Squid project.
Guides in this section
- Squid FAQFixes for common Squid problems: Access Denied, nothing cached, HTTPS and CONNECT, log formats, memory use, reconfigure versus restart, and password authentication.
- Interception proxyingHow Squid intercepts web traffic without browser settings: intercept versus tproxy, iptables and nftables rules, why HTTPS needs SSL-Bump, and PAC or WPAD alternatives.
- How web caching worksHow browsers, proxies and CDNs decide what to cache: Cache-Control, freshness, ETag and 304, Vary, heuristic freshness under RFC 9111, and the history of ICP hierarchies.
Sources
- Squid versions, Squid Cache project
- Squid: Optimising Web Delivery (introduction and history), Squid Cache project
- About Squid, Squid wiki
- http_access directive, Squid configuration reference
- cache_dir directive, Squid configuration reference
- squid package versions, Debian
- squid package versions, Ubuntu
- How to install a Squid server, Ubuntu Server documentation
- Configuring the Squid caching proxy server, Red Hat Enterprise Linux 8 documentation