How to Set Up a Proxy on Linux (Ubuntu, Fedora, Debian)

Configure proxies on Linux for privacy, secure browsing, or bypassing restrictions. This step-by-step guide covers GUI (GNOME/KDE), system-wide, browser, and command-line proxy settings—with troubleshooting, real code examples, and security tips. Works for Ubuntu, Debian, Fedora, and more.

Linux desktop showing terminal and network proxy setup screen, representing Linux proxy configuration

Introduction: Why Set Up a Proxy on Linux?

A proxy server acts as a go-between for your device and the internet—masking your IP, bypassing restrictions, or enhancing privacy. On Linux, you may need a proxy for secure browsing, accessing blocked content, automation, or privacy at home or work. This guide covers all major Linux distributions (Ubuntu, Debian, Fedora, Mint, Arch, and more) and desktop environments. Whether you want a system-wide proxy, a browser-only proxy, or need to configure command-line tools, you'll find step-by-step help here.

Proxy Method Coverage Best For Notes
GUI (GNOME/KDE) Most desktop apps & browsers General use, easy setup Some apps may ignore system proxy
System-wide (env vars) Most apps, CLI tools Scripted/automation, headless servers Needs manual config per user/app sometimes
Browser-specific Just that browser Firefox, privacy, testing Overrides system settings (in Firefox)
Command-line Tools curl, wget, apt, etc. Automation, scripting May need config in .bashrc or tool config

1. Set Proxy via GNOME or KDE Desktop on Linux

Most Linux desktops make proxy setup easy. Here’s how to configure proxies using GNOME (Ubuntu, Fedora, etc.) and KDE Plasma (Kubuntu, openSUSE, etc.):

GNOME (Ubuntu, Fedora, Debian, etc.)
  1. Open SettingsNetwork.
  2. Scroll down and click Network Proxy.
  3. Choose Manual to enter proxy details, or Automatic to use a PAC file.
  4. Enter your HTTP, HTTPS, FTP, SOCKS proxies as provided.
  5. Click Apply.
KDE Plasma
  1. Open System SettingsNetworkSettings.
  2. Click Proxy.
  3. Choose Manual or Automatic (PAC) mode.
  4. Fill in your proxy details, click Apply.
Pro Tip: Some apps (like Firefox or CLI tools) may ignore desktop proxy settings. See below for per-app and command-line configuration.
If proxy changes don’t take effect, try logging out and logging back in, or rebooting.

2. Linux System-wide Proxy Configuration (Environment Variables)

To make a proxy available to all apps and command-line tools, set environment variables for your user or system-wide:

  1. Open a terminal.
  2. Edit your shell profile (for current user):
    nano ~/.bashrc or nano ~/.profile
  3. Add these lines at the end, replacing values as needed:
# For HTTP/HTTPS proxy (with authentication)
export http_proxy="http://username:password@proxy.server.com:8080/"
export https_proxy="http://username:password@proxy.server.com:8080/"
export ftp_proxy="http://username:password@proxy.server.com:8080/"
export no_proxy="localhost,127.0.0.1,::1"
  1. Save and exit, then reload your profile:
    source ~/.bashrc
  2. For system-wide (all users), edit /etc/environment and add the same lines (omit export keyword).
Note: /etc/environment affects all users; ~/.bashrc is per-user. You may need to log out and back in for changes to take effect everywhere.
Common Pitfalls:
  • Use http:// or socks5:// as appropriate for your proxy type.
  • Don’t forget to include no_proxy for local addresses.
  • Don’t add export in /etc/environment; just KEY=value.
  • To check if variables are set: echo $http_proxy

3. Browser Proxy Settings (Firefox, Chrome, Chromium, etc.)

Firefox
  1. Go to Preferences (or Edit → Preferences).
  2. Scroll to Network Settings (bottom of General).
  3. Click Settings…
  4. Choose Manual proxy configuration and fill in your proxy details (HTTP/SOCKS).
  5. Click OK to save.
Chrome/Chromium
  • Uses system settings (GNOME/KDE). To use a different proxy, launch with:
    google-chrome --proxy-server="socks5://proxy.server.com:1080"
Browser Extensions
  • Extensions like FoxyProxy can manage proxies and switch profiles easily.
BrowserProxy Uses
FirefoxOwn settings panel (overrides system)
Chrome/ChromiumSystem proxy by default
OperaSystem proxy by default

4. Proxy for Command-line Tools (curl, wget, apt, etc.)

curl
  • Environment:
    export http_proxy="http://proxy.server.com:8080"
  • Command line:
    curl --proxy http://proxy.server.com:8080 https://example.com
wget
  • Edit ~/.wgetrc and add:
    http_proxy = http://proxy.server.com:8080
apt (Debian/Ubuntu)
  • Create /etc/apt/apt.conf.d/99proxy with:
    Acquire::http::Proxy "http://proxy.server.com:8080/";
Always check your tool’s documentation—some tools want http_proxy, others HTTP_PROXY (case matters for some shells).
If using sudo, make sure proxy variables are exported for the root user too, or use sudo -E to preserve environment.

Troubleshooting & FAQ: Linux Proxy Configuration

Check if you set the proxy in the right place (desktop GUI, env vars, or app-specific). Some apps ignore system proxy and need manual configuration. Double-check your proxy address, port, and authentication details. After editing environment files, log out and back in. If using a browser, ensure no conflicting extensions override your settings.

Supply your username and password in the proxy URL: http://username:password@proxy.server.com:8080. For extra security, avoid putting passwords in plain text—use environment variables only in your own user profile, or use tools that support credential prompts. Some tools (like wget) can use a .netrc file for credentials.

Visit a site like Proxy Checker Tool or WhatIsMyIPAddress after configuring your proxy. You can also run curl ifconfig.me (with your proxy active) to see if your IP changes. If you see your proxy's IP, the connection is active.

To avoid DNS leaks, use a browser that supports proxying DNS requests (Firefox with SOCKS5 and "Proxy DNS when using SOCKS v5" enabled), or configure your system DNS to a privacy-friendly provider. Test for leaks at dnsleaktest.com after setup. Most system-wide HTTP proxies do not proxy DNS by default.

Not all apps respect system proxy settings. Some (like Snap or Flatpak apps, or custom binaries) may require separate configuration. For CLI tools, check if they support http_proxy and related variables. For browsers, see if they use their own proxy settings. Always test with your target app after setup.

Usually, logging out and back in is enough for environment variable changes to take effect. For desktop GUI settings, changes should be immediate, but some apps may require a restart. For system-wide changes in /etc/environment, reboot to be sure.
Want to check if your Linux proxy works? Use our Proxy Checker Tool or Browse Premium Proxies now.
Test Your Proxy