Skip to main content
The process of setting up a proxy on Linux may vary depending on the Linux distribution. The following instructions have been tested on Centos 7.9 and Ubuntu 20.04.
In the Linux operating system, you can set up a proxy by defining environment variables. The table below lists all proxy-related environment variables.

Proxy Settings For Current User

Temporary Proxy Settings

You can simply set up proxy settings for routing HTTP and HTTPS traffic for the current user by using the following command. Don’t forget to replace username, password, proxy_server, and port with yours.
To remove proxy settings, simply use following command:
Bash
By adding the export command to the .bashrc file, you can ensure that this command is executed every time a new non-login shell is started. By default, .bashrc is sourced by .bash_profile to ensure that configurations in .bashrc are also applied to login shells.

Global Proxy Settings

Global proxy settings will affect every user in the Linux operating system. Please confirm the impact and decide whether to configure them or not..
/etc/profile contains system-wide environment settings and configurations that are applied to all users on the system. It will be executed for login shells and source every shell script under the /etc/profile.d directory.