Skip to content
Latchkey

wget: Usage, Options & Common CI Errors

wget downloads files over HTTP, HTTPS, and FTP without needing a TTY.

wget is the other ubiquitous downloader. It fails on HTTP errors by default (unlike curl), which makes it convenient but its exit codes are coarser.

What it does

wget retrieves files over HTTP, HTTPS, and FTP. It is non-interactive, can resume partial downloads, and by default returns a non-zero exit on server errors like 404.

Common usage

Terminal
wget https://example.com/file.tar.gz
wget -O out.bin https://example.com/file
wget -q https://example.com/x          # quiet
wget --tries=5 --timeout=20 https://example.com/x
wget -qO- https://example.com/install.sh | sh

Options

FlagWhat it does
-O <file>Write to a specific file (-O- = stdout)
-q / --quietNo output
--tries=NRetry up to N times (0 = infinite)
--timeout=SECSSet read/connect/DNS timeout
-c / --continueResume a partial download
--no-check-certificateSkip TLS verification (avoid in prod)

Common errors in CI

ERROR 404: Not Found exits 8 (server issued an error response). "Unable to resolve host address" exits 4 (network failure). "wget: command not found" - minimal images (alpine) ship without it; install wget or use curl. Mixing -O with multiple URLs concatenates them into one file, which silently corrupts archives.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →