Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in

Ubuntu 24.04, terminal · HTTP and SOCKS5 · 6 steps

Ubuntu Proxy Settings from the Command Line, with Username and Password

On Ubuntu a proxy with a login is one URL, the username and password before the host and the port after it, set in up to four places: export http_proxy and https_proxy for the terminal you are in, the same lines in /etc/environment for every new login, a file in /etc/apt/apt.conf.d for apt, and git config for git. curl -s https://ipinfo.io/json then shows the exit of the line. Tested in a Docker container of the official ubuntu:24.04 image (Ubuntu 24.04.5 LTS).

Set up the proxy in Ubuntu

Open Ubuntu, follow the 6 moves below and finish with the tool's own check. The values are in the table after the steps.

  1. 01

    Write the line as one URL

    Take an HTTP line from the generator and write it as a URL: http://, the username, a colon, the password, an @, the host, a colon and the port. We ran every command in a Docker container of ubuntu:24.04, the Docker Official Image (Ubuntu 24.04.5 LTS); the screenshots use the mobile line. This guide covers the command line; the desktop Settings window is not part of it. The block below holds every command of this guide with that URL in place; swap in your own username, password, host and port. Our usernames and passwords use letters, digits, hyphens and underscores, so they go into the URL as they are.

    # 1. This terminal only
    export http_proxy="http://USER-country-us-type-mobile-sid-k3f9a1b2-ttl-60m:PASS@mobile.quanticdata.io:8080"
    export https_proxy="$http_proxy" HTTP_PROXY="$http_proxy" HTTPS_PROXY="$http_proxy"
    export no_proxy="localhost,127.0.0.1"
    curl -s https://ipinfo.io/json
    
    # 2. Every new login: three lines at the end of /etc/environment
    http_proxy="http://USER-country-us-type-mobile-sid-k3f9a1b2-ttl-60m:PASS@mobile.quanticdata.io:8080"
    https_proxy="http://USER-country-us-type-mobile-sid-k3f9a1b2-ttl-60m:PASS@mobile.quanticdata.io:8080"
    no_proxy="localhost,127.0.0.1"
    
    # 3. apt: the file /etc/apt/apt.conf.d/95proxy
    Acquire::http::Proxy "http://USER-country-us-type-mobile-sid-k3f9a1b2-ttl-60m:PASS@mobile.quanticdata.io:8080";
    Acquire::https::Proxy "http://USER-country-us-type-mobile-sid-k3f9a1b2-ttl-60m:PASS@mobile.quanticdata.io:8080";
    
    # 4. git
    git config --global http.proxy "http://USER-country-us-type-mobile-sid-k3f9a1b2-ttl-60m:PASS@mobile.quanticdata.io:8080"
    
    # 5. SOCKS5, for curl
    export all_proxy="socks5h://USER-country-us-sid-k3f9a1b2-ttl-60m:PASS@residentialpremium.quanticdata.io:1080"
  2. 02

    Export it in the terminal

    Run the three export lines of part 1. They last until you close that terminal. Set the lowercase names first: with only the uppercase HTTP_PROXY and HTTPS_PROXY set, curl 8.5.0 used the proxy for an https:// address but not for an http:// one, and wget 1.21.4 did not use it at all. With http_proxy and https_proxy set, curl and wget both went through the line for http:// and https:// addresses. Hosts listed in no_proxy are reached without the proxy.

    Ubuntu 24.04 terminal: three export lines for http_proxy, https_proxy with the uppercase names and no_proxy, framed with a placeholder login, then curl to ipinfo.io returning a T-Mobile USA exit in Philadelphia with the IP hidden, and wget returning one address
    Ubuntu 24.04 terminal: three export lines for http_proxy, https_proxy with the uppercase names and no_proxy, framed with a placeholder login, then curl to ipinfo.io returning a T-Mobile USA exit in Philadelphia with the IP hidden, and wget returning one address.
  3. 03

    Keep it for every login in /etc/environment

    For every new login, add the three lines of part 2 to the end of /etc/environment, without the word export. A session that is already open does not change; a new login reads the file. In our run a second user who logged in afterwards had the three variables without typing anything, and curl from that account left through the mobile line. sudo picked them up from the file as well. We worked in a root shell; from a normal account the files under /etc need sudo.

    Ubuntu terminal: the last three lines of /etc/environment with http_proxy, https_proxy and no_proxy framed, curl from a second user returning T-Mobile USA in Philadelphia, sudo env counting three proxy variables, then git config http.proxy and git ls-remote returning a HEAD hash
    Ubuntu terminal: the last three lines of /etc/environment with http_proxy, https_proxy and no_proxy framed, curl from a second user returning T-Mobile USA in Philadelphia, sudo env counting three proxy variables, then git config http.proxy and git ls-remote returning a HEAD hash.
  4. 04

    Give apt its own file

    apt reads its proxy from its own configuration. Create /etc/apt/apt.conf.d/95proxy with the two Acquire lines of part 3, each ending with a semicolon. With the file in place, apt-get update read the four noble repositories through the mobile line.

    Ubuntu terminal: the file /etc/apt/apt.conf.d/95proxy with its Acquire::http::Proxy and Acquire::https::Proxy lines framed, a placeholder login in the URL, then apt-get update reading the four noble repositories and apt-get install curl
    Ubuntu terminal: the file /etc/apt/apt.conf.d/95proxy with its Acquire::http::Proxy and Acquire::https::Proxy lines framed, a placeholder login in the URL, then apt-get update reading the four noble repositories and apt-get install curl.
  5. 05

    Point git at the proxy

    Run the git config line of part 4. git 2.43.0 then opened its connection to github.com through mobile.quanticdata.io on port 8080, and git ls-remote returned the HEAD of a public repository. git config --global --unset http.proxy removes the setting.

  6. 06

    Use the SOCKS5 port with all_proxy

    For the SOCKS5 port, export all_proxy with a socks5h:// URL and port 1080, as in part 5; the h makes curl leave the name lookup to the proxy. curl then left through our residential line, a Charter Communications home connection in New York, and through the mobile line with its own URL. wget does not read all_proxy: keep the http:// variables of part 1 for it.

    Ubuntu terminal: export all_proxy with a socks5h URL to residentialpremium.quanticdata.io port 1080, framed with a placeholder login, then curl to ipinfo.io returning a United States exit in University Gardens, New York, with the IP hidden
    Ubuntu terminal: export all_proxy with a socks5h URL to residentialpremium.quanticdata.io port 1080, framed with a placeholder login, then curl to ipinfo.io returning a United States exit in University Gardens, New York, with the IP hidden.

