Back to blog

How to Use Wget With a Proxy: Configuration, Authentication, and Troubleshooting

Wget is a great tool for quickly downloading files or other web content, but you can also run into IP bans or geo-restrictions while using it. A simple way to bypass this limitation is to pair your setup with a proxy server. Instead of connecting directly to a website, wget then sends your requests through a proxy, which can help you stay under the radar and avoid getting blocked.

TL;DR

  • Wget supports HTTPHTTPS, and FTP downloads and is reliable on unstable networks
  • Route Wget through a proxy to reduce the likelihood of blocks and improve reliability
  • Configure a proxy with Wget in three ways: command-line options, .wgetrc, or environment variables
  • For authenticated proxies, use --proxy-user and --proxy-password and avoid hard-coding credentials
  • Use no_proxy for hosts that must bypass the proxy
  • Wget doesn't support SOCKS5 natively; use proxychains or torsocks, or switch to curl
  • Rotating proxies helps reduce blocks and improve success rates at scale 
  • When proxy issues occur, check for common causes, such as incorrect credentials, timeouts, SSL interception, or 403 blocks

What is Wget?

Wget (short for web get) is an open-source CLI utility from the GNU Project. It's commonly used to fetch files over HTTP, HTTPS, and FTP.

Compared with many alternatives, Wget is strong for long-running downloads because it retries automatically and resumes partial files in the event of slow or unstable network connections.

You can also use Wget to interact with REST APIs without having to install any additional external programs. Wget is most commonly used on Linux and Unix servers, but you can also install it on macOS and Windows.

Installing Wget across operating systems

Some Linux distributions include Wget by default. But if you are running macOS or Windows, you'll probably need to install it. Check whether wget is already installed:

which wget

If you see an output like this, that means wget is already installed.

/usr/bin/wget

If you don't have Wget installed, you can download it on pretty much any operating system, including the big three (Windows, Mac, and Linux). 

You can also download it directly from the GNU project website and install it manually, but using a package manager is usually far more convenient. Follow along to install wget on your operating system.

Install Wget on Linux

Most Linux distributions come with wget pre-installed. If yours doesn't, or if you need to reinstall it, use the package manager for your distribution.

If you're using a Debian-based distro like Ubuntu, install Wget using apt:

sudo apt-get install wget

If you're running a distro that uses YUM, use:

sudo yum install wget

For newer distros that use DNF, run:

sudo dnf install wget

As for ZYpp, you can install it like this:

sudo zypper install wget

And for Arch Linux users:

sudo pacman -S wget

Install Wget on macOS

MacOS does not ship with wget out of the box. The easiest way to install it on a Mac is using Homebrew.

brew install wget

If you don't have Homebrew installed, head over to brew.sh and install it before running the command.

Install Wget on Windows

If you're on Windows, you can download the Wget Windows binaries manually, but using Chocolatey is usually easier. Chocolatey is a package manager for Windows, just like Homebrew on Mac.

Note: Before running these commands, make sure you run your Command Prompt or PowerShell terminal as an administrator.

choco install wget

Another option is to install Windows Subsystem for Linux (WSL) and run sudo apt install wget inside the Linux environment.

Verify your installation

Once the installation finishes, confirm everything worked by checking the version:

wget --version

Wget basics: Syntax and essential commands

Once it's installed and ready to go, we can start using it right away. But before that, let's quickly cover some basic Wget commands that'll come in handy.

Basic syntax

The general structure is:

wget [options] [URL]

[OPTIONS] are the optional flags or parameters that can customize Wget's behavior, while [URL] is simply the URL of the file you want to download.

The Wget help command (wget -h) shows all available flags. However, let's look at some of the most commonly used ones and what they do:

  • -c continues an interrupted download
  • -q runs in quiet mode
  • -O FILE saves to a custom filename
  • -r enables recursive downloading
  • -P DIR saves files to a specific directory

For the full option list, see the GNU Wget manual

Downloading files

One of the most basic command examples is downloading a single file and storing it in your current working directory. For example, you can download the latest version of WordPress by using the following command:

wget https://wordpress.org/latest.zip

You'll see an output as below, and the file will be saved under the same name it has on the server, in your current working directory:

