DEV Community

Cover image for Configuring Proxy Settings in Ubuntu GUI & Terminal
Kev the bur
Kev the bur

Posted on

Configuring Proxy Settings in Ubuntu GUI & Terminal

How to Configure Proxy Settings in Ubuntu GUI and Terminal

When working with Ubuntu behind a proxy, setting up the right proxy configuration is essential for browsing, package management, and other network activities. Whether you prefer using the graphical interface or the command line, this guide will take you through practical steps to configure proxies on your Ubuntu system.

Configuring Proxy Settings in Ubuntu GUI & Terminal image 1

Setting Up Proxy via Ubuntu GUI

Ubuntu’s GUI makes proxy configuration straightforward and accessible without touching the terminal.

Steps to Configure Proxy in the GUI

  1. Open Network Settings

    Click the Ubuntu launcher on the left dock, then select Show applications. Type Network in the search bar and open Settings > Network.

  2. Access Proxy Settings

    Inside the Network menu, you will see options for Wired, VPN, and Network Proxy. Click on Network Proxy.

  3. Choose Your Proxy Type

    By default, proxy settings are Disabled. Switch it to Manual to enter your proxy details.

  4. Enter Proxy Details

    Fill in the proxy server details for HTTP, HTTPS, FTP, and SOCKS. For example:

   Address: gw.dataimpulse.com  
   Port: 823
Enter fullscreen mode Exit fullscreen mode

The changes are saved automatically once you close the window. Your system-wide proxy will be activated immediately.


Configuring Proxy from the Terminal

For developers and sysadmins who prefer terminal workflows, setting proxies via environment variables or configuration files is the way to go.

Temporary Proxy Settings (Current Terminal Session)

To set proxies for your current terminal session only, use the export command:

export http_proxy="http://username:password@gw.dataimpulse.com:823"
export https_proxy="http://username:password@gw.dataimpulse.com:823"
Enter fullscreen mode Exit fullscreen mode

Replace username and password with your actual credentials provided by your proxy provider.

This method affects only the active terminal session. To verify the proxy is active, run:

wget -qO- https://ip-api.com/
Enter fullscreen mode Exit fullscreen mode

This command fetches your public IP address, helping you confirm that requests route through the proxy.

Making Proxy Settings Permanent

To avoid retyping proxy settings every time a terminal opens, you can add the environment variables into your shell’s configuration file.

  • For Zsh users:
vim ~/.zshrc
Enter fullscreen mode Exit fullscreen mode
  • For Bash users:
vim ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Add these lines at the end of the file:

export http_proxy="http://username:password@gw.dataimpulse.com:823"
export https_proxy="http://username:password@gw.dataimpulse.com:823"
Enter fullscreen mode Exit fullscreen mode

Save the file and then reload it:

source ~/.zshrc  # or source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Now, the proxy settings will persist for all future terminal sessions.

Enabling Proxy for All Users

To apply proxy settings system-wide, add the same http_proxy and https_proxy variables to /etc/environment:

sudo vim /etc/environment
Enter fullscreen mode Exit fullscreen mode

Insert:

http_proxy="http://username:password@gw.dataimpulse.com:823"
https_proxy="http://username:password@gw.dataimpulse.com:823"
Enter fullscreen mode Exit fullscreen mode

Log out and back in (or reboot) for the changes to take effect.


Setting Proxy for APT Package Manager

APT handles updates and software installations and requires explicit proxy settings if you are behind one.

  1. Open the APT configuration file:
sudo vim /etc/apt/apt.conf
Enter fullscreen mode Exit fullscreen mode
  1. Add the following lines to set the proxy for HTTP and HTTPS:
Acquire::http::Proxy "http://username:password@gw.dataimpulse.com:823";
Acquire::https::Proxy "http://username:password@gw.dataimpulse.com:823";
Enter fullscreen mode Exit fullscreen mode

Save and close the file. Now, whenever you run apt update or install packages, APT will use the configured proxy.

Be sure to replace username and password with your DataImpulse proxy credentials to avoid authentication errors.


Configuring Proxy Settings in Ubuntu GUI & Terminal image 5

Why Use DataImpulse Proxies?

DataImpulse offers reliable residential proxies that work seamlessly with Ubuntu. Their proxies support HTTP, HTTPS, and SOCKS protocols and come with straightforward setup options for both GUI and terminal environments.

With flexible pricing and easy integration, it's a practical choice for developers looking to streamline proxy configurations without hassle.

You can check out more on their offerings here: DataImpulse


Configuring Proxy Settings in Ubuntu GUI & Terminal image 6

Summary

  • Ubuntu GUI allows easy proxy setup through Settings > Network > Network Proxy.
  • For temporary terminal proxy configuration, use the export command.
  • Make proxy settings permanent by adding them to shell config files like ~/.bashrc or ~/.zshrc.
  • Configure APT proxy separately for package management.
  • Use trusted proxy providers like DataImpulse to avoid connection and authentication issues.

By following these steps, you can have your Ubuntu machine smoothly working behind a proxy server whether through GUI or command-line.


Article images sourced from DataImpulse tutorials.

Top comments (0)