others-How do I get jekyll website to run on a port other than 4000?
1. The purpose of this post
I would demo how do I get jekyll website to run on a port other than 4000?
2. Environments
- jekyll 2.x and 3.x
3. The default start command
The default way we start jekyll website is as follows:
we would get this response:
4. Specify the port of jekyll website
According to the jekyll official configuration document, we can start the jekyll website with the –port option like this:
If we want to run jekyll website on port 8080, we can run command like this:
Then we get:
5. Specify the host and port of the jekyll website
If you don’t want to run on localhost(127.0.0.1), you can also specify the host by command options like this:
Then we get:
Then you can visit your site from anywhere.
6. Conclusion
You can use –host and –port to run jekyll website on different host and port, if you want to use more options, just reference the offical document of jekyll.