--2026-02-27 08:48:34-- https://wordpress.org/latest.zip
Resolving wordpress.org (wordpress.org)... 198.143.164.252
Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28685823 (27M) [application/zip]
Saving to: 'latest.zip'
latest.zip 100%[===================>] 27.36M 251KB/s in 2m 4s
2026-02-27 08:50:42 (225 KB/s) - 'latest.zip' saved [28685823/28685823]

You'll also see extra information, such as the download progress, speed, size, time, and date.

Downloading multiple files (-i)

We can take one step further and download multiple files at once. To do this, just pass multiple URLs:

wget https://wordpress.org/latest.zip https://fsn1-speed.hetzner.com/100MB.bin

You can also create a text document and place the URLs inside it. The .txt file could look like this:

https://wordpress.org/latest.zip
https://fsn1-speed.hetzner.com/100MB.bin
https://www.gnu.org/licenses/gpl-3.0.txt

Use the -i flag to download everything in the file: 

wget -i urls.txt

Once the download finishes, you'll have downloaded multiple files with wget.

Download to a specific directory (-P)

If you want to specify the download destination or directory, you can easily accomplish this with the –P flag:

wget -P documents/archives/ https://wordpress.org/latest.zip

The file you retrieve using this syntax will appear in the documents/archives/ folder.

Save with a custom filename (-O)

To save a file under a different name with Wget, use the -O flag:

wget -O wordpress-install.zip https://wordpress.org/latest.zip

The downloaded resource will be saved as wordpress-install.zip instead of its original name. The -O option makes working with archives easier, as you don't need to retype long filenames.

Quiet mode for scripts (-q)

When you're running downloads in scripts or cron jobs, you may not want progress output in your logs. Quiet mode suppresses most output:

wget -q https://wordpress.org/latest.zip

Continue interrupted downloads (-c)

Sometimes your download can get interrupted, or your internet connection is unstable. Instead of starting over, it's possible to continue the download using the -c flag:

wget -c https://www.gnu.org/licenses/gpl-3.0.txt

Bravo! You just extracted your first web content using wget.

Setting a custom user agent

Your browser sends a data string known as the user agent to the target website every time you visit it. This user agent string contains information about your browser and operating system.

Web servers receive a user agent header on each request. This user agent string contains information about your browser and operating system. 

Wget has its own default user agent, which can be easily detected in anti-bot setups, so you must spoof your user agent when using Wget to reduce the risk of being blocked or banned. 

To visualize this, first check the default Wget user agent:

wget -qO- https://httpbin.io/user-agent

You should get the following response:

{
"user-agent": "Wget/1.25.0"
}

The default value is wget/1.25.0, which isn't a real browser user agent. Here's what a valid browser (Chrome) user agent looks like:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

There are two ways to set the Wget user agent: by specifying the user_agent option in your .wgetrc config file or using the --user-agent flag in your request.

To use the --user-agent flag directly via the terminal, run the following command:

wget -qO- --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" https://httpbin.io/user-agent

This command outputs the following:

}
"User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
}

If you'd like to modify the user agent permanently, you can change the configuration in the .wgetrc file. Create a .wgetrc file in your project root directory and add the user agent string to the file:

user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"

Run your request with the configuration file:

wget --config ./.wgetrc -qO- https://httpbin.io/user-agent

Why the user agent matters for avoiding blocks

  • It can reduce quick bans
  • It helps your bots blend in with normal traffic

You can also use wget to extract links directly from a webpage. This feature is quite handy for crawling pages or collecting URLs for later downloads.

To quickly demo this and save the crawl output to a log file, run the following command:

wget --spider --recursive --output-file=links.log https://www.gnu.org/software/wget/manual/

Using Wget to retrieve whole websites

You can also use the Wget command to download the content of an entire site. This lets you view the site locally without an internet connection.

wget --mirror --convert-links --page-requisites --no-parent -P documents/websites/ https://www.adidas.com/us/men-shoes

The –mirror flag makes your download recursive, while –convert-links rewrites links so the site works offline. The --page-requisites flag downloads page assets like CSS, JS, and images, and finally, the --no-parent prevents wget from crawling up to parent directories.

Scrape without getting blocked

Decodo's residential proxies rotate IPs automatically so your scrapers stay under the radar.

Once the process finishes, you'll be able to open the downloaded website locally and find all the files in the documents/websites/ folder.

Sometimes you may want to retrieve information from just one page instead. Run this:

wget --page-requisites --html-extension --convert-links https://www.gnu.org/licenses/gpl-3.0.html

You'll get an offline clone of that single page that actually looks and works like the online one.

