• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Install Squid Proxy on Ubuntu

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
18
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Installation
  2. Configuration
  3. Using your proxy
  4. Want to contribute?


Squid is a popular proxy and caching server application. It primarily serves as a forward proxy, but can also be used as a reverse proxy. Squid provides many features and is often used on enterprise-level networks.

This tutorial will show you how to setup a simple HTTP proxy with authentication using Squid. Steps listed in this tutorial were tested on Ubuntu 15.04 and 15.10.

WARNING: You must be very careful when creating proxies. Hackers frequently scan the public internet for open proxies use them for malicious activities. Most hosting companies will suspend your instances if you receive too many complaints, so ensure that you use sufficient authentication, such as a strong password.

This tutorial assumes that you are using a freshly created VPS with no installed packages.

Installation

First, ensure that the apt-get package library is up-to-date by running the command below. This will ensure that the latest packages have been installed.

$ apt-get update

Once this has completed, it is time to install the squid application and htpasswd. Run the following command using sudo to install both packages.

$ sudo apt-get install squid3 apache2-utils

After the Squid install completes, I suggest that you create a copy of the original config file created during the install as it is a helpful reference and allows you to rollback any changes.

$ sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.default

Next, create the files needed by Squid to store the credentials of the proxy accounts.

$ sudo touch /etc/squid/squid_passwd
$ sudo chown proxy /etc/squid/squid_passwd

Configuration

Open the squid config file for editing using a text editor, such as nano.

$ sudo nano /etc/squid/squid.conf

Add the following lines to the file so that authenticated users can connect to the proxy.

auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/squid_passwd
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

In addition, to hide the IP of the person connecting to the proxy from being shown in HTTP headers, add the following lines under the ones above.

forwarded_for off
request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all

Your Squid config file should now look something like this:

Install Squid Proxy on Ubuntu

Save and close the file.

To create users on your proxy, execute the following command, replacing youruser with your desired user name. It will request the password twice.

$ sudo htpasswd /etc/squid/squid_passwd youruser

You may create additional users in the same manner.

Restart the Squid service.

$ sudo service squid restart

Using your proxy

Now that Squid is setup, you can use it as a forwarding proxy. Configure the “internet settings” of your web browser to use your proxy, including the user name and password that you generated earlier. To verify that the proxy is working, visit an IP address detection site, like this one.

Upon success, you will notice a Vultr IP address being reported. Here is a screenshot from my demo server:

Install Squid Proxy on Ubuntu

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How To Install Xubuntu Desktop On Vultr Servers With Ubuntu 15.10

Next Post

Using Hosts File to Test Websites

Next Post

Using Hosts File to Test Websites

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet