Struggling to access hugo server on local network

I’m running my server: hugo server --bind= --baseURL= -D

I get no errors. I can see it fine on that computer at http://localhost:1313 but if I go to that computer’s IP (at 1313) on other devices on the network I get no connection.

I’m running hugo on nixos. I’m trying to access it on my android phone and windows computer.

what other information may I offer? any ideas?

Your NixOS firewall is blocking incoming TCP connections over port 1313.


1 Like

thank you, you’re amazing. should I change the baseURL to reflect my IP?

I can access the site and it all shows properly on my other devices, but when I click a link it changes from my development computer’s IP to

If your private address is, then run:

hugo server --bind --baseURL

The default port is 1313. If you want to listen on port 8080:

hugo server --bind --baseURL --port 8080
1 Like

that fixed it. thank you!! <3

just in case others read this: when I check the site locally I have to use my devices IP instead of localhost, but it works great!

Of course: localhost is equivalent to, it is bound to the interface lo. So if you use localhost in an URL, the browser will connect to If, on the other side, you run a webserver on 162.168.1.x (which is bound to the interface en-something or wlan-something), you have to connect to this IP. If you’d want to use a symbolic name instead (like “my-lovely-hugo-host”), you’d have to either setup a DNS or add an appropriate entry to your /etc/hosts file.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.