Check it

curl -s https://ipinfo.io/json in the terminal where the variables are set. The ip, country and org fields must be the exit of your line; env | grep -i proxy lists what the session holds.

In our run six requests in a row through the mobile session returned the same T-Mobile USA address in Pennsylvania. To go back to a direct connection, run unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy and take the lines out of /etc/environment and the apt file. Ubuntu 24.04.5 LTS is shown.

Which program reads which setting

There is no single switch on the command line: each program looks in its own place. This is what each one did on Ubuntu 24.04.5 on 20 Nov 2026.

  • curl 8.5.0: http_proxy for http:// addresses, https_proxy or HTTPS_PROXY for https:// addresses, all_proxy for a socks5h:// URL, and no_proxy for the hosts to reach directly.
  • wget 1.21.4: the lowercase http_proxy and https_proxy.
  • apt: the Acquire lines in /etc/apt/apt.conf.d/95proxy.
  • git 2.43.0: git config --global http.proxy.
  • sudo: a variable exported by hand is dropped, sudo env showed none of them, and sudo -E keeps them. Variables that come from /etc/environment are there under sudo without -E.

Which QuanticData line to set on Ubuntu

  • Mobile: a carrier IP, T-Mobile USA in our run, for work that should look like a phone. Host mobile.quanticdata.io, HTTP 8080 or SOCKS5 1080.
  • Residential Premium: a home IP in the country you choose, with the session name and its length set in the username. Host residentialpremium.quanticdata.io, HTTP 8080 or SOCKS5 1080.
  • Residential Basic: home IPs with the host and port printed in the line, and IP whitelisting on the plan if you prefer a URL without a login.
  • ISP: one dedicated IP that never changes, for a server that must keep the same address for weeks. The line comes from the plan page.