How to configure Wget with a proxy

Before we configure a proxy, let's first confirm what your current IP address looks like. A quick way to do that is to request an endpoint that returns your public IP.

To see your current public IP, run:

wget -qO- https://httpbin.io/ip

The value of the origin key is your IP address. You'll get an output similar to this:

{
"origin": "1102.90.117.223:9236""
}

Now, let's use a proxy and see if the IP address changes. If you don't yet have a proxy, you can sign up for Decodo and activate a 7-day free trial to follow along.

Method 1: Command-line options

The fastest way to use a proxy with Wget is by using the -e flag, which lets you set configuration options directly in the command line.

Let's see a quick example:

wget -e use_proxy=yes -e https_proxy=http://gate.decodo.com:10000 -qO- https://httpbin.io/ip

Please note that your proxy should be in this format:

<PROXY_PROTOCOL>://<PROXY_IP_ADDRESS>:<PROXY_PORT>

Some proxy servers, especially premium proxies, require client authentication before granting access. In that case, your Wget proxy setup will require you to specify a username and password when connecting to the proxy server. 

You can do this by passing the --proxy-user and --proxy-password options to wget, alongside your proxy settings:

wget --proxy-user="USERNAME" --proxy-password="PASSWORD" -e use_proxy=yes -e http_proxy="http://gate.decodo.com:10000" -e https_proxy="http://gate.decodo.com:10000" -qO- https://httpbin.io/ip

You can also use the --proxy flag as a shorthand for enabling or disabling proxy use:

# Enable proxy
wget --proxy=on -e http_proxy="http://gate.decodo.com:10000"https://wordpress.org/latest.zip
# Disable proxy for this run
wget --proxy=off https://wordpress.org/latest.zip

Method 2: Creating a config file

The second method of Wget proxy integration is to use a .wgetrc config file. This file stores proxy configuration, which wget then reads before it runs.

If you use a proxy regularly, you can save a few minutes by storing it in a config file. Create a config file .wgetrc in your current directory and add the following to it:

use_proxy = on
http_proxy = http://HOST:PORT
https_proxy = http://HOST:PORT
proxy_user = username
proxy_password = password

To set the proxies as a global configuration that applies to all users, you can use the system config file at /etc/wgetrc instead. This way, even if you turn off your computer, Wget still uses the same proxy settings for your next session.

Note that this approach requires root access and is typically applicable only on Linux or Unix-like systems. Check if your IP address has changed to the proxy server's IP:

wget --config ./.wgetrc -qO- https://httpbin.io/ip

Method 3: Environment variables

Environment variables are one of the cleanest ways to use wget with a proxy because you set them once, and Wget picks them up automatically. This is useful in containerized environments, CI/CD pipelines, and shell scripts where you want consistent behavior without editing config files.

Linux/macOS

export http_proxy="http://HOST:PORT"
export https_proxy="http://HOST:PORT"
export ftp_proxy="http://HOST:PORT"

Windows (CMD)

$env:http_proxy="http://HOST:PORT"
$env:https_proxy="http://HOST:PORT"
$env:ftp_proxy="http://HOST:PORT"

The export command makes the variables available to programs you run from that terminal session. If you want to persist Linux/macOS variables in your shell profile:

  • Bash: .bashrc or .bash_profile
  • Zsh: .zshrc

Let's see an example in Linux/macOS:

echo 'export http_proxy="http://HOST:PORT"' >> ~/.bashrc
echo 'export https_proxy="http://HOST:PORT"' >> ~/.bashrc
echo 'export ftp_proxy="http://HOST:PORT"' >> ~/.bashrc
source ~/.bashrc

Using no_proxy 

Sometimes you don't want wget to use a proxy for certain hosts, like internal services, local dev machines, or virtual machine instances. That's where the no_proxy flag comes in handy.

To set up a no_proxy instruction, use the following command:

Linux/macOS

export no_proxy="localhost,127.0.0.1,.internal.company.com"

Windows (PowerShell)

$env:no_proxy="localhost,127.0.0.1,.internal.company.com"

This way, wget will skip the proxy for anything that matches the no_proxy list and use the proxy for everything else.

Choosing the setup

All three proxy setup methods work well with Wget. However, the best choice comes down to how often you use proxies with Wget and whether you need the settings to persist.

Scenario

Best method

One-off test

Command-line options

Regular local use

.wgetrc file

