How to Mirror a Website

February 24, 2017

Ever needed to quickly mirror a website? This can be useful for development and testing, or simply to view websites offline.

Well, here's a rudimentary way to do it with nothing other than wget.

wget --mirror --page-requisites --adjust-extension --no-parent --convert-links

To make sure you stay on only, add the --domains option.

wget --mirror --page-requisites --adjust-extension --no-parent --convert-links --domains

Now, wget will do most of the job, but you might still find the mirror incomplete. For example, it can fail to download some CSS and JavaScript resources. For this, something with a stronger parser is needed. One example of such a tool is httrack.

sudo apt-get install httrack
httrack "" -O "/tmp/" "+**" -v

This should give you a complete mirror.

Related Posts