How to Configure Ubuntu desktop to use your proxy server

Sponsored Link
If you are having ubuntu desktop/laptop in your office or home behind proxy this tutorial is for you.This tutorial will explain How to Configure Ubuntu desktop/laptop to use your proxy server.

Network Proxy

Ubuntu has a setting in gnome for the Network Proxy, which should set gnome’s proxy.

First go to System--->Preferences--->Network Proxy


Once it opens click on "Proxy Configuration" and enter your proxy server,port number details click Close.


Synaptic Package Manager

Synaptic Package Manager must have the proxy set, in order to update your installation using the in-built Update Manager or Synaptic GUI.

Go to System--->Administration--->Synaptic Package Manager


Once Synaptic Package Manager opens click on Settings--->Preferences


Click on Network tab select Manual Proxy Configuration option and enter your proxy server,port details.If you have username,password click on Authentication to enter these details click on ok


Firefox proxy Configuration

Open your firefox browser go to Edit--->Preferences


Click on Advanced and select Network tab


Select Settings option


Now select Manual Proxy Configuration and enter your proxy server,port details click on ok


Terminal Proxy

If you want to configure proxy for apt-get,aptitude,wget use the following procedure

First you need to edit /etc/bash.bashrc file

gksudo gedit /etc/bash.bashrc

Add your proxy server details in the following format

export http_proxy=http://username:password@proxyhost:port/
export ftp_proxy=http://username:password@proxyhost:port/

Save and exit the file

Update the source list and you can restart your system

sudo apt-get update

Sponsored Link

You may also like...

