Skip to content

Download Entire Website on Linux: 4 Ways Compared

Download an entire website on Linux with wget, HTTrack/WebHTTrack or a browser ZIP tool: exact flags, what each misses, and fixes for broken copies.

Website Downloader 10 min read

To download an entire website on Linux, you have four realistic options: wget --mirror with the right flags, HTTrack (or its graphical front end WebHTTrack), the browser's Save page as for single pages, and a browser-based downloader that hands you the whole site as one ZIP. For most terminal users, this command produces a copy that works offline: wget --mirror --page-requisites --convert-links --adjust-extension --no-parent https://example.com/. Below is what each flag does, when HTTrack is the better choice, and why some copies come out without CSS, images or content.

Download an entire website on Linux: the 4 ways at a glance

MethodWhat you installWhole site?JavaScript-built pagesResultBest for
wgetUsually preinstalled; otherwise sudo apt install wgetYesNot executed, so JS-only content is missingFolder of filesScripts, servers, repeat jobs
HTTrack / WebHTTrackhttrack and webhttrack packagesYesNot executedFolder plus project and log filesPeople who prefer a GUI, resumable projects
Save page asNothingNo, one pageUsually saves the page as renderedOne .html file plus a _files folderA single article or receipt
Website DownloaderNothing, runs in the browserYes, up to the plan's page limitSame limit: fully JS-built apps can come out as a shellOne ZIP fileA quick full copy without the terminal, on any distro
The same job done two ways: a wget --mirror command in a terminal, or an address field and a download button in the browser. Both produce a complete offline copy; they differ in setup and control.

If you use more than one machine, the same comparison exists for Mac, Windows, Chromebook and iPhone and Android.

Way 1: wget --mirror with the flags that keep images and CSS working offline

Many tutorials stop at wget -r https://example.com. That downloads HTML pages, but the copy usually opens without styling, with broken images, and with links pointing back to the live site. The command that actually works offline is longer:

wget --mirror --page-requisites --convert-links --adjust-extension --no-parent --wait=1 --random-wait --limit-rate=300k -o mirror.log https://example.com/

The short form is wget -mpkE -np https://example.com/. Here is what each part does:

  • --mirror (-m): shorthand for recursive download with unlimited depth and timestamping (-r -N -l inf --no-remove-listing). Because of -N, running the same command again later only fetches files that changed.
  • --page-requisites (-p): also downloads everything a page needs to display: images, stylesheets, scripts and fonts. Without it you get bare HTML.
  • --convert-links (-k): rewrites links inside the downloaded files so they point to your local copies instead of the live site. This happens at the very end, so if you interrupt wget with Ctrl+C, the links stay unconverted.
  • --adjust-extension (-E): adds .html to pages served without an extension (such as /about), so your browser opens them as web pages instead of offering to download them.
  • --no-parent (-np): never climbs above the starting directory. Start at https://example.com/blog/ and wget stays inside /blog/.
  • --wait, --random-wait, --limit-rate: slow wget down so it behaves like a polite visitor rather than a flood of requests.
  • -o mirror.log: writes the progress output to a log file you can search afterwards.

Why does my wget copy of a website have no CSS or images?

Three causes cover almost every case. First, -p or -k was missing, so assets were not downloaded or links still point online. Second, the assets live on another host, such as cdn.example.com or a font service; wget does not leave the starting domain unless you allow it. Third, images are inserted by JavaScript (lazy loading via data-src attributes, for example), which wget never runs. Current wget versions do follow url() references inside CSS files, so background images normally come along once the stylesheet does. A longer checklist is in Downloaded Website Missing Images and CSS? How to Fix It.

How do I stop wget from downloading other sites or parent directories?

By default, recursive wget stays on the starting host, so it will not wander off across the web. To pull in assets from a CDN while staying in control, combine --span-hosts with an explicit whitelist: wget --mirror -p -k -E -np --span-hosts --domains=example.com,cdn.example.com https://example.com/. Only listed domains are fetched. For directories, use --no-parent and mind the trailing slash: https://example.com/blog without a slash is treated as a file called blog, so its "parent" is the whole site. To skip big files, add something like --reject "*.iso,*.zip".

Way 2: HTTrack and WebHTTrack on Ubuntu, Debian and Fedora

Some guides present HTTrack as a Windows program. It is not: WinHTTrack is the Windows interface, and on Linux the same engine is available as the command-line httrack and the graphical WebHTTrack, which runs a small local server and shows its interface in your web browser.

Installing HTTrack on Linux

  • Ubuntu, Debian, Linux Mint: sudo apt install httrack webhttrack
  • Fedora: sudo dnf install httrack (check whether your release packages WebHTTrack together with it or separately)
  • Arch: sudo pacman -S httrack

How to use WebHTTrack

  1. Run webhttrack from a terminal or the application menu. Your browser opens with the HTTrack wizard on a local address.
  2. Pick a project name and a base path (by default a websites folder in your home directory).
  3. Enter the address, choose the action Download web site(s), and open Set options to adjust limits, such as the number of connections and the maximum transfer rate.
  4. Click Start and keep the window open until it reports the mirror as finished. An interrupted project can be resumed with the Continue interrupted download action.

HTTrack on the command line

httrack "https://example.com/" -O "$HOME/mirrors/example" "+*.example.com/*" -c2 -A200000 -v

