News
3 new Serverspace GPT API Language Models available now!
JT
June 20 2025
Updated June 20 2025

How to set up proxy on Linux client?

Linux

A proxy server is used to redirect network traffic from a client to a target resource. It can perform caching, access control, anonymization, or bypass restrictions.

In this guide, we will look at how to set up a proxy on a client machine (Linux) and how to deploy a simple proxy server based on squid.

Configuring a proxy on the client

To configure a proxy server on the client side, you must specify the proxy address and port in the system or user environment variables.

Step 1. Setting environment variables

Add the following lines to your ~/.bashrc or ~/.bash_profile:

export http_proxy="http://:"
export https_proxy="http://:"
export ftp_proxy="http://:"
export no_proxy="localhost,127.0.0.1,::1"
Example:
export http_proxy="http://192.168.1.100:3128"
export https_proxy="http://192.168.1.100:3128"

Apply changes:

source ~/.bashrc
export
Screenshot № 1 — Export

Step 2. Installing a proxy in apt (for Debian/Ubuntu)

Create or edit the file /etc/apt/apt.conf.d/95proxies:

Acquire::http::Proxy "http://192.168.1.100:3128/";
Acquire::https::Proxy "http://192.168.1.100:3128/";

Configuring a proxy server (Squid)

Squid is a popular caching proxy server with flexible configuration.

Step 1. Install Squid

For Debian / Ubuntu:

sudo apt update
sudo apt install squid -y
squid
Screenshot № 2 — Squid

For CentOS / RHEL:

sudo yum install squid

Step 2. Configure Squid

Open the configuration file:

sudo nano /etc/squid/squid.conf

Find and edit the following parameters:

##Allow access from your subnet:

acl localnet src 192.168.1.0/24
http_access allow localnet

##Specify the port (default is 3128):

http_port 3128

Save the changes and restart the service:

sudo systemctl restart squid
sudo systemctl enable squid
Server deploy
Screenshot № 3 — Server deploy

Step 3. Checking the work

From the client, make a request:

curl -x http://192.168.1.100:3128 http://example.com

If the proxy works, you will receive an HTML response from the site.

For authentication, add auth_param to the Squid configuration. The work logs are located in /var/log/squid/access.log. Proxy configuration is a useful tool for administering network traffic. You can set proxy server parameters both on the client and run your own server based on Squid. This will provide control, acceleration and filtering of connections.

Vote:
5 out of 5
Аverage rating : 5
Rated by: 1
33145 North Miami, FL 2520 Coral Way apt 2-135
+1 302 425-97-76
700 300
ITGLOBAL.COM CORP
700 300

You might also like...

We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.