Integrations menu
Device setup

Ubuntu Proxy Setup: Step by Step

To set a proxy on Ubuntu desktop, open Settings → Network → Network Proxy, choose Manual, and enter gate.proxyfield.io and port 7000 for the HTTP and HTTPS proxy. GNOME's form has no username or password fields: the browser asks for your ProxyField login on the first page, or you put your IP on the allowlist, skip the login and enter the port you set up in the dashboard instead of 7000. The terminal, Python, curl, apt and snap ignore the desktop setting; they take http://<login>:<password>@gate.proxyfield.io:7000 in /etc/environment, /etc/apt/apt.conf.d/ and snap set system. ProxyField residential proxies for Ubuntu cost from $1.95/GB ($2.95/GB for 1 GB), with a 99.6% success rate, according to our service data. Start with the Easy Trial: 1 GB for $2.95, no subscription, and the traffic never expires.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
gate.proxyfield.io:7000
What you enter on Ubuntu
WhereProxyField value
Network Proxy: HTTP Proxy and HTTPS Proxygate.proxyfield.io, port 7000 (the browser asks for your login); with the IP allowlist, the port you set up in the dashboard
Socks Hostgate.proxyfield.io with your IP on the allowlist and the port you set up in the dashboard: the field carries no login
Ignore Hostslocalhost, 127.0.0.0/8, ::1
Terminal, apt, snaphttp://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000
Username<login>-country-us-city-new_york; the optional keys are -country-<cc>, -region-<region>, -city-<city>, -session-<id> and -ttl-<seconds> (30 to 129,600 s, 20 min when ttl is left out); add -mobile or -dc right after the login for mobile or rotating datacenter IPs (-dc takes the country only)
Passwordyour ProxyField password; the username and password are in your account, where the configurator generates as many proxy lines as you need; in a URL, percent-encode @, : and /
SOCKS5 in the terminalHTTP, HTTPS and SOCKS5 run on the same host and port, with the same username and password; write socks5h:// so the gateway resolves the site's name
No password on diskadd the machine's public IP to the allowlist (up to 100 IPv4 addresses), drop <login>:<password>@ and use the port you set up in the dashboard
IP behavioura new IP on every request, or one IP for 30 s to 36 h with -session-<id>-ttl-<seconds>
Threadsunlimited concurrent threads
Headersthe gateway adds no Via, X-Forwarded-For or Forwarded header; the headers Firefox, apt and your tools send pass through; your Proxy-Authorization is removed before the request goes to the site

Set up Ubuntu with ProxyField

  1. Open Settings → Network → Network Proxy and set it to Manual.
  2. Enter gate.proxyfield.io and 7000 in HTTP Proxy and HTTPS Proxy, and keep Ignore Hosts.
  3. Load https://api.ipify.org in Firefox and enter your ProxyField username and password when the browser asks.
  4. For the terminal, apt and snap, set the proxy URL in /etc/environment, /etc/apt/apt.conf.d/95proxy and snap set system (sections 2 to 4).

For apt, the same values in /etc/apt/apt.conf.d/95proxy:

Acquire::http::Proxy "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000/";
Acquire::https::Proxy "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000/";

GNOME's own guide to the Network Proxy panel that Ubuntu desktop uses: Define proxy settings (GNOME Help).

What to buy for an Ubuntu server: rotating residential proxies for scrapers and data collection, mobile 5G/4G ($3.45/GB for 1 GB down to $2.45/GB) for checks of what phone users see, a dedicated ISP IP for a fixed address, and datacenter for bulk jobs on sites that accept it. Residential and mobile run over HTTP, HTTPS and SOCKS5 on gate.proxyfield.io:7000 with a username and password; with the IP allowlist, on the port you set up in the dashboard. Put the server's fixed public IPv4 on the allowlist and no password sits on disk.

What you check before you buyProxyField
SOCKS5Yes, on the same host and port as HTTP and HTTPS, with UDP over SOCKS5 on residential
AccessUsername and password, or an IP allowlist
Rotating or fixedA new IP per request, sticky sessions from 30 s to 36 h, or a dedicated ISP IP for 30 days
ConcurrencyUnlimited concurrent threads
Countries195+ countries, 21,000+ cities
BillingPer GB, no subscription; the traffic never expires

