jekyll serve on one machine, a WEBrick server is set up and the site can be accessed from
localhost:4000 on this particular PC.
However, I’m wondering how to access this web server from other machines in the LAN, especially for mobile devices? I’m trying to test the jekyll site on mobile devices before pushing the code to Github.
jekyll serve --host=0.0.0.0 when you invoke Jekyll on the command line.
That will make Jekyll’s HTTP server bind to all available IPs, rather than just to
You can also add this to your
host: 0.0.0.0. GitHub will simply ignore this when you push, so it’s safe to use if you don’t mind having your work openly accessible on your network.
--host=0.0.0.0 Jekyll will output something like this when you start up:
$ jekyll serve [...] Server address: http://127.0.0.1:4000/ Server running... press ctrl-c to stop.
host: 0.0.0.0 in
_config.yml) you’ll notice that it’s listening on all interfaces (represented by
0.0.0.0) rather than just listening on the loopback interface (represented by
$ jekyll serve --host=0.0.0.0 [...] Server address: http://0.0.0.0:4000/ Server running... press ctrl-c to stop.
Assuming your mobile device is connected to the same LAN as your development machine.
Assertain the LAN IP address of your development machine. Usually something like: 192.168.0.XXX. Where .XXX is the unique last 3 digits of your dev machine’s LAN IP.
Point your mobile device’s web browser to: http://192.168.0.XXX:4000
That’s how I do it on my laptop and iPhone for Jekyll dev.