<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Walid R. Rashed's Blog]]></title><description><![CDATA[I am a Kurdish Software Engineer and a UX/UI Designer with a background in Cyber-Security and Digital Marketing.]]></description><link>https://blog.kurdi.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1651271823563/vfe2u26rl.png</url><title>Walid R. Rashed&apos;s Blog</title><link>https://blog.kurdi.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 03:53:07 GMT</lastBuildDate><atom:link href="https://blog.kurdi.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to set up an HTTP proxy server on Ubuntu 20.04]]></title><description><![CDATA[In this blog post, I will demonstrate how to install and configure Squid Proxy on Ubuntu 20.04.
Introduction
About Squid Proxy
Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response time...]]></description><link>https://blog.kurdi.dev/how-to-set-up-an-http-proxy-server-on-ubuntu-2004</link><guid isPermaLink="true">https://blog.kurdi.dev/how-to-set-up-an-http-proxy-server-on-ubuntu-2004</guid><category><![CDATA[Ubuntu]]></category><category><![CDATA[proxy]]></category><category><![CDATA[server]]></category><category><![CDATA[Devops]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Walid R. Rashed]]></dc:creator><pubDate>Fri, 29 Apr 2022 22:34:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1651271509005/S5PqhNdGY.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this blog post, I will demonstrate how to install and configure Squid Proxy on Ubuntu 20.04.</p>
<h2 id="heading-introduction">Introduction</h2>
<h4 id="heading-about-squid-proxy">About Squid Proxy</h4>
<p><a target="_blank" href="http://www.squid-cache.org/">Squid</a> is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows, and is licensed under the GNU GPL.</p>
<h4 id="heading-prerequisites">Prerequisites</h4>
<p>To complete this guide, you will need:</p>
<ul>
<li>A Ubuntu 20.04 installed VPS or dedicated server.</li>
<li>Root user access or normal user with administrative privileges.</li>
</ul>
<h2 id="heading-installing-squid-proxy-on-ubuntu">Installing Squid Proxy on Ubuntu</h2>
<h3 id="heading-step-1-installing-squid-proxy">Step 1 - Installing Squid Proxy</h3>
<p>First, log in using the ssh command or use your favorite SSH client like Putty:</p>
<pre><code class="lang-bash">ssh user@your-server-ip
</code></pre>
<p>Next, update and upgrade your system using the apt commands:</p>
<pre><code class="lang-bash">sudo apt update
sudo apt upgrade
</code></pre>
<p>then, run the below command to install Squid Proxy:</p>
<pre><code class="lang-bash">sudo apt install squid
</code></pre>
<p>After the installation, Squid will automatically set up a background service and starts running, you can verify this by executing the following command:</p>
<pre><code class="lang-bash">sudo systemctl status squid
</code></pre>
<p>You can also manually enable and start Squid service by executing the following commands:</p>
<pre><code class="lang-bash">sudo systemctl <span class="hljs-built_in">enable</span> squid
sudo systemctl start squid
</code></pre>
<h3 id="heading-step-2-configuring-squid-proxy">Step 2 - Configuring Squid Proxy</h3>
<p>the Squid Proxy's configuration file is located at <code>/etc/squid/squid.conf</code>,<br />By default, Squid does not allow any clients to connect to it from outside of this server. we will configure it to be public and let other clients use it.</p>
<p>First, we will create a backup copy from the original configuration file:</p>
<pre><code class="lang-bash">sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.BAK
</code></pre>
<p>Then, we will open the configuration file using nano editor:</p>
<pre><code class="lang-bash">sudo nano /etc/squid/squid.conf
</code></pre>
<p>What is really annoying about Squid’s default configuration file is its very long file, and contains a massive number of options that have been temporarily disabled (commented out) by putting a <code>#</code> at the start of the line they’re on, You probably need to search through the file to find the lines you want to edit. In <code>nano</code>, you can do this by pressing <code>Ctrl+W</code>, entering your search term, pressing <code>Enter</code>, and then repeatedly pressing <code>Alt+W</code> to find the next instance of that term if needed. with that being said now let's start configuring it.</p>
<p>By default, squid is set to listen on TCP port <code>3128</code> on all network interfaces on the server. You can change it to use another port or leave it as default.</p>
<pre><code class="lang-:.env.local">http_port 3128
</code></pre>
<p>Next, find a line containing the phrase <code>http_access deny all</code>.</p>
<pre><code><span class="hljs-string">.</span> <span class="hljs-string">.</span> <span class="hljs-string">.</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS</span>
<span class="hljs-comment">#</span>
<span class="hljs-string">include</span> <span class="hljs-string">/etc/squid/conf.d/*</span>
<span class="hljs-comment"># Example rule allowing access from your local networks.</span>
<span class="hljs-comment"># Adapt localnet in the ACL section to list your (internal) IP networks</span>
<span class="hljs-comment"># from where browsing should be allowed</span>
<span class="hljs-comment">#http_access allow localnet</span>
<span class="hljs-string">http_access</span> <span class="hljs-string">allow</span> <span class="hljs-string">localhost</span>

<span class="hljs-comment"># And finally deny all other access to this proxy</span>
<span class="hljs-string">http_access</span> <span class="hljs-string">deny</span> <span class="hljs-string">all</span>
<span class="hljs-string">.</span> <span class="hljs-string">.</span> <span class="hljs-string">.</span>
</code></pre><p>Since we want to make the Proxy Server available for public use, We change the line <code>http_access deny all</code> to <code>http_access allow all</code>, in case you are on the same network with the server and want the proxy server to be available only localy instead you can leave the <code>http_access deny all</code> and instead uncomment <code>http_access allow localnet</code> to make the proxy server available only to your local network.</p>
<p>After that, you can finally restart the Squid service for your configuration to take place. This might take a moment to complete:</p>
<pre><code class="lang-bash">sudo systemctl restart squid
</code></pre>
<pre><code class="lang-:Output">● squid.service - Squid Web Proxy Server
     Loaded: loaded (/lib/systemd/system/squid.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-01-31 21:28:27 UTC; 17h ago
</code></pre>
<h3 id="heading-step-3-allowing-squid-proxys-port-number-by-the-firewall">Step 3 - Allowing Squid Proxy's port number by the firewall</h3>
<p>Finally, we can now use the Squid Proxy using the server IP and the port that we set in the Squid configuration file but make sure that you have that port is allowed by your firewall.</p>
<p>We can open manage our firewall easily using <code>firewall-cmd</code> administrative tool, start by installing it in case you don't have it installed:</p>
<pre><code class="lang-bash">sudo apt install firewalld
</code></pre>
<p>After the installation, open the Squid Proxy port number, in the bellow command we open the default port number, don't forget to use open the port number that you set inside the Squid configuration file!</p>
<pre><code class="lang-bash">sudo firewall-cmd --zone=public --permanent --add-port=3128/tcp
</code></pre>
<h2 id="heading-conclution">Conclution</h2>
<p>That's it, now you have your own Proxy server, In this tutorial blog, you learned how to install, set up, and deploy Squid Proxy server for public internet access on Ubuntu Linux 20.04 LTS, make sure to refer back to Squid server's <a target="_blank" href="http://www.squid-cache.org/Doc/">documentation</a> to know more about the full potentials of the Squid Proxy!.</p>
]]></content:encoded></item></channel></rss>