How To Set Up A Proxy Server In Ubuntu Linux

Ads by Google

squid   How To Set Up A Proxy Server In Ubuntu LinuxThere are many reasons why you might want to learn how to set up a proxy server in Ubuntu Linux to send your browser traffic through. Perhaps you are surfing on an unsecured wireless network, or maybe you don’t want the BOFH at work to see where you are going on the Internet. Whatever your reason, it is fairly simple these days as long as you have some computer ability and are able to set up a system at home or work to serve as a proxy.

What is a proxy? Simply put, a proxy is an intermediate stop that your browser makes while requesting webpages and other web content from the Internet. Many companies legitimately use them so that they can filter content both for security purposes as perimeter control, as an anti-virus/anti-malware solution, or to make sure employees are adhering to Internet policy.


When your browser makes a request, it first contacts the proxy server. If the proxy server is also a cache – it will check the cache locally to see if the content already exists – if it does it will serve it locally, speeding up your browser experience considerably, or if it doesn’t, it makes a request for that content on the general web.

Ads by Google

The Easy Proxy For Ubuntu

connectionaddress   How To Set Up A Proxy Server In Ubuntu Linux

The ‘easiest’ way to create a proxy with Ubuntu is creating a tunnel through SSH. Jorge wrote this excellent how-to on the topic, and the process remains much the same for us.

For a quick overview, you first must have an Ubuntu server with SSH access available to you. You can do this by having a server on your home connection, work connection, or wherever you want your proxy to sit.

firefox socks   How To Set Up A Proxy Server In Ubuntu Linux

Once you have that set up, you follow the process in the article to use the “SOCKS” protocol to tell your browser to use that proxy location to download all information from.

This method also works if you have a wireless router that supports SSH, such as Tomato or DD-WRT.

The Almost-Easy Proxy For Ubuntu

glypeproxy   How To Set Up A Proxy Server In Ubuntu Linux

The second way you can do this is to use a web proxy. As long as your Ubuntu system is set up to serve websites, you can install a web app named GlypeProxy which will act as a proxy for your web browsing session. Simon has a great how-to on setting up GlypeProxy and it would work the same way if you were running a web server on your own Ubuntu system.

Using this method has its pluses and minuses. On the upside, you do not need to modify your own browser settings to use this web proxy. This would be essential if you are in an environment where you do not have the ability to specify a proxy server in your browser options.

On the downside, unless your web server is set up to use SSL encryption, it is also very insecure. Anyone watching the traffic from your machine would still be able to view your content with no problem at all.

The Complicated-To-Install But Full-Featured Proxy

On the more involved side of things, you can install a “real” proxy server on your Ubuntu Linux machine. Proxy software has been developed specifically to address many issues spoken of above and there is a lot of software out there available that can do the job for you.

There are two main types of proxies we will go over, a “normal” proxy and a “transparent” proxy. The normal proxy works as above – you specifically have to enter the proxy information in your browser for it to be used in your web browsing. The second kind, a transparent proxy, works in such a way that all of your web browsing goes through the machine whether you specify it in your browser settings or not.

A real proxy server on Ubuntu usually centers around a piece of software named Squid. Squid is an open source proxy server in wide use across the internet. Squid is easy to install and configure. Install and edit the configuration file:

$ sudo apt-get install squid3
$ vi /etc/squid3/squid.conf 

And add:

http_access allow local_net
acl local_net src 192.168.0.0/255.255.255.0

Where 192.168.0.0 is your local network. Restart squid and you have a basic proxy server set up – you would modify your settings to use a web proxy on port 3128 and the IP address of your Ubuntu system.

firefox proxy   How To Set Up A Proxy Server In Ubuntu Linux

You can really get fancy with how you set up a proxy server in Ubuntu Linux. Howtoforge has this great tutorial on setting up Squid with Dansguardian and ClamAV for antivirus and malware protection.

Whatever Works For You…

From easy to hard, whatever kind of proxy server you need, Ubuntu can provide. Let us know your setup and how it works for you!

Ads by Google

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

9 Comments -

Mike

I’d always go with squid on Linux, no matter what… besides of (more) secure access you get content filtering, caching and delivery.
For example you could cache all Windows/Linux/Mac Updates and get them on all other machines with local LAN speed.
You can configure it via config or a diversity of web gui’s including Webmin which I’m sure everyone has used at least once.

Mike

I’d always go with squid on Linux, no matter what… besides of (more) secure access you get content filtering, caching and delivery.
For example you could cache all Windows/Linux/Mac Updates and get them on all other machines with local LAN speed.
You can configure it via config or a diversity of web gui’s including Webmin which I’m sure everyone has used at least once.

Dave Drager

Webmin is a great alternative to my above suggestions. It will allow you to remotely admin the server from anywhere too.

Anonymous

Of course….

glype.com: This site has been blocked by the network administrator.

Block reason: Forbidden Category “Hacking/Proxy Avoidance Systems”

Dave Drager

That is so ironic! :)

mcstafford

Of course….

glype.com: This site has been blocked by the network administrator.

Block reason: Forbidden Category “Hacking/Proxy Avoidance Systems”

pceasies

I love SSH. I set it up on all my home computers and use my Tomato based router to forward the ports to 22 on each computer (though it’s not hard to change). For Windows just download Cygwin and when installing make sure you select SSH. When you get Cygwin installed open a cygwin prompt and run ssh-host-config. This script will help you through the SSH setup and get you up and running. You can make sure it’s working by
ssh localhost

It may prompt for a password or work automatically. Once it’s setup you can open a tunnel and have a similar to VPN experience with full remote access from the command prompt including copying, opening and closing apps (taskkill, start, top (process manager)). You can set up tunneling to forward ports like 80 and 443 (http and https)

Setting up SSH will also give you SFTP access so you can do file transfers using [win] scp or Filezilla.

pceasies

I love SSH. I set it up on all my home computers and use my Tomato based router to forward the ports to 22 on each computer (though it’s not hard to change). For Windows just download Cygwin and when installing make sure you select SSH. When you get Cygwin installed open a cygwin prompt and run ssh-host-config. This script will help you through the SSH setup and get you up and running. You can make sure it’s working by
ssh localhost

It may prompt for a password or work automatically. Once it’s setup you can open a tunnel and have a similar to VPN experience with full remote access from the command prompt including copying, opening and closing apps (taskkill, start, top (process manager)). You can set up tunneling to forward ports like 80 and 443 (http and https)

Setting up SSH will also give you SFTP access so you can do file transfers using [win] scp or Filezilla.

Dave Drager

BIG fan of Tomato here too. Makes it easy to do all kinds of things including port forwarding. I’ve also set up a VPN at home using an Ubuntu server but still working on getting that up 100%.