If you are a new user of ubuntu and in your organization a proxy server for internet access. you need to set proxy in your ubuntu operating system use the following steps.

There are various ways of configuring Proxy settings on Ubuntu operating systems. The graphical interface can be used, or all settings are done on the command line. In this guide, we will consider both methods.

Set System Proxy on GUI

1. Go to “Show Applications” and type in “Settings”.

2. Click the “Settings” icon.

3.  Click the Network tab.

3. Click the “Network Proxy” tab.

4. In the appropriate text fields, enter your proxy server’s hostname or IP address. Ensure you change the port number to match your proxy server’s, too.

Set System Proxy settings using CLI

This will ensure the settings apply to all logged-in users. For the system proxy settings use command
sudo nano  /etc/profile.d/proxy.sh
Set the value and save the file using ctrl +x and press y.


Add other IPs if you want to exclude from proxy to NO_PROXY & no_proxy environment variable.
execute following command.
Type command sudo chmod +x  /etc/profile.d/proxy.sh and press enter. 


Type command source /etc/profile.d/proxy.sh and press enter. 

Type command env | grep -i proxy and press enter. 


Set proxy for APT package manager

The above mention settings will work for Applications and command-line tools. If you want to set proxy only for the APT package manager. use the following steps.
Type command sudo nano /etc/apt/apt.conf.d/proxy and press enter.

Set the value and save the file using ctrl +x and press y.

Acquire::http::proxy “”;
Acquire::https::proxy “”;
Acquire::ftp::proxy “”;

Replace with your proxy server IP address. If Authentication is required, use the following steps and type username and password.

Acquire::http::proxy “http://<username>:<password>@<proxy>:<port>/”;
Acquire::https::proxy “https://<username>:<password>@<proxy>:<port>/”;
Acquire::ftp::proxy “ftp://<username>:<password>@<proxy>:<port>/”;

Set Proxy for wget only

first install vim using command sudo apt install vim and press enter.

For set the proxy settings for use with wget command, add them to ~/.wgetrc file.


Press i for insert the value, type the value and save the file using ESC :wq

use_proxy = on
http_proxy = 
https_proxy = 
ftp_proxy =

That should do it. Now go and test your Internet connection to see if you can browse.

Applications that use the network connection will use your specified proxy settings.