How to Set Up a Proxy in Linux

There is no single way to set up a proxy in Linux — everything depends on the distribution and environment. In this guide, we'll cover three methods: via environment variables (works everywhere, including Ubuntu, Debian, CentOS), via GNOME system settings (Ubuntu, Fedora), and via KDE Plasma settings (Kubuntu, openSUSE). We'll also show you how to set up SOCKS5 via an SSH tunnel and use proxychains for individual apps.

6 minutes Medium difficulty Ubuntu / Debian / Fedora / CentOS / Arch

What you'll need

Proxy credentials

IP address, port, login and password. Format: IP:port@login:password

Linux distribution

Ubuntu, Debian, Fedora, CentOS, Arch or any other modern distribution

Proxy type

HTTP, HTTPS or SOCKS5. ProxyElite supports all protocols

Root rights (sudo)

Required to install packages (curl, proxychains) and change system configurations

Step-by-step setup

Method 1: Environment variables — universal method for all distributions

1

Open the terminal

Press Ctrl + Alt + T or find "Terminal" in the applications menu. This works on any distribution: Ubuntu, Debian, Fedora, CentOS, Arch, openSUSE.

2

Set variables for the current session

Enter the commands:

export http_proxy="http://USER:PASS@IP:PORT/"

export https_proxy="http://USER:PASS@IP:PORT/"

export ftp_proxy="http://USER:PASS@IP:PORT/"

Replace USER, PASS, IP, PORT with your details from your ProxyElite account.

If the proxy has no authentication (IP-based whitelist), use the format http://IP:PORT/ without login and password.
3

Verify the variables

Enter env | grep -i proxy — all three variables with your details should be displayed.

4

Save for future sessions

Open the file ~/.bashrc (or ~/.zshrc if you use zsh) in an editor: nano ~/.bashrc. Add the same three export ... lines to the end of the file. Save (Ctrl+O, Enter) and exit (Ctrl+X).

5

Apply the changes

Run source ~/.bashrc to make the variables take effect without restarting the terminal.

6

Verify

Install curl if it's not installed: sudo apt install curl (Debian/Ubuntu) or sudo dnf install curl (Fedora). Run curl -L https://2ip.ru — the proxy IP address should be displayed.

Environment variables only support HTTP/HTTPS proxies. For SOCKS5, use Method 4 (proxychains) or an SSH tunnel. Not all apps read these variables — Chrome and Firefox on Linux have their own settings.

Method 2: GNOME system settings (Ubuntu, Fedora, Debian with GNOME)

1

Open "Settings"

Click the gear icon in the applications menu or run in the terminal: gnome-control-center.

2

Go to network

In the left menu, select "Network". Find the active connection (Wi-Fi or Wired).

3

Open proxy settings

Click the gear icon next to the connection. Go to the "Proxy" tab or find the "Network Proxy" section.

4

Select "Manual"

In the "Network Proxy" drop-down list, select "Manual" instead of "Disabled".

GNOME settings apply to apps that use GIO/GSettings: Firefox, Evolution, GNOME Web (Epiphany). Terminal utilities (curl, wget, apt) ignore these settings — use environment variables for them.
5

Enter proxy details

Fill in the "HTTP Proxy", "HTTPS Proxy", and "Socks Host" fields (if using SOCKS5). Enter the IP address and port. If authentication is needed — add login and password in the USER:PASS@IP format in the address field.

6

Apply

Click "Apply" or simply close the window — settings are saved automatically.

7

Verify

Open Firefox (it uses GNOME settings), go to 2ip.ru. The proxy IP should be displayed.

Method 3: KDE Plasma system settings (Kubuntu, openSUSE, KDE Neon)

1

Open "System Settings"

Click the KDE icon → "System Settings". Or run in the terminal: systemsettings5 (or systemsettings on newer versions).

2

Go to network

In the "Connections" section, select "Network Settings". Go to the "Proxy" tab.

3

Enable manual configuration

Select "Use specified proxy". Choose the type: HTTP, HTTPS, or SOCKS5.

4

Enter details

In the "Address" field, enter the proxy IP address. In the "Port" field — the port number. If authentication is needed — check "Authentication required" and enter the login/password.

5

Apply

Click "Apply". Settings apply to KDE apps: Konqueror, Falkon, Dolphin, Akregator.

