Making Jekyll available on local network

Date: January 05, 2018

After finding out that my Jekyll blog isn’t mobile friendly, I decided to fix its styling and check it on real Android device (since the view from “Responsive Design Mode” button of Mozilla Firefox differed from the view on Android Chrome app). The easiest way for testing is to connect both server and Android device to the same network and connect to server from device by IP address. ip route get 8.8.8.8 | awk '{print $NF; exit}'

But the first trial gave me an error.

Well, I also found out that my firewall is fine. It is inactive by default from Ubuntu installation.

In case your firewall denies all ports, you can paste following commands.

The problem appeared to be among Jekyll settings - if you run a server by command jekyll serve , it will be visible only on localhost:4000 and 127.0.0.1:4000. So, even if you type http://your-ip:4000 at the server computer, you will get “Unable to connect”. The solution was found on GitHub - if you want Jekyll to be available outside localhost, the command should be jekyll serve --host=0.0.0.0.