When I try to set Google Chrome's proxy settings (on chrome://linux-proxy-config/), I get the following message:

When running Google Chrome under a supported desktop environment, the system proxy settings will be used. However, either your system is not supported or there was a problem launching your system configuration.

But you can still configure via the command line. Please see man google-chrome-stable for more information on flags and environment variables.

I need to set proxy settings to use Chrome, but I don't want to be setting them in the command line every time I use Chrome. Is there a way to set these settings permanently?

Also, is there an option in Chrome so that it doesn't use proxy for specific domains (analogous to the No proxy for setting in Firefox)?

  • @KasiyA I don't want to use Chrome without proxy. I want to use proxy for most domains, except for a few, which are local to my network. – becko Aug 20 '14 at 15:11
up vote 38 down vote accepted

Start Ubuntu Software Center, search for "gksu", then click Install (if not already installed).

Press Alt+F2 and type gksu nautilus and hit Enter

Type your password then press Ctrl+L and type /usr/share/applications/ and press Enter

Now find google-chrome and right-click on chrome icon and select "Properties".

Next, Add the following option at the end of command text box, there.

--proxy-server="IP proxy Server:port" (ex: --proxy-server="127.0.0.1:8080")

it's look like this (it's the same for Chrome):

enter image description here close the window and if the chrome browser is still running, then close the browser and restart again. Finally you can use chrome browser with proxy.

--proxy-bypass-list:

If you want to tell google-chrome to NOT use a proxy with specific domains use --proxy-bypass-list command. This command specifies a list of hosts for whom we bypass proxy settings and use direct connections. Ignored if --proxy-auto-detect or --no-proxy-server are also specified. This is a comma-separated list of bypass rules.

Here is List of Chromium Command Line that used in google-chrome too.

  • 1
    How do I tell google chrome to NOT use a proxy with specific domains? Something like the option No proxy for in Firefox? – becko Aug 20 '14 at 15:55
  • How would one specify the username/password when using --proxy-server? – user2813274 Jan 21 '15 at 16:50
  • 1
    @user2813274 you should use this syntax user:password@proxy:port (for an example: --proxy-server="USERhere:PASShere@127.0.0.1:8080") – αғsнιη Jan 21 '15 at 17:00
  • What is the syntax for --proxy-bypass-list? Should I just list the bypassed hosts after it? Should I use ="list"? List entries are separated by what? Semicolons? Commas? Can you add an example to your answer? – Calmarius May 22 '15 at 11:51
  • @αғsнιη can you? I thought this was not supported? (I get this error net::ERR_NO_SUPPORTED_PROXIES ) at least on Chrome,... – hayd Apr 5 at 0:57

Google Chrome and Chromium obey the environment proxy variables (http_proxy, no_proxy, etc.) and the proxies set via gsettings. gsettings comes preinstalled on [XL]ubuntu, so this is one way which doesn't need sudo privileges.

The keys org.gnome.system.proxy.http[s].{host,port,authentication-user,authentication-user} (and similar options for FTP and SOCKS proxies) and the proxy autoconfiguration key org.gnome.system.proxy.autoconfig_url can be used for this:

gsettings set org.gnome.system.proxy.http host "proxy.server.fqdn"
gsettings set org.gnome.system.proxy.http port "3128"

A proxy exception list can be set using the ignore-hosts key:

gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '::1', '*.some.domain', '10.0.0.0/8']" 

A no_proxy environment variable would look like:

export no_proxy="localhost,.some.domain,127.0.0.0/8,10.0.0.0/8"
export NO_PROXY="localhost,.some.domain,127.0.0.0/8,10.0.0.0/8"

You can set this in ~/.profile or ~/.pam_environment (without the export).

  • I have a different experience. Chrome 61.0.3163.100 on Ubuntu 17.04 doesn't seem to use http_proxy and https_proxy vars. They are set for my user in ~/.profile, which is the same user Chrome is started with, but Chrome can't connect.. – Julius Sep 27 '17 at 11:38
  • @Julius which DM? – muru Sep 27 '17 at 12:35

Just execute below command in terminal

sudo nano /usr/share/applications/google-chrome.desktop

in Command value append below line

--proxy-server="192.168.1.251:8080" 

Change it with your proxy. its example of non - authentication proxy. For a proxy with authentication one should use,

--proxy-server="username:password@proxy_address:port"
  • Very nice, and it also works with Chrome apps. – Alexandre L Telles Mar 2 '15 at 19:34
  • for chromium, the particular file is /usr/share/applications/chromium-browser.desktop and the particular setionc is Exec - you must put the proxy line into all Exec appearences across this file – ulkas Oct 22 '15 at 11:29
  • sometime chrome is stuck with waiting for proxy server. so adding --no-proxy-server option saves the day. Thanks. – Rohit Karadkar May 5 '17 at 12:34
  • The problem with this approach is that every time chromium package gets updated, desktop file is overwritten, and the setting is lost. – jesjimher Apr 9 at 7:55

For Unity: In "system settings", go to "network" then "network proxy" : you can then set your proxy system wide.

For setting user and password , set it like this : user:password@proxy:port

For Lubuntu , Xubuntu etc...: look this thread How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio?

  • I am using Lubuntu. Where do I find "System Settings"? – becko Aug 20 '14 at 15:10
  • Yep, answer was for Unity .May be you use command: export http_proxy="user:password@proxy:port" then command for chrome, in a 2 line script. – laugeo Aug 20 '14 at 15:13
  • Google Chrome is currently not taking care of system-wide proxy settings. – Anto Jan 28 '15 at 13:06
  • This, IMHO, shoudl be the accepted answer. Google will use the system proxy. – David Baucum Jan 19 '16 at 16:13

Semi-automated way

I have found @kasiya answer to be most helpful.

However, every update of Google Chrome resulted in resetting the desktop entry and proxy settings. It is quite frustrating editing it again, and again.


Instead of manual work, you can change the entry with a short script.

Simply paste it to terminal:

sudo sed '/^Exec/s/$/ --proxy-server="10.0.2.2:3128"/' /usr/share/applications/google-chrome.desktop  -i

Obviously, you need to change the IP to your proxy server.


This appends all lines starting with Exec with your proxy setting, which is the manual way of setting the proxy.

Enjoy!

  • Since Chrome/mium tends to stay semi-open in the taskbar, there's really no need to append proxy parameters to every Exec instance. Just the main one (named Chromium Web Browser) is usually enough. The rest of Exec instances are used for actions like opening a new window, which usually happen once the browser is up and running. – jesjimher Apr 9 at 8:07

How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio? points to the file /etc/environment where you can insert the following lines as root:

http_proxy=http://myproxy.server.com:8080/
https_proxy=http://myproxy.server.com:8080/
ftp_proxy=http://myproxy.server.com:8080/
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

The top answer (very elaborate) also contains a script to enable/disable on demand. (But if you need that, Firefox has an options page for choosing the proxy and you might want to consider using it).

One option I use is the Proxy SwitchyOmega extension. It allows some IP addresses or domains to be exempted, as you ask for.

It has a nice GUI instead of needing to deal with command line arguments. It also supports Chrome Sync, so you can get up and running with your proxy settings on a new computer quickly.

You can also set it up so that using the proxy can be switched on or off with a single click.

When the proxy settings are in the environment proxy variables, Chrome did not work by putting the full proxy settings on the launcher.

--proxy-server="IP proxy Server:port" (ex: --proxy-server="127.0.0.1:8080")

But it worked when I put it to detect the automatic configurations

--proxy-auto-detect

And it worked in Vivaldi.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.