• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Install and Configure Squid Server on Debian Linux 11.4

  • 00:24 lsb_release -a
  • 00:37 apt-get install squid
  • 01:03 systemctl start squid
  • 01:19 systemctl status squid
  • 01:34 vim /etc/squid/squid.conf
  • 03:17 vim /etc/squid/block.txt
  • 03:49 service squid reload
{{postValue.id}}

How To Install and Configure Squid Server on Linux Debian 11.4

Introduction:

Proxy servers act as a gateway between the user and the internet and are used to block particular websites and browsers.

Installation Steps:

Step 1: Check the OS version by using the below command

root@debian:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Step 2: Once the OS version is checked, now install the squid server by using the below command

root@debian:~# apt-get install squid
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql default-mysql-client galera-4 icc-profiles-free
  libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl
  libdbd-mariadb-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl
  libjs-bootstrap4 libjs-codemirror libjs-jquery libjs-jquery-mousewheel
  libjs-jquery-timepicker libjs-jquery-ui libjs-openlayers libjs-popper.js
  libjs-sizzle libjs-sphinxdoc libjs-underscore libmariadb3 libonig5
  libterm-readkey-perl libzip4 mariadb-client-10.5 mariadb-client-core-10.5
  mariadb-common mariadb-server-10.5 mariadb-server-core-10.5 mysql-common
  node-jquery rsync socat
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libecap3 squid-common squid-langpack
Suggested packages:
  squidclient squid-cgi squid-purge resolvconf smbclient ufw winbind
The following NEW packages will be installed:
  libecap3 squid squid-common squid-langpack
0 upgraded, 4 newly installed, 0 to remove and 211 not upgraded.
Need to get 3,130 kB of archives.
After this operation, 13.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security bullseye-security/main amd64 squid-common all 4.13-10+deb11u2 [315 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libecap3 amd64 1.0.1-3.2+b1 [17.2 kB]

Get:3 http://deb.debian.org/debian bullseye/main amd64 squid-langpack all 20200403-1 [170 kB]
Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 squid amd64 4.13-10+deb11u2 [2,627 kB]
Fetched 3,130 kB in 2s (2,045 kB/s)
Selecting previously unselected package libecap3:amd64.
(Reading database ... 142102 files and directories currently installed.)
Preparing to unpack .../libecap3_1.0.1-3.2+b1_amd64.deb ...
Unpacking libecap3:amd64 (1.0.1-3.2+b1) ...
Selecting previously unselected package squid-langpack.
Preparing to unpack .../squid-langpack_20200403-1_all.deb ...
Unpacking squid-langpack (20200403-1) ...
Selecting previously unselected package squid-common.
Preparing to unpack .../squid-common_4.13-10+deb11u2_all.deb ...
Unpacking squid-common (4.13-10+deb11u2) ...
Selecting previously unselected package squid.
Preparing to unpack .../squid_4.13-10+deb11u2_amd64.deb ...
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
Unpacking squid (4.13-10+deb11u2) ...
Setting up squid-langpack (20200403-1) ...
Setting up libecap3:amd64 (1.0.1-3.2+b1) ...
Setting up squid-common (4.13-10+deb11u2) ...
Setting up squid (4.13-10+deb11u2) ...
Setcap worked! /usr/lib/squid/pinger is not suid!
Skipping profile in /etc/apparmor.d/disable: usr.sbin.squid
Created symlink /etc/systemd/system/multi-user.target.wants/squid.service → /lib/systemd/system/squid.service.
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...

Step 3: After the Squid is installed, now start the squid service by using the below command

root@debian:~# systemctl start squid

Step 4: After the Squid service is started. Check the status of the Squid service by using the below command

root@debian:~# systemctl status squid
● squid.service - Squid Web Proxy Server


     Loaded: loaded (/lib/systemd/system/squid.service; enabled; vendor preset: enabl>
     Active: active (running) since Fri 2023-06-30 06:21:37 CDT; 27s ago
       Docs: man:squid(8)
    Process: 14042 ExecStartPre=/usr/sbin/squid --foreground -z (code=exited, status=>
   Main PID: 14061 (squid)
      Tasks: 4 (limit: 4623)
     Memory: 15.8M
        CPU: 186ms
     CGroup: /system.slice/squid.service
             ├─14061 /usr/sbin/squid --foreground -sYC
             ├─14071 (squid-1) --kid squid-1 --foreground -sYC
             ├─14078 (logfile-daemon) /var/log/squid/access.log
             └─14081 (pinger)

Jun 30 06:21:37 debian squid[14071]: Using Least Load store dir selection
Jun 30 06:21:37 debian squid[14071]: Set Current Directory to /var/spool/squid
Jun 30 06:21:37 debian squid[14071]: Finished loading MIME types and icons.
Jun 30 06:21:37 debian squid[14071]: HTCP Disabled.
Jun 30 06:21:37 debian squid[14071]: Pinger socket opened on FD 14
Jun 30 06:21:37 debian squid[14071]: Squid plugin modules loaded: 0
Jun 30 06:21:37 debian squid[14071]: Adaptation support is off.
Jun 30 06:21:37 debian systemd[1]: Started Squid Web Proxy Server.
Jun 30 06:21:37 debian squid[14071]: Accepting HTTP Socket connections at local=[::]:>
Jun 30 06:21:38 debian squid[14071]: storeLateRelease: released 0 objects

Step 5: After the Squid server status is checked. Let configure some rules using squid.conf file by using the below command

root@debian:~# vim /etc/squid/squid.conf

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
include /etc/squid/conf.d/*
acl newlist src 192.168.6.107
acl blok dstdomain "/etc/squid/block.txt"
http_access deny newlist blok
http_access allow newlist

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost

Step 6: After the configuration is complete. Let configure block.txt by using the below command

root@debian:~# vim /etc/squid/block.txt
youtube.com

Step 7: After the configuration is complete, now reload the Squid service by using the below command

root@debian:~# service squid reload

Step 8: Open the setting on browser and Click the network setting option as shown in the below image snap 1

Step 9: Configure Proxy Access to the Internet. Enter the youtube.com, the site is blocked by Squid proxy service. Enter into the facebook, this page will be allowed by the squid server. snap 2 snap 3

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install and configure Squid server on Linux Debian 11.4. Your feedback is much welcome.

Tags:
shanemichel
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is the port number of the Squid proxy?

A

The port number of the squid proxy is 3128.

Q

Where is the squid proxy configuration location?

A

The location of the squid proxy configuration file is /etc/squid/squid.conf

Q

Which command is used to restart the squid service?

A

To restart the squid service use systemctl

Q

Which protocols support the squid server?

A

The squid server supports HTTP, FTP, SSL, and DNS protocols

Q

What is the file format of Squid stores data?

A

Squid stores data file format is UFS(Universal Flash Storage).

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luk Van De Looverbosch ?
How to create a root ?

Hello,
How to create root@linuxhelp in Linux Mint 20.1 64-bit ?
Thanks in advance for your reply.
Best regards.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.