Labels can differ slightly between versions.

Which Ubuntu proxy setting reaches what

SettingFirefox, Chrome, GNOME appsTerminal tools and Python (curl, wget, pip, git, requests)aptsnap
Settings → Network → Network Proxyyesnonono
/etc/environment or ~/.bashrcapps started after the next login may read ityesnono
/etc/apt/apt.conf.d/95proxynonoyesno
snap set system proxy.http/httpsnononoyes
On this page 13 sections

1. Set the proxy in Ubuntu desktop settings

  1. Open Settings → Network.
    Screenshot Ubuntu Settings, Network page with the Network Proxy row
  2. Select Network Proxy (on 22.04, the gear next to it).
  3. Turn it on, or set Method / Configuration to Manual.
    Screenshot Ubuntu Network Proxy dialog with Manual configuration
  4. Enter gate.proxyfield.io and 7000 in HTTP Proxy and HTTPS Proxy.
  5. In Ignore Hosts, keep localhost, 127.0.0.0/8, ::1, and close the window; it saves at once.
  6. Open Firefox and load https://api.ipify.org. When the browser asks for the proxy's username and password, enter your ProxyField credentials. The page shows the proxy's IP.

To skip the login prompt, add your network's public IP to the allowlist in your ProxyField account and, in step 4, enter the port you set up in the dashboard instead of 7000. With the IP allowlist, the product, location and session are set per port in the dashboard.

The same setting from a terminal, with gsettings:

Shell
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http host 'gate.proxyfield.io'
gsettings set org.gnome.system.proxy.http port 7000
gsettings set org.gnome.system.proxy.https host 'gate.proxyfield.io'
gsettings set org.gnome.system.proxy.https port 7000
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '::1']"

gsettings set org.gnome.system.proxy mode 'none' turns it off.

2. A system-wide proxy for the terminal

Add plain KEY=value lines to /etc/environment with sudo nano /etc/environment, then log out and back in:

http_proxy="http://<login>:<password>@gate.proxyfield.io:7000"
https_proxy="http://<login>:<password>@gate.proxyfield.io:7000"
no_proxy="localhost,127.0.0.1,::1"
HTTP_PROXY="http://<login>:<password>@gate.proxyfield.io:7000"
HTTPS_PROXY="http://<login>:<password>@gate.proxyfield.io:7000"
NO_PROXY="localhost,127.0.0.1,::1"

For your user only, put export lines in ~/.bashrc instead. Test with curl https://api.ipify.org. If your password contains @, : or /, percent-encode it in the URL (@ becomes %40): see proxy authentication. /etc/environment is readable by every user; on a shared machine, use the IP allowlist: drop <login>:<password>@ and use the port you set up in the dashboard instead of 7000. The details of each variable are on Linux proxy setup, and curl's own options on cURL with a proxy.

3. apt through the proxy

apt ignores both the desktop setting and your shell. Create /etc/apt/apt.conf.d/95proxy:

Shell
sudo tee /etc/apt/apt.conf.d/95proxy >/dev/null <<'EOF'
Acquire::http::Proxy "http://<login>:<password>@gate.proxyfield.io:7000/";
Acquire::https::Proxy "http://<login>:<password>@gate.proxyfield.io:7000/";
EOF
sudo apt update

Delete the file to stop. apt is simplest with the HTTP proxy shown here. Every package downloaded through the proxy counts as traffic, so for large upgrades on a machine that doesn't need another IP, let apt connect directly.

4. snap through the proxy

snapd runs as a service and reads its own setting:

Shell
sudo snap set system proxy.http="http://<login>:<password>@gate.proxyfield.io:7000"
sudo snap set system proxy.https="http://<login>:<password>@gate.proxyfield.io:7000"

To remove the proxy from snap later, run this on its own:

Shell
sudo snap unset system proxy.http proxy.https

Other services (Docker, your own) take Environment= lines in a systemd drop-in, as shown on Linux proxy setup.

5. Ubuntu Server, without a desktop

