Sometime system admin wants to change default squid port according to the requirements of their network.
Here I will show you, how to change squid proxy server default port.

By default squid listen on port 3128, which we can change easily by defining required port in ‘/etc/squid/squid.conf’ file.
Open squid config file in vi text editor.

# vi /etc/squid/squid.conf


If you install squid from source code then location will be.

# vi /usr/local/share/squid/etc/squid.conf



# http_port 3128


Change into:

# http_port 8080

I changed 3128 port into 8080, you can change what you require.


Now restart squid service.

# service squid restart

That’s it we have successfully changed the port squid proxy server.we can confirm squid new port by using the following command:

See the Proof:

Find Squid Listening Port
Find Squid Listening Port



Make sure to open ports that we changed now 8080.
see below iptables rule:

# iptables -I INPUT -p tcp –dport 8080 -j ACCEPT
# service iptables save
# service iptables restart

Next Topic: Deny Access to specific websites in Squid Proxy

Similar Posts