Ubuntu proxy not working: what to check

  • curl works but wget shows your own IP: only the uppercase names are set, or only all_proxy. Export the lowercase http_proxy and https_proxy.
  • A command with sudo ignores the proxy: use sudo -E, or put the lines in /etc/environment and log in again.
  • apt does not use it: the lines are in the shell but not in /etc/apt/apt.conf.d.
  • A new terminal has no proxy: export lasts for one terminal. /etc/environment covers every new login.
  • The country is not the one you wanted: the country is part of the username (country-us). Generate a new line with the right country.
  • Still failing: log in and ask Quantic AI in the dashboard. It tests your line from our side with your own login and tells you what the gateway answered.

What to type: ports and the username

Copy the line from the dashboard (Proxies, your plan, the generator) rather than typing it: it already carries the host, the country, the session id and the session length. The table shows what each field holds.

PlanCopy it fromHTTP portSOCKS5 portUsername shape
Residential Premiumthe generator80801080USER-country-us-sid-k3f9a1b2-ttl-30m
Mobilethe generator80801080USER-country-us-type-mobile-sid-a1b2c3-ttl-30m
Residential Basicthe generatorin the linein the lineUSER-country-us plus a session for sticky
Datacenter (per GB)the generator999910000the line's username
IPv6the generator1001in the linethe line's username
ISP (dedicated IP)the plan page, one line per IPin the linein the linethe line's own login

The host and the password are in the same line. Pick HTTP or SOCKS5 in the tool and use the port of that column; a port from the other column is the most common reason a check fails. On Premium ISP city plans one port serves both types. USER and the session id stand for your own values.

Where the line comes from in the dashboard

  • QuanticData Buy proxies page, Residential tab: Residential Premium packs from $4.00 for 1 GB to 25 GB for $70.00 with the price per GB of each
    Residential and Mobile are bought by the gigabyte: Residential Premium from $4 for 1 GB down to $2.20 per GB at 500 GB.
  • QuanticData Buy proxies page, Mobile tab: packs from $5.00 for 1 GB to $1,150 for 500 GB, all valid 90 days, HTTP and SOCKS5
    Mobile: $5 for 1 GB, valid 90 days, down to $2.30 per GB at 500 GB.
  • QuanticData residential plan generator with country United States, Max pool, Sticky session of 30 minutes, HTTP, 10 sessions and the host:port:user:pass output format
    The plan page has the generator: country, pool, Sticky session with its TTL, HTTP or SOCKS5, then one line per profile in host:port:user:pass.

The whole buying flow, both routes and the prices are on the integrations page.

Ubuntu proxy questions

What customers ask when they put a QuanticData line into Ubuntu.

Something else? Ask us

How do I set a proxy with a username and password in the Ubuntu terminal?

Export one URL that holds the login, the host and the port in http_proxy and https_proxy, then run curl -s https://ipinfo.io/json. The setting lasts until the terminal is closed; the same lines in /etc/environment, without export, apply to every new login.

Should the proxy variables be lowercase or uppercase on Ubuntu?

Set the lowercase ones, and the uppercase ones too if you like. In our test on Ubuntu 24.04, with only HTTP_PROXY and HTTPS_PROXY set, curl used the proxy for https:// addresses only and wget did not use it. With http_proxy and https_proxy both programs went through the line.

How do I set a proxy for apt on Ubuntu?

Create a file in /etc/apt/apt.conf.d, 95proxy in our run, with two lines: Acquire::http::Proxy and Acquire::https::Proxy, each followed by the proxy URL in double quotes and a semicolon. apt-get update then went through our mobile line.

Why does sudo ignore my proxy on Ubuntu?

sudo starts the command with a clean environment: after a plain export, sudo env showed no proxy variable in our test. sudo -E keeps them, and variables set in /etc/environment were present under sudo without -E.

Can I use a SOCKS5 proxy from the Ubuntu command line?

With curl, yes: export all_proxy with a socks5h:// URL and port 1080. Our residential and mobile lines both answered that way. wget did not use all_proxy in our test, so it needs the http:// variables.

Give your Ubuntu machine a home or mobile exit

Create an account, take the free 100 MB residential trial or a mobile pack, generate one sticky line and export it as http_proxy.

Balance, crypto, card or PayPal · no VAT from the balance or crypto