On a server there is no GNOME setting: use the apt file (section 3), snap (section 4) and systemd Environment= lines for services. /etc/environment (section 2) is readable by every user, so put no password in it: allowlist the server's IP in your ProxyField account and use http://gate.proxyfield.io:<port> without <login>:<password>@, where <port> is the port you set up in the dashboard, or keep the login only in root-only files such as the apt file or a systemd drop-in (sudo chmod 600).

Ubuntu Pro. The Pro client keeps its own proxy settings, which the apt file and the environment don't set. Set them with sudo pro config set http_proxy=http://<login>:<password>@gate.proxyfield.io:7000 and sudo pro config set https_proxy=http://<login>:<password>@gate.proxyfield.io:7000, and check with sudo pro config show (Canonical's Pro client proxy guide).

6. A Python scraper on an Ubuntu server

Python's requests takes the proxy as a URL with the login in it, or reads https_proxy from the environment (section 2) with no code change. Set up a virtual environment first: on Ubuntu 24.04, pip install outside one stops with error: externally-managed-environment.

Shell
sudo apt install python3-venv
python3 -m venv ~/scraper && source ~/scraper/bin/activate
pip install requests
export PF_LOGIN='<login>' PF_PASSWORD='<password>'
Python
import os
from urllib.parse import quote

import requests

login = quote(os.environ["PF_LOGIN"], safe="")        # percent-encodes @, : and /
password = quote(os.environ["PF_PASSWORD"], safe="")
proxy = f"http://{login}-country-us:{password}@gate.proxyfield.io:7000"

resp = requests.get("https://api.ipify.org",
                    proxies={"http": proxy, "https": proxy}, timeout=30)
print(resp.status_code, resp.text)                    # 200 and the proxy's IP
  • One IP per worker. Give each worker its own sticky session, such as {login}-country-us-session-worker3-ttl-600, so parallel jobs on one server keep separate IPs for 10 minutes; leave the session out for a new IP on every request.
  • SOCKS5. pip install "requests[socks]" and use socks5h:// instead of http://; the same login works.
  • As a service. Keep PF_LOGIN and PF_PASSWORD in a root-only file (sudo chmod 600 /etc/scraper.env) and load it with EnvironmentFile=/etc/scraper.env in the systemd unit, so the password is not in your code or in ps output.
  • No password at all. Allowlist the server's IP and use http://gate.proxyfield.io:<port>, where <port> is the port you set up in the dashboard.

More on requests: Python requests with a proxy and Python proxies.

7. SOCKS5 on Ubuntu

The desktop's Socks Host field sends GNOME apps through a SOCKS5 proxy, but carries no login, so it works with your IP on the allowlist and the port you set up in the dashboard. In the terminal, export all_proxy="socks5h://<login>:<password>@gate.proxyfield.io:7000" works for curl and many tools, and proxychains4 covers programs that ignore it (sudo apt install proxychains4). SOCKS5 takes the same username and password, and residential proxies carry UDP over SOCKS5 (HTTP/3, QUIC). Ubuntu has no single setting that forces every program through SOCKS5. More on the protocol: SOCKS5 proxies.

8. Verify the proxy on Ubuntu

  1. Firefox: https://api.ipify.org shows the proxy's IP.
  2. Terminal: env | grep -i proxy, then curl -s https://api.ipify.org and curl -s https://ipinfo.io/json.
  3. apt: apt-config dump | grep -i proxy shows the proxy apt will use.
  4. snap: snap get system proxy.
  5. To test proxy lines before you use them, use the proxy checker: up to 100 proxies per check; your list and results are not stored.

9. Turn the proxy off

Set Network Proxy to off (or Disabled) in Settings, remove the lines from /etc/environment and ~/.bashrc, delete /etc/apt/apt.conf.d/95proxy, and run sudo snap unset system proxy.http proxy.https. Log out and in so the environment clears.

Fix Ubuntu proxy errors