CI/CD or containers

Environment variables

Proxy bypass for internal hosts

no_proxy

HTTP, HTTPS, and SOCKS5 proxies with Wget

There are different types of proxy protocols, and among the popular ones today are HTTP, HTTPS, and SOCKS5.

Wget supports HTTP, HTTPS, and FTP proxy settings out of the box, and while the setup across these is often similar, there are still a few details that we need to spell out.

For a deeper comparison, check out the difference between SOCKS5 and HTTP proxies.

Let's see how we can set up wget with each of these protocols.

HTTP proxies

This is the most common setup because it works out of the box with Wget and most proxy providers. Wget simply sends your request to the proxy, which forwards it to the target server. 

The set up is also straightforward, use --proxy=on and pass your proxy URL through http_proxy:

wget --proxy=on -e http_proxy="http://gate.decodo.com:10000" -qO- https://httpbin.io/ip

If your proxy requires authentication, add --proxy-user and --proxy-password:

wget --proxy=on --proxy-user="USERNAME" --proxy-password="PASSWORD" -e http_proxy="http://gate.decodo.com:10000" -qO- https://httpbin.io/ip

If you use the same proxy often, put it in a .wgetrc file:

use_proxy = on
http_proxy = http://HOST:PORT
proxy_user = username
proxy_password = password

Now you can run wget normally, and it will use the proxy.

HTTPS proxies

HTTPS proxies provide encrypted communication for secure data transfer. In terms of setup, HTTPs proxies are quite similar to HTTP proxies, as wget still uses proxy settings, but the traffic is encrypted end-to-end between your machine and the target site.

wget --proxy=on -e http_proxy="http://HOST:PORT" -e https_proxy="http://HOST:PORT" -qO- https://httpbin.io/ip

SSL/TLS considerations

HTTPS through a proxy is usually smooth, but some situations can cause trouble, such as:

  • Corporate proxies are doing SSL inspection. Some networks intercept HTTPS traffic and present their own certificates. If your machine does not trust the corporate CA, you may see certificate errors. The clean fix is installing the correct CA certificate on the machine.
  • Bad CA bundle on the machine. If your OS is missing updated CA certificates, HTTPS requests can fail even without a proxy.

You'll see people use --no-check-certificate to fix this, but it reduces security and should be avoided unless you fully understand the risk.

SOCKS5 Proxies

Now, Wget doesn't have built-in support for SOCKS5 proxies, and a lot of guides get this wrong. The GNU Wget manual confirms it only handles HTTP, HTTPS, and FTP proxy protocols.

Why SOCKS5 proxies are preferred over HTTP(s)

People choose SOCKS5 when they want:

  • better protocol flexibility than HTTP proxies
  • stronger anonymity
  • compatibility with tools like Tor

Now that we've established this, if you must use a SOCKS5 proxy with wget, you have three solid workarounds:

Proxychains is a simple wrapper that forces apps like wget to route traffic through a SOCKS5 proxy. To use Proxychains, first install it:

sudo apt update
sudo apt install proxychains4

Next, open the config file and your SOCKS5 proxy. 

sudo nano /etc/proxychains4.conf

Scroll to the bottom under [ProxyList] and add your proxy in this format:

socks5 HOST PORT

Then, prepend proxychains4 to your wget command when running it:

proxychains4 wget https://domain.com/file.zip

Option 2: torsocks

If you're routing through Tor, torsocks makes it straightforward to use SOCKS5 proxies. First, install torsocks:

sudo apt install tor torsocks
sudo systemctl start tor
torsocks wget https://domain.com/file.zip

Option 3: Use cURL instead

If SOCKS5 is essential to your workflow and you don't want wrapper tools, switching to cURL is often the simplest move because it supports SOCKS5 natively.

Check out our in-depth guide to learn more about configuring proxies with cURL.

FTP proxies

This is less common these days, but they're still relevant for legacy file servers and older package repositories.

You can configure FTP proxies using the ftp_proxy flag:

export ftp_proxy="http://HOST:PORT"
wget ftp://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

Security best practices for proxy credentials

You are likely aware that leaving your proxy credentials in plain sight is a recipe for trouble. Follow these practices to keep your proxy username and password safe.

Lock down your config file

If you store credentials in .wgetrc, restrict permissions so only you can read it:

chmod 600 ~/.wgetrc

Avoid shell history leaks

