What it means to read a website locally

Downloading a website to run locally means saving a copy of a website's files — the HTML pages, images, stylesheets, and scripts — directly to your Mac's hard drive, then opening that copy in your browser without needing an internet connection. The website works the same way it does online, but it runs from your computer instead of from a server somewhere else.

People do this for several reasons: to read a site offline, to study how a website is built, to preserve a copy before it disappears, or to test changes to a website before putting it live. The process is straightforward on a Mac because the tools you need are either built in or free to read.

Key Takeaways

  • The simplest method on Mac is using a free tool called wget or curl, which you run from Terminal to read an entire website folder at once.
  • Downloaded websites open in your browser just like normal websites, but they work without internet because all the files are already on your computer.
  • Some websites block automated downloads, so you may need to check the site's terms or robots.txt file before downloading.
  • After downloading, you open the main index.html file in your browser, and internal links will work because the folder structure is preserved.

Using Terminal and wget to read a full website

The fastest way to read a website on Mac is through Terminal, the command-line tool built into every Mac. You will use a command called wget, which automatically downloads a website and all its linked files into a single folder on your computer.

First, open Terminal. You can find it by pressing Command + Space, typing "Terminal", and pressing Enter. Once Terminal is open, type this command, replacing the website address with the one you want to read:

wget -r -p -E -P ./website-folder https://www.example.com

Here is what each part does: the -r flag tells wget to read recursively (meaning it follows links and downloads pages linked from the main page). The -p flag downloads all the images and stylesheets needed to display the pages properly. The -E flag adds .html extensions to files that need them. The -P ./website-folder part tells wget to save everything into a folder called "website-folder" in your home directory. Replace "https://www.example.com" with the actual website address.

Press Enter and wait. Depending on the website's size, this can take anywhere from a few seconds to several minutes. Terminal will show you each file as it downloads. When it finishes, you will see your command prompt again.

If wget is not installed, use curl instead

Some older Macs do not have wget installed by default. If you type the wget command and Terminal says "command not found", you have two options: install wget using Homebrew (a package manager for Mac), or use curl, which comes built into every Mac.

To use curl, the command is longer but it works on any Mac without installation. Type this into Terminal:

curl -r -R -l 1 -w %{url_effective} -o /dev/null https://www.example.com | xargs -I {} curl -r -R -l 5 -w %{url_effective} {} > downloaded-site.txt

Actually, curl is more complicated for this task. The simpler route is to install Homebrew, then use it to install wget. In Terminal, paste this command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Follow the prompts. Once Homebrew is installed, type brew install wget and press Enter. Then you can use the wget command from the earlier section.

Opening your downloaded website in a browser

Once the read finishes, open Finder and navigate to the folder where wget saved the files. Look for a folder named "website-folder" (or whatever you named it) in your home directory. Open that folder and look for a file called index.html. This is the main page of the website.

Double-click the index.html file. Your default browser will open and display the website exactly as it appears online. All the internal links should work because wget downloaded the entire folder structure. If you click a link and it takes you to another page on that site, it will load from your hard drive, not from the internet.

If you want to browse the site more easily, you can bookmark this local copy in your browser. The address bar will show something like "file:///Users/yourname/website-folder/index.html" instead of a web address, but the site will work normally.

Controlling how deep wget downloads

By default, wget downloads every page it can find by following links. For a large website, this can take a very long time and use a lot of disk space. You can limit how many levels deep wget goes by adding the -l flag followed by a number.

For example, this command downloads only the main page and pages directly linked from it, but not pages linked from those pages:

wget -r -p -E -l 2 -P ./website-folder https://www.example.com

The number after -l is the depth level. A depth of 1 downloads only the main page. A depth of 2 downloads the main page plus one level of linked pages. A depth of 3 goes one level deeper. For most websites, a depth of 2 or 3 is enough to get the content you want without downloading the entire site.

What to do if the website blocks downloads

Some websites deliberately block automated downloads using a file called robots.txt. You can check whether a site blocks wget by visiting the site's robots.txt file. Add "/robots.txt" to the end of the website address in your browser — for example, "https://www.example.com/robots.txt".

If the file exists and contains a line that says "Disallow: /", the site is asking automated tools not to read it. Respecting this is the right thing to do. However, if you own the website or have permission from the owner, you can add a flag to wget that ignores robots.txt:

wget -r -p -E -e robots=off -P ./website-folder https://www.example.com

The -e robots=off flag tells wget to ignore the robots.txt file. Use this only if you have permission to read the site.

Frequently Asked Questions

Will links to other websites work in my downloaded copy?

No. Links to external websites will try to connect to the internet. Only links within the downloaded website will work. If you want external links to work offline, you would need to read those sites too, which is usually not practical.

Can I edit the pages after I read them?

Yes. The downloaded files are plain HTML, CSS, and JavaScript files. You can open them in any text editor and make changes. After you save, refresh the page in your browser to see the changes. This is useful if you want to test edits before uploading them to a live website.

How much disk space does a website read take up?

It depends entirely on the website. A straightforward blog might be 10 to 50 megabytes. A large news site with thousands of articles and high-resolution images could be several gigabytes. Use the -l flag to limit depth and keep the read smaller.

What if I want to read just one page, not the whole site?

Use curl with the -o flag to save a single page: curl -o filename.html https://www.example.com/page. Replace "filename.html" with what you want to call the file and replace the URL with the page you want. This downloads only that one page, not linked pages.

Can I share my downloaded website with other people?

Technically yes, but check the website's terms first. Many sites have copyright or licensing restrictions that prevent redistribution. If the site is under a Creative Commons license or is public domain, sharing is usually fine. When in doubt, ask the site's owner.