How to Set Proxy Settings on Linux command line or Terminal

Setting a proxy on a Linux system can be useful in a variety of scenarios, such as accessing resources on a network that are restricted to specific IP addresses or protecting your privacy when connecting to the internet. There are several tools and methods available for configuring a proxy on a Linux system, and the specifics will depend on your distribution and the version of Linux you are using.

In this article, we’re going to learn how to set a proxy on Linux’s command line, Ubuntu Desktop GUI, and GNOME3.

On a Linux system, you can configure proxy settings in a few different ways using the command line.

Here are some alternatives:

  • Put environment variables in place: to specify the proxy server for HTTP and HTTPS traffic, respectively, you can set the environment variables HTTP proxy and HTTPS proxy.

Consider this:

export http_proxy=http://proxy.example.com:8080

export https_proxy=http://proxy.example.com:8080

  • Use the proxychains tool: proxychains is a tool that allows you to use a proxy with any command-line program. To use it, you'll need to edit the /etc/proxychains.conf file to specify the proxy server and any other desired settings, and then use the proxychains command to run your desired command. For example:

proxychains curl http://example.com

  • Use the apt-get tool: If you need to use a proxy to download packages with apt-get, you can specify the proxy by adding a line to the /etc/apt/apt.conf file in the following format:

Acquire::http::Proxy "http://proxy.example.com:8080";

You can also set a separate proxy for HTTPS by adding a similar line with HTTPS instead of HTTP.

 

Setting Up Proxy with Ubuntu Desktop GUI

Follow these steps to configure a proxy with Ubuntu Desktop GUI:

  1. Open the Settings app by clicking on the gear icon in the top right corner of the desktop.
  2. In the Settings app, click on the "Network" icon.
  3. In the left menu, click on the network connection that you want to configure the proxy for. If you are connected to a wired connection, it will be called "Wired." If you are connected to a wireless connection, it will be called "Wireless."
  4. Click the "gear" icon next to the network connection to open the settings for that connection.
  5. In the settings window, click on the "Proxy" tab.
  6. You have a choice between using an "Automatic " or "Manual" proxy setting on the "Proxy" tab. The PAC (Proxy Auto - Configuration) file's URL must be entered in the "URL" column if "Automatic" is your chosen option. For the "Manual" option, if used, You must provide the proxy server's IP address and port number in the " Address " and " Port " sections, respectively.
  7. If your proxy needs authentication, select the "Require authentication" checkbox, then type your username and password into the corresponding areas.
  8. To save your adjustments, use the "Apply" button.

 

Proxy Settings on GNOME3

Follow these steps to configure GNOME3's proxy settings:

  1. Start the Settings application.
  2. On the Network tab, click.
  3. To configure a network connection, click the gear symbol next to it.
  4. Click the IPv4 or IPv6 tab in the Network Settings box.
  5. Choose "Manual" from the "Method" selection.
  6. Fill out the "Address" and "Port" columns with the information for the proxy server.
  7. If necessary, fill up the "Username" and "Password" sections with a username and password.
  8. Select "Save" from the menu.
  9. Finally, close the “Settings” window.

FAQ on Proxy in Linux

Can Linux support a proxy server? 

Yes, Linux can support a proxy server by using various tools such as Squid, Apache HTTP Server with mod_proxy, or HAProxy.

What is HTTP proxy in Linux?

An HTTP proxy is a specific type of proxy that controls HTTP (Hypertext Transfer Protocol) traffic, the industry standard for connecting online browsers and web servers. HTTP proxies can be used to increase internet speed, get around censorship, or safeguard privacy.

Conclusion

In general, employing an HTTP proxy on a Linux system provides a number of advantages. By serving as a go-between for the user's device and the internet, concealing the user's IP address, and guarding against potential online dangers, it can assist to increase security. By caching frequently visited pages, it can help speed up surfing by eliminating the need for repeated queries. 

Don't waste your time nevermore on configuring proxy or VPN

Download VPN Unlimited and get a 7-day free trial + additional 30-day money-back guarantee!

other platforms

VPN Unlimited is also part of MonoDefense security bundle.