KDE settings are stored in ~/.config/kioslaverc and apply only to KDE apps. Firefox and Chrome on KDE use their own settings — configure the proxy in the browser.

Method 4: Proxychains — for individual apps and SOCKS5

1

Install proxychains

On Debian/Ubuntu: sudo apt install proxychains4. On Fedora: sudo dnf install proxychains-ng. On Arch: sudo pacman -S proxychains-ng.

2

Open the configuration

Edit the configuration file: sudo nano /etc/proxychains4.conf (or /etc/proxychains.conf on older versions).

3

Configure the proxy

At the end of the file, find the [ProxyList] section. Add a line with your proxy: socks5 IP PORT USER PASS for SOCKS5 or http IP PORT USER PASS for HTTP. Save the file.

4

Use it

Launch the app through proxychains: proxychains4 curl https://2ip.ru or proxychains4 firefox. All the app's traffic will go through the proxy.

proxychains works at the system call level and intercepts TCP connections. This means the proxy applies only to the app launched through proxychains — other apps work directly. Ideal for fine-grained routing.

How to verify the proxy is working

Verification checklist

  1. curl -L https://2ip.ru — should show the proxy IP.
  2. env | grep -i proxy — check environment variables.
  3. Open Firefox on 2ip.ru — the proxy IP should be displayed.
  4. proxychains4 curl https://whoer.net — verify via proxychains.
  5. ping -c 3 PROXY_IP — check proxy availability (ping).

Common issues and solutions

Environment variables don't work in apt

apt uses its own configuration in /etc/apt/apt.conf.d/. Create a file 95proxies with the lines: Acquire::http::Proxy "http://USER:PASS@IP:PORT/"; and Acquire::https::Proxy "http://USER:PASS@IP:PORT/";.

Environment variables don't work in wget

wget reads ~/.wgetrc or /etc/wgetrc. Add: use_proxy=yes, http_proxy=http://USER:PASS@IP:PORT/, https_proxy=http://USER:PASS@IP:PORT/.

Chrome doesn't use the system proxy on Linux

Chrome on Linux uses its own settings. Launch with the flag: google-chrome --proxy-server="http://IP:PORT" or use the SwitchyOmega extension.

Firefox doesn't use GNOME/KDE settings

In Firefox, open about:preferences#general → Network Settings → "Settings...". Select "Use system proxy settings" or "Manual proxy configuration".

Proxy resets after restart

Make sure the variables are saved in ~/.bashrc or ~/.profile. For GNOME/KDE system settings, they are saved automatically.

proxychains doesn't work with some apps

proxychains doesn't work with statically compiled apps (for example, some Go builds). Use an SSH SOCKS5 tunnel or tun2socks for such cases.

Frequently asked questions

It depends on the task. Environment variables — for terminal utilities (curl, wget, apt). GNOME/KDE system settings — for graphical apps. Proxychains — for individual apps and SOCKS5. For browsers, configure the proxy in the browser itself or via SwitchyOmega.

Yes, but not via environment variables. Use proxychains with the socks5 type, an SSH tunnel (ssh -D 1080 user@server), or configure SOCKS5 in GNOME/KDE system settings. For browsers, SOCKS5 is configured in their own parameters.

Create a file /etc/apt/apt.conf.d/95proxies with the contents: Acquire::http::Proxy "http://USER:PASS@IP:PORT/"; and Acquire::https::Proxy "http://USER:PASS@IP:PORT/";. After that, apt will use the proxy for package downloads.

No. GNOME settings apply to GNOME apps (GIO/GSettings), KDE settings apply to KDE apps (KIO). If you use Firefox — it can read both systems, but it's better to configure the proxy directly in Firefox.

Remove the variables from ~/.bashrc and run unset http_proxy https_proxy ftp_proxy. In GNOME: Settings → Network → Proxy → "Disabled". In KDE: System Settings → Network → Proxy → "No proxy". For proxychains — just don't launch the app through it.

Yes. Use proxychains — each app can be launched with its own configuration file: proxychains4 -f /path/to/custom.conf firefox. Also, environment variables can be set only for a specific command: http_proxy=http://IP:PORT/ curl https://2ip.ru.

Need proxies for Linux?

ProxyElite IPv4 proxies with HTTP/HTTPS/SOCKS5 support. Instant delivery after payment, unlimited traffic, refund within 24 hours.

Buy proxies