44 Responses

  1. qwerty says:

    Firefox uses system wide network/proxy settings by default, there is no need to edit them.

  2. SonniesEdge says:

    You shouldn’t need to touch the Firefox settings. Just leave it at “use system settings” and it will use whatever you’ve set in the system proxy dialogue.

    Under Karmic/9.10 you won’t need to mess with the other settings either – just click “Apply system-wide” – no need to mess with exporting paths or fiddling with Synaptic.

  3. Dan says:

    This is very helpful, in 9.10 I had to fiddle with Synaptic and exporting paths because my HTTP proxy requires user authentication and it comes up with an error if I just set the Network Proxy Preferences under the System Menu (even when set to system-wide).

    Yes, Firefox does use the Network Proxy Preference if set to System-Wide but only firefox asks you for your credentials, the others like Synaptic need you to configure it within their program

  4. Adam says:

    What if you’re going to and from the office, you have to set and unset this in three places every time? Not good enough!

  5. genewitch says:

    @adam: you’d have to do that on windows if you used any non-microsoft programs (like firefox)

    The easiest way is to go multi-user and have different settings for each user, i’d imagine. then use homeuser at home and workuser at work.

    thanks for the article, it worked great, i think!

  6. Mayo2000 says:

    I’m wondering what fonts are you using. They look pretty.

  7. simon says:

    Seems it should just be necessary to do it once at system wide.

  8. georgi says:

    I’ve followed the above instructions to configure my proxy at work and browsing the web only works partially.
    For example, hitting “login” for Yahoo mail gives me an error, same for Hotmail. Gmail does not display at all. Other websites work fine. What could be the problem? I tried putting my Active Directory user name and password for the proxy authentication credentials but that doesn’t seem to help much. I’m on an Active Directory network .

  9. SonniesEdge says:

    Sounds like the proxy isn’t working for HTTPS sites. Make sure you ticked the “use this proxy server for all protocols” checkbox in the proxy config.

  10. georgi says:

    thanks, this fixed my problem!

  11. Adriaan says:

    This doesn’t work, nothing works, cannot do a commandline update getting 407 proxy Authentication errors, all websites same advice.

  12. Emmett Hoops says:

    This is about the 50th bit of advice I’ve followed to get my Ubuntu 9.10 to update — and it’s the 50th failure. No matter what I do, I keep getting IGN and 407 errors. I can get through with Firefox by simply setting the proxy and port, but Synaptic doesn’t work and neither does apt-get. I’m incredibly frustrated, and about to give up and reinstall XP.

  13. Zetheroo says:

    I have applied the settings system-wide but nothing can connect to the Internet except Thunderbird and Firefox.
    Skype, Pidgin, Update Manager … do not connect to the net! VERY frustrating!!!

    OpenSuse and Fedora both get through the proxy so I know it is not an issue with the server or with my username/password/settings!

  14. Joseph says:

    I am also having difficulties in UNR 10.4. i enabled system-wide settings and applied to all protocols, but no program seems to pay any attention. Not any of my three web browsers, not the terminal (ssh, ping, etc), not my IRC client, nothing. Does it just not work?

  15. Ricardo says:

    My broser works, my IM works, Synaptic works, but when i try to use apt-get. i get 407 error. I changed the bash file as mentioned here, but that didnt work for me. Tried to aply a system-wide on Network Proxy, but that doesnt seem to be working either.

    Dunno what else to do

  16. Ricardo says:

    Just to let you know guys that i fixed my problem with apt-get by adding the proxy setup into apt.conf file. I found this here

    Hope it solves some of your problems.

  17. villa says:

    thank you for this information it SAVED my sanity
    after so many nights of trying to get my 10.04 to go on line.

  18. Adiga says:

    Also it might help to edit /etc/wgetrc . Uncomment the section for the proxy and add the required credentials for the proxy server.

  19. jose says:

    Thanks a lot!

    its my first time to use Ubunto
    and its fun.

  20. domsbyte says:

    Thanks guys very..very..helpful me..:)

  21. DarkStain says:

    hi im having problem installing gui for ubuntu ive tried sudo apt get update and it doesnt work i keep getting err http…….hostname cannot be found what should i do? And I have a gui in my usb flash, its afterstep. how do i install from it?

  22. Mazhar H Shah says:

    Thanx! it is very helping

  23. Nik says:

    Hi – thanks for the tutorial first of all. It did not work for me, but I am just learning to use Computers and do not know much about them especially Linux. The tutorial makes complete sense, but my problem is really simple: How can I find out my Proxy-Setting or what exactly do I need? I went to one of these “How is my IP”Pages and it gave me the following information:

    IP Adress 146.23XXXXXXXXX
    Hostname bcproxyXXXXXXXX
    Remote Port 58509
    Protokoll HTTP/1.1
    eMule ID 84730XXXXXXXXXXX
    Proxy Proxy found
    Proxy IP 146.23XXXXXXXX
    Proxy Typ Anonymous Proxy
    Proxy Name b68044XXXXXXXXXXX

    I tried to connect using the Proxy IP and the Remote Port but that did not work. If I set Firefox to “automatically get settings” Internet works fine, but I would like to manually configure it to use the Updater, ect. My problem is that I do not know what exactly to put into the blank boxes (How do I find out what kind of proxy it is? Secure, HTTP, FTP?).

    Thanks alot in advance – I tried to search for an answer online but could not find anything better than this tutorial. The proxy is used here at a University in Africa if that is valuable information….


  24. Ricardo says:

    Hello Nik.
    If the university owns this computer you are speaking of, then maybe you wont be able to change anything, for security reason.
    I think you should talk to the administrator of this network first, and check if they can give you the information about the proxy.



  25. Onno says:

    It seems that network proxying is changed considerably in Oneric and generally found to be not working.

    Please update this instruction and/or provide an instruction to do this magical thing for Oneric.

  26. andrea says:

    I have the same.
    Firefox works fine but apt-get and the software centre would not connect

  27. andrea says:

    link doesn’t work for me… do you have an alternate option or can you describe it here?

  28. Ricardo says:


    The info that was in this link is the same as in the terminal proxy in this topic, except that I had put it on the apt.conf file. Let me know if this does work for you.

  29. Andrea says:

    thank you.
    I eventually managed to make things work, except all conf files need editing, one for each command (apt, wget, etc).
    This is a bit annoying as i had hoped that applying the proxy system-wide from the proxy settings would suffice

  30. Ricardo says:

    Glad I could help.

    I’ve been away from linux for a while now, and I’ve never been and experienced user either, but I do share your concern.
    What I’ve been told is that some programs, for no reason I can tell, use their own proxy settings no matter what the system proxy settings are. That’s why these things happens. But that was in Ubuntu 8, or 9 (can´t remember).

Leave a Reply

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