Commands with passwords in them can get saved in your shell history. On many systems, you can prefix a command with a space to prevent this, as long as HISTCONTROL=ignorespace is enabled.

wget --proxy-user="username" --proxy-password="password" -e use_proxy=yes -e https_proxy="http://HOST:PORT" https://domain.com

Also, if you accidentally run a command with secrets, remove it from your history file as soon as possible.

Use environment variables for secrets

Instead of hardcoding credentials into commands or config files, you can load them at runtime using environment variables:

export PROXY_USER="username"
export PROXY_PASS="password"

This keeps credentials out of your command text:

wget --proxy=on --proxy-user="$PROXY_USER" --proxy-password="$PROXY_PASS" -e https_proxy="http://gate.decodo.com:10000" -qO- https://httpbin.io/ip

Use secret managers in CI/CD

Never commit real credentials. In CI/CD pipelines, use your platform's built-in secret management, like GitHub Actions secrets, GitLab CI variables, or your cloud provider's secret store.

Rotating proxies with Wget: Manual and automated approaches

A rotating proxy is a proxy setup that constantly changes the IP addresses over time or per request.

When your requests keep coming from different IPs, websites find it harder to spot automation and block you. In this context, rotating proxies can be super helpful when you are downloading many files or running cron jobs.

Why rotate proxies?

Some of the benefits of rotating proxies include:

  • Avoiding IP-based rate limiting and temporary bans
  • Spread requests across multiple IPs to reduce detection
  • Improving success rates when downloading lots of files
  • Keep your job running even if one IP gets blocked

Let's set up a rotating proxy using Wget.

Manual rotation with a shell script

Wget doesn't have a standard way of randomly selecting proxies, so a free alternative is to create a list of proxies with different IPs and randomly select one per request. 

You can do this with a shell script in a few simple steps.

Step 1: Create a proxies.txt file

Create a proxies.txt file and add the proxies you intend to use. Each proxy should be on a new line:

http://45.77.12.199:3128
http://51.159.115.233:3128
http://103.152.112.145:80

Step 2: Create a rotation script

Create a random_proxies.sh script that uses GNU's shuf utility to pick a random proxy from proxies.txt. Then we set the proxy in Wget using the -e option. We also run the request three times so you can confirm the IP changes.

#!/usr/bin/env bash
set -euo pipefail
URL="https://httpbin.io/ip"
PROXY_LIST="./proxies.txt"
for i in 1 2 3; do
PROXY=$(shuf -n 1 "$PROXY_LIST")
echo "Request #$i using proxy: $PROXY"
wget -qO- \
-e use_proxy=yes \
-e http_proxy="$PROXY" \
-e https_proxy="$PROXY" \
"$URL"
echo
done

Step 3: Run the script

Make it executable and run it:

chmod +x random_proxies.sh
./random_proxies.sh

If you're using Windows, you'll need a Unix-like shell environment like WSL to run this script.

You should see output where the IP changes between requests, for example:

{
"origin": "45.77.12.199"
}
{
"origin": "103.152.112.145"
}
{
"origin": "51.159.115.233"
}

Downsides of DIY rotation

Manual rotation works, but it comes with tradeoffs:

  • You manage proxy quality and uptime yourself
  • Free proxies are often slow or already blocked
  • There are no automatic checks, so dead proxies can break your script
  • It does not scale well for big downloads
  • Success rates can be low because IP quality is inconsistent

Automated rotation with backconnect proxies

A DIY solution is fine for quick tests, but it will struggle to perform or even hold up at scale. It's even worse when paired with free proxies, as you run a serious risk of being exposed to security gaps or being blocked.

A more reliable option is premium rotating proxies (sometimes called backconnect proxies). With this setup, you don't rotate anything yourself. You get one proxy endpoint, and the provider rotates IPs behind the scenes from a large pool, so each request looks like it's coming from a different user.

This is a productivity hack for:

  • Large file downloads
  • Repeated cron jobs and scheduled data pulls
  • Strong anti-bot systems
  • Automation gigs

Integrating Wget with Decodo rotating proxies

Decodo is rated as the best residential proxy provider in 2026 according to Proxyway, an independent proxy reviewer. It offers smart proxy rotation capabilities. Decodo provides over 115 million high-quality residential IPs across more than 185 countries, with enterprise-grade uptime guarantees. 

Let's set up Decodo Residential Proxies with Wget so you get automatic IP rotation without needing to write DIY scripts.

