Setup Squid as a HTTP proxy to browse blocked web sites!

by Ruchira on January 4, 2011

Have you ever worried about your government,workplace,school or ISP limitations for web sites? Are you behind Great firewall of china? are you worried about browsing speeds with overloaded or slow web proxy services?

HTTP proxies are the best solution for you. And with squid cache you can make a nice HTTP proxy for your personal or family use.

In my case I have tried SSH SOCKS5 method for access blocked sites but I feel it too slow because connection is encrypted but its so secure than HTTP proxy.

But I don’t need much security like SOCKS5 offer So I have decided to setup squid as a proxy server for my personal use. And felt that its delivering blazing fast speed as same as I’m browsing without proxies.

So now all my firefox traffic is going through HTTP Squid proxy running on UK 512MB XEN box that I had spare and I don’t thinking about going back to normal no proxy mode because speed is same as no proxy.

So here is my guide to setup squid as a proxy server on ubuntu or debian for you!

What you will need-

  • A VPS or dedicated server with minimum ram of 64MB (64MB of ram will be enough because squid doesn’t eat much ram)
  • Debian or Ubuntu installed on your server
  • NANO text editor installed on your server ( run “apt-get install nano” to install it if you dont have it already)


Install squid on your ubuntu or debian server, issue this command over SSH

 apt-get install squid

Then squid is successfully installed and you need to setup squid to access internet because its currently set only for localhost

squid’s config file is huge so we need to find some lines using nano on squid config file.

Issue this commands to open squid config file with NANO text editor.

nano /etc/squid/squid.conf

On there we need to add 2 lines to configure this for our personal use.

You can add then on top of the page. those 2 lines are

http_access allow all

http_access allow localnet

Here is the squid.conf file after adding that 2 lines

So that’s it on server side. Restart squid to load our configuration.

 restart squid

Like I said previously on this guide I’m not focused on setting up security for squid like adding ACL (Access Control Lists) to prevent other users using your proxy etc.

But this is 1000 times better than setting up a php web based proxy to browse the web.

While server side setup complete we need to setup our web browsers to use our proxy. I think you are probably using firefox to browse the web so here is the configuration for firefox for other programs you can use the same.

On firefox navigate to Tools=>Options=>Advanced=>Network=>Settings=>Manual Proxy Configuration

On that page enter your IP address that squid is installed and port as 3128 because we didn’t changed the default squid port. Also click the checkbox “Use this proxy server for all protocols”

Thats it! 🙂

Note that

  • We didn’t setup Access Control Lists so any one who knows your squid server ip address and port can use your proxy.
  • When choosing a server for setting up squid for your use try to get a server which gives lowest ping times for your location which will help you to browse more fast.
I'm Ruchira Sahan and all posts on this blog are completely my thoughts and writings. I love DIY and Technology. So feel free to contact me for anything about this blog and don't forget to add a comment if this blog helped you! Thanks
View all posts by Ruchira

{ 16 comments… read them below or add one }

1 Marl January 6, 2011 at 4:39 AM

Looks easy. 🙂

Hmm.. How about stopping squid when not in use, will that make it secure?


2 Ruchira January 6, 2011 at 6:09 AM

Yes if you stopped it nothing will happen! And also I said im not focused about security is not server security,bugs etc.
I said in this setup anyone can use your proxy if they know your ip and port. Thats the only drawback.


3 Marl February 7, 2011 at 8:49 AM

hey man I just tried this today, but after adding that two lines above “http_acess…” I have this error when restarting :

Restarting Squid HTTP proxy: squid2011/02/07 23:49:08| ACL name ‘all’ not defined!
FATAL: Bungled squid.conf line 1: http_access allow all
Squid Cache (Version 2.7.STABLE3): Terminated abnormally.

How to fix this?


4 Ruchira February 8, 2011 at 7:31 AM

IMEI: 359945034016272

Unlock: 38480412
Flash: 48406212


5 Sonic March 2, 2012 at 6:30 PM

I got same problem, how to fix this?


6 niroshan February 2, 2011 at 9:07 PM

Dear ruchira

This is too technical for me
I need something that will allow me to use skype to chat with my family…
skype is blocked in the country i work


7 Ruchira February 3, 2011 at 3:55 AM

best thing is buy a VPN account!


8 Muhammad Nur Husni March 3, 2011 at 2:14 AM

Very nice………


9 Brad January 8, 2012 at 2:50 PM

This helped me alot… thanks for your excellent guide!


10 Joel January 20, 2012 at 1:43 AM

This is not a solution for people living in China, like myself. The connection between the client and the proxy is not encrypted so traffic is easily filtered by China’s Great Firewall. I have tested it myself and pages normally blocked, like Facebook and Youtube, still failed to load.

A better solution is to signup for a VPS (outside China) and then initiate a secure SOCKS proxy tunnel via SSH, by running this shell command on your PC:
ssh -D 9999 @ -C
‘-D’ sets up the SOCKS proxy and ‘-C’ enables compression (hopefully making it faster)

However the best solution is to use a VPN service because the solution above unfortunately does not handle DNS requests (DNS operates on UDP and SOCKS only handles TCP). Instead, DNS requests will be sent to your Chinese internet provider rather than over the SSH tunnel. Chinese Internet providers have been known to poison DNS records so they simply can’t be trusted.

Unfortunately the Chinese government has started to block more and more commercial VPN services, so I recommend setting up your own OpenVPN server on your VPS.


11 Dexter April 15, 2012 at 6:24 AM


facebook is blocked by isp, i have installed squid on a remote server and configured it on my browser as you mention on this blog, but when i am browsing I am being redirected to following URL.

Any help would be appreciated.


12 Ruchira April 17, 2012 at 9:50 AM

looks like there is a configuration problem. is that the same error that you are getting when you arent using the proxy?


13 Dexter April 15, 2012 at 7:42 AM

Oh looks like the problem is with chrome, it is working fine on IE.


14 John March 2, 2013 at 12:23 PM

The instructions in this guide are DANGEROUS and INSECURE. DO NOT use this guide. An open HTTP proxy is vulnerable to hackers and bots that are constantly scanning for insecure proxies to exploit.


15 Ruchira March 5, 2013 at 8:02 PM

yes anyone can use this proxy if they get to know the ip and port. But did you read the article to the bottom? I have warned about it


16 pandadada... July 11, 2013 at 11:38 PM

The wall of our great country is so famous …


Leave a Comment

Previous post:

Next post: