If you’re using anything other than Nginx as your online web server, change it to Nginx. Nginx serves static files like nobody’s business. I’ll be using example.com as the domain name in the online examples and example.local in the offline examples.
No matter what you’re real domain name happens to be, you’ll need to assign a local domain name within the WordPress software. Before you can do that, you have to edit your computer’s host file. On Linux, it’s /etc/hosts and on Windows, it’s C:\Windows\System32\Drivers\etc\hosts. I have no idea what it is on a Mac.
You only need to add a single line:
127.0.0.1 example.local www.example.local
When the WordPress static site generator script runs, it will replace the “.local” TLD with the “.com” TLD. That is, if you use a local domain name that closely mirrors your real domain name. I’ll mention it again in a later article.
I won’t tell you how to set it up because there’s a good LEMP stack tutorial at DigitalOcean. You can skip the database part but you should install PHP even if you won’t be using it on your website. I’ll mention it again in a later article.
Since HTTPS (SSL/TLS) is going to be the new standard sooner than later, you should also follow the Let’s Encrypt tutorial at DigiatalOcean.
I won’t get into Linux. Most Linux users know exactly what to do. For Windows, I think WinNMP is the best development stack to use. I used an earlier version on Windows 8 years ago.
Don’t try to set it up with HTTPS. You’ll get nothing but grief from the web browser you test it with. The WordPress static site generator script will change it for you anyway.
Get WordPress installed here. You won’t need to worry it about it at the online server.