How to Configure Proxy for Chromium and Google Chrome From Command Line on Linux

In this tutorial, I will show you how to configure proxy settings of Chromium and Google Chrome browser from the command line on Linux. This little trick is very handy in some circumstances. As you may already know, the Linux version of Chromium and Google Chrome browser does not support configuring proxy in a graphical way. A Windows user can change proxy settings in Chromium and Google Chrome by going to Settings > Advanced > System and click the Change proxy settings button to configure it. However, this button on Linux is grayed out so Linux users can not change proxy in this way.

change proxy setting in Chromium and Google Chrome

Normally, users need to install extensions like Proxy SwitchyOmega in order to configure it in graphical interface. That’s Okay for most people, but it’s not convenient for those who can’t access the Chrome Web store in the first place. Google search and Chrome Web store are blocked in some countries like China.

If you use Chromium or Google Chrome browser on Linux, then you can configure proxy for your browser from the command line and you don’t have to install extensions like Proxy SwitchyOmega. Note that this tutorial assumes you have a proxy server like Shadowsocks running on a remote site.

Configure Proxy From Command Line

I use Google Chrome as an example and it applies to Chromium as well. You can start Google Chrome from the command line like below

google-chrome

To start it with proxy, use --proxy-server option. For example, run the following command to start it with socks5 proxy.

google-chrome --proxy-server="socks5://127.0.0.1:1080"

Chromium and Google Chrome support HTTP, HTTPS, socks4 and socks5 proxy. To set a HTTPS proxy, run the following command.

google-chrome --proxy-server="https://proxy-ip:proxy-port"

You can also set an alias so next time you don’t have to type a long command. To create command alias, edit .bashrc file

nano ~/.bashrc

Find the alias lines in this file and add the following alias definition to it.

alias google-chrome='google-chrome --proxy-server="proxy-scheme://proxy-ip:proxy-port"'

set up alias for chromium proxy settings

Save this file. Now close your terminal and re-open it. Then enter google-chrome command in the terminal, you will see chromium browser is now using a proxy to connect to the Internet.

Note: On Some Linux distributions such as Ubuntu, The command to start Chromium browser is chromium-browser.

Install Proxy SwitchyOmega extension

Some users can use VPN to access Chrome store and install Proxy SwitchyOmege extension, but in some area, VPN is blocked. So being able to configure proxy from the command line is very handy for those who can’t access chrome web store.

Once the proxy is working, you can go to chrome Web store and install Proxy SwitchyOmega. Notice that if you are going to use SwitchOmega, then you need to remove the proxy options specified from command line. They can’t work with each other.

I like Proxy SwitchyOmega because it has the ability to detect failed resources on web pages and this can really help web developers or webmasters.

google chrome proxy command line

Chromium and Google Chrome Browser also support proxy autoconfiguration URL with the --proxy-pac-url option. For more command line usage , see the man page.

man chromium

man google-chrome

To see how to set up your own Shadowsocks proxy server, check out the following post.

I hope this tutorial helped you configure Google Chrome and Chromium proxy from the command line on Linux. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care.

Rate this tutorial
[Total: 17 Average: 2.8]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • * Some of my previous answers are lost after I uninstalled Disqus comment system from my website. I try to recover those answers whenever I can.