The +*.example.com/* filter keeps HTTrack on the site and its subdomains, -c2 limits it to two connections, and -A200000 caps the speed at roughly 200 KB/s. The output folder contains the site, an index.html launcher, a cache folder and hts-log.txt. HTTrack rewrites links for offline use automatically, which is one reason many people find it more forgiving than wget. For a deeper comparison, see wget vs HTTrack vs Online Website Downloader.

Way 3: The browser's "Save page as" and why it only saves one page

Press Ctrl+S in Firefox or Chromium and choose Web Page, complete. You get one .html file and a folder of its images and styles. It does not follow links, so a 50-page site means 50 manual saves with links that still point online.

It does have one real strength: the browser typically saves the page as it currently appears, including content that JavaScript added after loading. For a single page from a JavaScript-heavy app, that can beat wget and HTTrack, which never run scripts.

Way 4: A browser-based downloader that delivers the whole site as a ZIP

If you would rather not tune flags, or you are on a distro where installing packages is awkward (a locked-down work machine, an immutable system, a live USB), Website Downloader does the crawl on its own servers. You type the address, watch the page count rise, and download one ZIP containing every subpage with its images, stylesheets, scripts, fonts and media, ready to open offline in any browser.

Enter the address, follow the live progress as pages are counted, and download the finished example.com.zip. Your computer does not need to stay on while the site is crawled.

The Free plan needs no account and covers up to 100 subpages, with the archive kept for one day. Larger sites need a Single Site download (a one-time 7.99 EUR for up to 5000 subpages and 2 GB, kept 30 days) or a monthly plan; details are on the pricing page. It has the same honest limits as the command-line tools: no pages behind a login, and sites built entirely in the browser with JavaScript can produce a shell without content. More about the ZIP workflow is in Download a Website as ZIP Online.

Why is my copy broken? JavaScript-built pages, 403 Forbidden and missing assets

How do I download a website that builds its content with JavaScript?

Some React, Vue or Angular single-page apps send the browser an almost empty HTML file, often little more than <div id="root"></div>, and build everything else with scripts. wget, HTTrack and most crawlers save exactly that file, so the copy opens blank. To check, compare View Page Source (what the server sends) with the Inspector (what the browser built). If the text is only in the Inspector, try these:

  • Look for a server-rendered or pre-rendered version; many frameworks output real HTML per page, and those mirror fine.
  • Save key pages one by one with Save page as.
  • Dump the rendered HTML of individual URLs with headless Chromium: chromium --headless --dump-dom https://example.com/page > page.html. Assets are not localized, so this is for text, not a pixel-perfect copy.

Why does wget or HTTrack get "403 Forbidden", and does changing the user agent help?

A 403 means the server refuses the request. Many sites block clients that identify as Wget/... or HTTrack. Setting a browser-like identity (--user-agent="Mozilla/5.0 ..." in wget, -F "Mozilla/5.0 ..." in HTTrack) gets past simple filters, but not bot-protection pages that require running JavaScript. And if a site deliberately refuses automated copying, take that as an answer, especially if it is not your site. Website Downloader reports a refusal like this instead of handing you an empty archive. Related: wget respects robots.txt in recursive mode; overriding it with -e robots=off belongs on your own sites only.

What will never work in an offline copy

HTML, CSS, JavaScript, images, fonts, video and PDFs work offline. Anything that needs the original server, such as logins, site search, forms and APIs, does not, whichever tool you use.

How do I limit the download speed and know the mirror is complete?

A mirror makes hundreds or thousands of requests in a row. On a small shared host that can feel like an attack and get your IP blocked. Use --wait=1 --random-wait --limit-rate=300k in wget, or -c2 -A200000 in HTTrack, and run large jobs at quiet hours.

To check completeness:

  1. Read the end of the log. wget finishes with a FINISHED line, the number of files and bytes downloaded, and a line about how many files had their links converted. If the conversion line is missing, the job did not finish.
  2. Search for errors: grep -E "ERROR|failed" mirror.log. In HTTrack, read hts-log.txt.
  3. Compare page counts. Count your pages with find example.com -name '*.html' | wc -l and the site's own list with curl -s https://example.com/sitemap.xml | grep -c "<loc>". (Some sitemaps are an index of further sitemaps, so follow those too.)
  4. Look for links that still point online: grep -rl "https://example.com" example.com | head.
  5. Test offline. Disconnect from the network, open index.html and click through menus, images and a few deep pages.

How do I turn the downloaded folder into a ZIP file?

From the folder that contains the mirror, run zip -r example.com.zip example.com/, or tar -czf example.com.tar.gz example.com/ if the copy stays on Linux. In GNOME Files, KDE Dolphin and most other file managers, right-click the folder and choose Compress. A single archive is easier to move, back up and hand to a client, and it keeps thousands of small files together. If you would rather skip this step, the browser-based option delivers the ZIP directly.

FAQ

Is there a graphical alternative to wget on Ubuntu?

Yes. WebHTTrack, installed with sudo apt install webhttrack, gives you a wizard in your browser on top of the HTTrack engine. If you want nothing installed at all, Website Downloader runs in any browser on any distro and returns a ZIP. For other desktop tools, see the Cyotek WebCopy alternative for Linux.

Can I download a website that is already offline?

wget and HTTrack need a live server, so they cannot. If the Internet Archive captured the site, the Wayback Machine downloader can rebuild it from a capture without the archive.org toolbar; restores up to 100 pages are free, larger ones are a one-time 14.99 EUR. The steps are in Restore Website from Wayback Machine.

Does wget download pages behind a login?

Not by default. With your own account you can export browser cookies and pass them with --load-cookies cookies.txt, though sessions often expire mid-crawl. Website Downloader does not download pages behind a login.

Is it legal to mirror a website?

Mirroring your own site or keeping a private offline copy of public pages is generally treated very differently from republishing someone else's content, which copyright usually forbids without permission. Terms of service, database rights and the country you are in all matter, so there is no single answer. This is not legal advice; if you plan to reuse or publish copied material, or need the copy as evidence, ask a lawyer.

  • download entire website linux
  • Linux
  • wget
  • HTTrack
  • Offline Website