SymptomLikely causeFix
Firefox works, the terminal doesn'tThe desktop setting doesn't reach the terminalSection 2
apt update hangs or failsapt has no proxy file, or it has a typoSection 3; check quotes and the trailing /
The browser or curl keeps asking for proxy credentialsThe login was not sent, or a special character in the password broke the URLPut <login>:<password>@ in the URL with @ written as %40, or use the IP allowlist instead of a login
sudo commands skip the proxysudo resets the environmentsudo -E, or the apt and snap settings above
snap install times outsnapd has no proxySection 4
pip install fails with externally-managed-environmentUbuntu 24.04 protects the system PythonSection 6: use a virtual environment
Chrome ignores the proxyStarted with its own flags, or a proxy extension is activeRemove the flag or extension; Chrome follows the GNOME setting by default
Some sites won't loadThe site blocks the IP, or a restricted categorySome site categories are restricted to protect the network, including financial and government services

Gateway error messages: 407 Proxy Authentication Required for a wrong login or password, an IP not on the allowlist or a malformed location, 402 Payment Required when no traffic is left and 502 Bad Gateway when no exit could be connected; a restricted site gets no separate response, and a 403 comes from the site itself. Status codes are explained in proxy errors. Our 24/7 live chat helps with setup and integration.

Which proxies to use on Ubuntu

What you runProxyProtocolsAccessPrice
Scrapers and data collectionRotating residentialHTTP, HTTPS, SOCKS5Username and password, or IP allowlist$2.95/GB for 1 GB, from $1.95/GB
Checks of what phone users seeMobile 5G/4GHTTP, HTTPS, SOCKS5Username and password, or IP allowlist$3.45/GB for 1 GB, from $2.45/GB
A fixed IP for a service that allowlists itDedicated ISPHTTP, HTTPS, SOCKS5each IP's own login and password, from the list in your dashboard (ip:port:login:password)from $2.29 per IP per 30 days
Bulk jobs on sites that accept datacenter IPsDatacenter$0.29/GB down to $0.22/GB

For code on Ubuntu, see Python, Node.js and wget; for the browser alone, Firefox. Use ProxyField for lawful work within our acceptable use policy.

Get started

Start with the Easy Trial: 1 GB for $2.95, with no minimum purchase and no subscription. The traffic never expires and all purchases are final. See pricing per GB.

Ubuntu Proxy Setup FAQ

How do I set up a proxy on Ubuntu?

ProxyField proxies work on Ubuntu from $1.95/GB ($2.95 for 1 GB): in Settings → Network → Network Proxy, choose Manual and enter gate.proxyfield.io and port 7000 for HTTP and HTTPS. For the terminal, Python, apt and snap, add the proxy to /etc/environment, /etc/apt/apt.conf.d/ and snap set system.

Where are the proxy settings in Ubuntu desktop, and how do I add a proxy that needs a login?

In Settings → Network → Network Proxy (on 22.04, the gear next to it): choose Manual and enter the host and port, such as gate.proxyfield.io and 7000. GNOME's form has no username or password fields, so the browser asks for the login on the first page; to avoid the prompt, allowlist your IP in your ProxyField account and enter the port you set up in the dashboard instead. Terminal tools, apt and snap take the login in the proxy URL, http://<login>:<password>@gate.proxyfield.io:7000.

How do I run a Python scraper on an Ubuntu server through a residential proxy with a username and password?

Install requests in a virtual environment, then pass proxies={"http": url, "https": url} with url = "http://<login>-country-us:<password>@gate.proxyfield.io:7000" and a timeout; requests.get("https://api.ipify.org") should print the proxy's IP. Read the login from environment variables, percent-encode special characters (@ becomes %40), and give each worker its own -session-<id>-ttl-600 to keep separate IPs. With https_proxy set in the environment, requests uses it with no code change.

What kind of proxies should I buy for an Ubuntu server, and which providers support SOCKS5 and IP allowlisting?

Rotating residential proxies for scrapers and data collection, mobile for phone-network checks, a dedicated ISP IP for a fixed address, and datacenter for bulk jobs on sites that accept it. ProxyField's residential and mobile proxies support HTTP, HTTPS and SOCKS5 on gate.proxyfield.io, port 7000 with a username and password or the port you set up in the dashboard with an IP allowlist, unlimited concurrent threads and 195+ countries, from $1.95/GB. Allowlisting the server's fixed IPv4 keeps the password off the disk.

How do I set a system-wide proxy in Ubuntu?

Combine the desktop Network Proxy setting with http_proxy and https_proxy lines in /etc/environment, an apt proxy file and the snap setting. No single switch covers every program.