Step 1: Get your Decodo credentials

Sign up for Decodo and activate your free trial or plan.

Copy the proxy server details (proxy domain and proxy port) and your proxy credentials (username and password).

Step 2: Configure .wgetrc

Create or edit a .wgetrc file in your project folder and paste your proxy credentials into the file:

use_proxy = on
http_proxy = http://USERNAME:PASSWORD@us.decodo.com:10000
https_proxy = http://USERNAME:PASSWORD@us.decodo.com:10000

Lock the file permissions:

chmod 600 .wgetrc

Step 3: Run Wget through Decodo and check your IP

Run Wget using the configuration file:

wget --config ./.wgetrc -qO- https://ip.decodo.com

See the result for two consecutive requests:

# request 1
{
"origin": "91.204.35.142"
}
# request 2
{
"origin": "188.215.76.33"
}

You should see a different IP each time.

Wget vs cURL

cURL is another open-source command-line tool for downloading files and is available for free.

cURL and wget share many similarities; both are capable command-line tools for making HTTP requests, and both work with proxies. 

What they have in common

Both tools:

  • Are open-source and free to use
  • Can download content over HTTP, HTTPS, and FTP
  • Can send HTTP requests like GET 
  • Support cookies
  • Work well in scripts and automation
  • Can run quietly in the background

Where Wget is better

Wget is built for downloading. It's the better pick when your goal is to reliably fetch lots of files, and you want the command to keep working even if the network is not perfect.

Wget is usually the better choice when you need:

  • Recursive downloads and website mirroring
  • Resume interrupted downloads 
  • Batch downloads from a URL list
  • Simpler syntax for straightforward download tasks

Where cURL is better

cURL is more flexible for HTTP requests. It's the better pick when you care less about downloading a bunch of files and more about controlling the request itself.

cURL is usually the better choice when you need:

  • Native SOCKS5 support
  • Richer API request controls
  • Broader auth and protocol flexibility

Quick decision table

Your need

Best tool

Download files recursively through a proxy

Wget

Mirror a website through a proxy

Wget

Batch download from a URL list

Wget

Resume interrupted large downloads

Wget

Use SOCKS5 proxies natively

cURL

Interact with APIs

cURL

Script in a CI/CD pipeline

Either works

Note: To learn more, see how to download files with cURL.

Best practices for using Wget with proxies

These are the practical best practices we recommend for using proxies with Wget:

Add delays between requests

Hammering a server with requests is one of the fastest ways to get blocked, and it puts unnecessary load on the target. Use --wait and --random-wait to add pauses between requests.

wget --wait=2 --random-wait -i urls.txt

--random-wait varies the delay between requests so your traffic does not look perfectly timed. 

Respect robots.txt

If you're crawling or downloading pages recursively, check the site's robots.txt rules first. Even when something is technically accessible, it may be disallowed for automated fetching. 

Configure timeouts and retries

Use timeouts for slow networks, and retries for flaky proxies or targets. If you are downloading large files, combine this with resume support (-c) so you don't restart from zero after a drop.

Limit bandwidth when needed

If you're downloading large files through a shared proxy (or on a shared server), avoid consuming all available bandwidth. Bandwidth limiting also helps keep other services stable while your download runs.

wget --limit-rate=500k -e use_proxy=yes -e http_proxy="http://HOST:PORT" https://domain.com/big-file.zip

Log everything for debugging

When running batch operations, always log your activity so you can review failures later.

wget -o download.log -i urls.txt

Use -o to write to a new log file, or -a to append to an existing one. For deep debugging, add the -d flag for verbose output, especially when you suspect proxy issues.

Test the proxy before long jobs

Before starting a long download job, do a quick test to confirm your proxy works and that your IP is actually changing.

wget -qO- -e use_proxy=yes -e https_proxy="http://HOST:PORT" https://httpbin.io/ip

If the returned IP does not match your proxy IP, then you should probably investigate that

Common use cases of Wget

  • Geo-restricted resource access. Accessing documentation, datasets, or content that's only available in certain regions by routing through proxies in those locations.
  • Scheduled data collection. Setting up cron jobs to regularly download publicly available datasets, research papers, or government data while using rotating proxies to stay within rate limits.
  • Development and testing. Testing how your application behaves from different geographic locations by simulating client connections through different proxy endpoints.
  • Privacy-conscious downloads. Downloading files without exposing your server's real IP, which can be useful for research and OSINT (Open Source Intelligence) workflows.

