Using Hugo server command to make a site accessible on your local network with options --bind and --baseUrl

What a brilliant feature and I only discovered this the other day so thought I’d post it here in case it helps others to see a real example.

If you want to test your site on other devices on your local network you can use the following:

hugo server -D --bind 192.168.X.Y --baseUrl http://192.168.X.Y

Replace the X & Y with the actual numbers of your host machine’s IP and when your site builds it will be available to your local network on 192.168.X.Y:1313 rather than the usual localhost:1313 which is inaccessible to other machines.

A real time saver if you were having to build on Netlify in order to test your site on say an iPad and/or smart phone.

3 Likes