hugo server --bind=0.0.0.0 --baseURL=http://192.168.123.123:1313

While building a Hugo based site, I wanted to check how looked it on my mobile. On an actual device that is, and not just emulated with developer tools.

Not being able to connect to the site, I started looking at my firewall, at my switch settings … Let’s blame the late hour when I was doing this, because all it took was passing the correct bind address. Hugo will only listen to localhost by default.

0.0.0.0 is the easy way out, because you can still use localhost and 127.0.0.1 but you can also connect by IP from another device.

Don’t forget to modify the --baseURL as well, or you’ll miss the assets for your site.