In this tutorial, we will show you how to install Squid Proxy on AlmaLinux 8. For those of you who didn’t know, Squid Proxy is an open-source caching proxy for the web. It supports many protocols such as HTTP, HTTPS, FTP, and more. By caching and reusing frequently-requested web pages, squid saves bandwidth and improves response time making accessing web pages very fast.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Squid Proxy server on an AlmaLinux 8. You can follow the same instructions for CentOS and Rocky Linux.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Squid Proxy on AlmaLinux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf install epel-release
Step 2. Installing Squid Proxy on AlmaLinux 8.
By default, Squid is available on AlmaLinux 8 base repository. Now run the following command to install Squid Proxy to your system:
sudo dnf install squid
Verify Squid Proxy installation:
squid --version
Before starting the configurations, make sure that Squid services are running on your system. Run the following command to check Squid services status:
sudo systemctl start squid sudo systemctl enable squid sudo systemctl status squid
Step 3. Configuring Squid Proxy.
Now we open the Squid proxy configuration file:
sudo nano /etc/squid/squid.conf
Find the http_port
directive if you’d like to change the listening port for Squid. By default, it is already set to port 3128:
# Squid normally listens to port 3128 http_port 3128 # http_port 3128 transparent
Save and close, then restart the Squid server so that the changes take place:
sudo systemctl restart squid
Step 4. Configure Firewall.
If your firewall is active, you will need to allow Squid through the firewall for other systems to connect:
sudo firewall-cmd --add-service=squid --permanent sudo firewall-cmd --reload
Step 5. Configure Browser to Use Squid proxy.
Once successfully installed and set up, now time to test browsing pointing squid IP and default port in the client browser. On your Firefox, configure it to connect to the external network via your Squid server. Preferences -> General -> Network Settings -> Manual Proxy Configuration
. Check to Use this proxy server for all protocols.
Congratulations! You have successfully installed Squid. Thanks for using this tutorial for installing the Squid proxy server on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official Squid website.