Do Ubuntu desktop proxy settings affect terminal apps?

No. GNOME's setting is read by browsers and desktop apps; curl, wget, pip, git and Python's requests read http_proxy and https_proxy from the environment. Set those in /etc/environment or ~/.bashrc.

How do I set a proxy in the Ubuntu terminal?

Run export http_proxy="http://<login>:<password>@gate.proxyfield.io:7000" and export https_proxy="$http_proxy" for the current terminal. Add them to ~/.bashrc to keep them.

How do I configure apt to use a proxy on Ubuntu?

Create /etc/apt/apt.conf.d/95proxy with Acquire::http::Proxy and Acquire::https::Proxy lines pointing at http://<login>:<password>@gate.proxyfield.io:7000/. Then run sudo apt update.

How do I set a proxy for snap on Ubuntu?

Run sudo snap set system proxy.http="http://<login>:<password>@gate.proxyfield.io:7000" and the same for proxy.https. snap get system proxy shows the result.

How do I enter a proxy username and password on Ubuntu?

Not in GNOME's form, which has no login fields: browsers ask for it on the first page. In the terminal, apt and snap, put it in the proxy URL as <login>:<password>@, with special characters percent-encoded, or allowlist your IP, skip the password and use the port you set up in the dashboard.

Show 12 more questionsShow fewer questions

Does Ubuntu support SOCKS5 proxies?

Yes: the desktop has a Socks Host field, terminal tools read all_proxy="socks5h://...", and proxychains covers the rest. The desktop field carries no login, so use the IP allowlist there, with the port you set up in the dashboard.

Can Ubuntu use SOCKS proxies everywhere?

Not with one setting. GNOME apps use Socks Host, many CLI tools use all_proxy, apt needs an HTTP proxy, and programs with no proxy support need proxychains.

What is the safest way to store proxy credentials on Ubuntu?

Avoid them: allowlist the machine's IP in your ProxyField account, and no password is stored. Otherwise keep them in files only you or root can read, such as ~/.bashrc or a systemd EnvironmentFile with chmod 600, not in world-readable /etc/environment or in your scraper's code.

How do I verify the proxy on Ubuntu?

Load https://api.ipify.org in Firefox and run curl -s https://api.ipify.org in a terminal; both should show the proxy's IP. snap get system proxy and env | grep -i proxy show the other settings.

Do the steps differ on Ubuntu 22.04 and 24.04?

Only on the desktop and for pip: 24.04 has a Network Proxy switch with a configuration menu, while 22.04 opens a dialog from a gear icon, and 24.04 needs a virtual environment for pip install. The terminal, apt and snap settings are the same on both.

Can I use proxies on Ubuntu Server without a desktop?

Yes: use /etc/environment for CLI tools, an apt proxy file, the snap setting, systemd Environment= lines for services and pro config set for the Ubuntu Pro client. Allowlisting the server's IP keeps passwords off the disk.

How do I run a proxy server on Ubuntu?

Install a proxy such as Squid or Tinyproxy with apt and point clients at the server. Its traffic still leaves from your server's own IP; for other IPs and locations, connect to a provider's gateway instead.

Can I use rotating proxies with Ubuntu?

Yes. Point any setting at ProxyField's gateway and each request gets a new IP; a session id in the username keeps one IP for 30 s to 36 h.

Will a proxy slow down my Ubuntu apt updates or downloads?

Each download takes one more hop, and every gigabyte through the proxy counts as traffic. Let apt connect directly unless the machine must reach mirrors from another IP.

Why use residential proxies instead of datacenter ones on Ubuntu?

For scraping and checks on sites that limit datacenter IPs: residential IPs from home ISPs pass where those don't. For bulk jobs on sites that accept datacenter IPs, datacenter proxies cost from $0.22/GB.

What is a proxy in Ubuntu?

A server that Ubuntu's apps send their traffic through, set in Network settings, the environment or a program's config. Sites then see the proxy's IP and location instead of the machine's.

How do I turn off the proxy in Ubuntu?

Switch Network Proxy off in Settings, remove the proxy lines from /etc/environment and ~/.bashrc, delete the apt proxy file, and run sudo snap unset system proxy.http proxy.https. Log out and in to clear the environment.

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.