So I've searched google a lot, and I've tried everything everyone is suggesting but nothing seems to be working.
I want to view my jekyll website on my mobile.
When I run jekyll it says server address: 127.0.0.1:4000
My computer's IP is 154.135.X.Y
I've opened up the port in the windows inbound rules
I've tried accessing from my mobile using both 154.135.X.Y:4000 and 127.0.0.1:4000 but to no avail.
Anyone know how I can access my jekyll site on mobile?
You can access your host machine with the IP address "10.0. 2.2". This has been designed in this way by the Android team. So your webserver can perfectly run at localhost and from your Android app you can access it via "http://10.0.2.2:8080".
For Windows users, you'll need to make sure you have Python installed first. For macOS and Linux, you can use a simple cURL command to install it straight from your command line. It'll run through and sign you up to the service if you're not already signed up. Then you'll have localhost up and running for the world!
If your server address is 127.0.0.1 it means Jekyll is only listening on your localhost. You'll need to start Jekyll and instruct it to bind to port 4000 on ANY interface:
jekyll serve --host 0.0.0.0
Configuration file: none
Auto-regeneration: enabled for '/private/tmp/test'
Configuration file: none
Server address: http://0.0.0.0:4000/
Server running... press ctrl-c to stop.
If you are accessing the computer from the web, you'll need to make sure your router forwards port 4000 to your PC.
If you are accessing the computer from your local LAN, make sure you accessing the private IP of your computer, and not the public IP.
Obviously you need to make sure there's not firewall that blocks incoming connections on your PC as well.
bundle exec jekyll serve --host 0.0.0.0
or jekyll serve --host 0.0.0.0
TiP: use {{site.baseurl}}/
to add images/assets in the pages and make sure there's no url:~
key in _config.yml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With