How to use the SSH wget command

The SSH wget command retrieves files from the web via HTTP, HTTPS, or FTP. In particular, it’s useful for downloading plugins, themes, scripts, or backups directly to your server without using a browser or FTP client. Furthermore, wget supports background downloads, multiple files, and mirroring entire sites – making it a practical tool for server management via SSH. Unlike curl, wget is non-interactive by default and can resume interrupted downloads, which helps when transferring large files.

Download via HTTP/HTTPS

Most Linux hosting accounts include wget by default. To verify it’s available, run wget --version.

To download a file from a URL, run SSH wget command followed by the full address:

wget https://example.com/file.zip

The file saves with its original name in the current directory. To save under a different name, use -O:

wget -O myfile.zip https://example.com/file.zip

Keep the correct file extension when renaming. Example—download jQuery:

wget https://code.jquery.com/jquery-3.7.1.min.js

Download via FTP

Wget can also connect to FTP servers. Use your FTP credentials to download from an FTP server:

wget --ftp-user=USERNAME --ftp-password='PASSWORD' ftp://hostname/path/to/file.zip

Replace USERNAME, PASSWORD, hostname, and the path with your actual values. To download all files in an FTP directory, use a trailing *:

wget --ftp-user=USERNAME --ftp-password='PASSWORD' ftp://hostname/path/to/directory/*

Download in the background

Large downloads can block your terminal. Use -b to run wget in the background so you can continue working:

wget -b https://example.com/large-file.zip

Wget writes progress to a log file (e.g. wget-log) so you can check status later. Useful for large files that take a long time to download.

Download multiple files

When you need to grab several files at once, put URLs in a text file, one per line, then use -i to download them all in sequence:

wget -i urls.txt

Example urls.txt:

https://example.com/file1.zip
https://example.com/file2.zip
https://example.com/file3.zip

Mirror a website

Use -m (or --mirror) to download a full copy of a site’s HTML structure:

wget -m https://example.com

Use with care—only mirror sites you own or have permission to copy. Mirroring can generate a lot of traffic and may be restricted by some hosts.

Common use cases

Typical uses for SSH wget command on a Linux hosting account:

  • Downloading WordPress plugins or themes from external sources
  • Fetching JavaScript libraries or other assets for your project
  • Backing up files from an FTP server to your hosting account
  • Retrieving external resources needed for scripts or applications

For moving or renaming downloaded files, see the SSH mv command. For searching text in files, see grep.

Need more help?

Explore more SSH and hosting guides in our knowledgebase. JetHost web hosting includes SSH access for managing your server directly.