Troubleshooting common Wget proxy issues

When a Wget request fails, first try to figure out what's failing. Once you isolate that, the fix is usually quick. Here are the most common proxy-related issues and how to fix them.

Connection refused error

If Wget can't connect to the proxy at all, check the basics first. Verify the proxy address and port are correct, confirm the proxy server is running, and check whether a firewall is blocking the connection. 

A quick sanity test is to hit a simple IP endpoint through the proxy. If this fails immediately, your issue is the proxy connection, not the website:

wget -qO- -e use_proxy=yes -e http_proxy="http://HOST:PORT" https://httpbin.io/ip

407 proxy authentication required

407 error means the proxy requires credentials and didn't accept what you provided. Double-check the username and password, and watch out for special characters. If you embed credentials directly in a proxy URL, characters like @ and: can break the format unless they're URL-encoded.

Timeout issues

If downloads keep timing out, the proxy might be slow or overloaded. Increase the timeout and try again:

wget --timeout=60 --connect-timeout=30 -e use_proxy=yes -e http_proxy=http://proxy:8080 https://example.com/file.zip

SSL/TLS certificate errors

These usually pop up when a proxy performs SSL interception, or when your system's CA certificates are outdated. The safest fix is updating your CA certificates or installing the correct corporate CA

403 responses

403 can come from the proxy or the target site. If multiple unrelated sites return 403, suspect the proxy. If only one site returns 403, you're likely being blocked by the target.

Environment variables not working

Wget typically expects lowercase variable names like http_proxy and https_proxy, not HTTP_PROXY.

export http_proxy="http://HOST:PORT"
export https_proxy="http://HOST:PORT"
wget -qO- https://httpbin.io/ip

Also, check if the proxy settings are defined in the .wgetrc file, as they can override what you set in your shell.

Final thoughts

Using Wget with a proxy is one of the simplest ways to download any remote file over the internet. In this guide, you learned how to configure Wget with a proxy and how to handle authentication, rotation, or common errors.

If you're doing large-scale downloads or you need consistent success rates, a rotating proxy setup is usually worth it. Sign up for Decodo and get started with premium residential proxies today!

Skip the scraping infrastructure

Decodo's Web Scraping API handles proxies, headers, and retries – you just send a URL and get HTML back.

About the author

Lukas Mikelionis

Senior Account Manager

Lukas is a seasoned enterprise sales professional with extensive experience in the SaaS industry. Throughout his career, he has built strong relationships with Fortune 500 technology companies, developing a deep understanding of complex enterprise needs and strategic account management.


Connect with Lukas via LinkedIn.

All information on Decodo Blog is provided on an as is basis and for informational purposes only. We make no representation and disclaim all liability with respect to your use of any information contained on Decodo Blog or any third-party websites that may belinked therein.

Frequently asked questions

Does Wget work with SOCKS5, or only HTTP proxies?

Wget works best with HTTP and HTTPS proxies, but it doesn't natively support SOCKS5. If you need native SOCKS5 support, cURL is usually the better choice.

What are the main use cases for Wget?

Common use cases include downloading files in scripts, batch downloading from a URL list, and scraping websites for offline access. It's also useful in cron jobs and automation workflows where you want reliable, non-interactive crawling.

How do I keep my proxy username and password secure when using Wget?

Avoid putting credentials directly in commands that end up in shell history. If you store them in .wgetrc, lock the file down with chmod 600. For automation, use environment variables and CI secret stores so credentials are injected at runtime and never committed to code.

cURL request

How to Download Files With cURL?

When working with the cURL command to interact with web services or APIs, saving the response from a remote server directly to a file is useful for various scenarios, such as logging responses, processing data offline, or simply preserving the output for review at a later time. cURL provides a straightforward way to download files, enhancing the tool's utility for developers and system administrators. In this blog post, we’ll demonstrate how to download files with cURL, including key commands for saving files, handling redirects, and managing authentication.

What Is a Residential Proxy? 2026 Guide, Types & Uses

Residential proxies hide your online activity by routing traffic through real home IPs, making you look like a regular user. They’re more anonymous than datacenter proxies and great for web scraping, ad verification, and dodging geo-blocks. This guide helps you select the right solution while maintaining undetectable online operations.

© 2018-2026 decodo.com (formerly smartproxy.com). All Rights Reserved