Open In App

How to Install and Run Jekyll on Docker?

Last Updated : 10 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Jekyll is an open-source software used to develop websites. Jekyll is a free application present on the internet. The word open source refers that the application being free to use. Jekyll is the application used to develop static websites. Jekyll generally takes the text in the user’s favorite markup favorite. There are several markup languages are present. One of them is HTML. Using those markup languages users can able easily deploy one static website. As Jekyll easily deploys the websites, it is often termed the “Generator” of static webpages. This application was first developed by Tom Preston-Werner in the year 2008. After that, this application is maintained by Parker Moore. Jekyll is a widely used site generator as it can adapt to GitHub easily.

Docker is another software present on the internet. There are two versions of Docker. In one case, the software is free to use. And in another case, there are some pricing present to use the full version of Docker. This is the premium account of Docker. But generally, the free service of Docker is enough to use. Docker helps to integrate different applications. Using Docker, developers can able to develop some applications. All the applications is being separated by a container. So, the applications are developed inside one different container. To use Jekyll on Docker, users must have Docker on their machine. This is a very important prerequisite.

Installing Jekyll On Docker

Note: Users don’t need to install Jekyll in Docker. This means there is no specific comment present to install Jekyll on Docker. As Docker is the software that provides a container, so there is no need to install any application. Docker is being used to integrate different applications. Docker is not a physical machine where the applications can be installed. Users need to configure Docker in such a way, that they can able to use it. There is some specific command present in Docker that helps to use Jekyll. Users need to execute those commands.

Step 1: At first, users need to open the terminal. Then they should navigate to the certain folder or file, where they want to work on Jekyll using Docker. This is the first step. After navigating to the folder or file, users can proceed with the next steps.

Step 2: In the terminal, users need to execute the following command. This command will help to start the new Jekyll file in the specific location. This command helps to make a background in the specific folder to run the Jekyll-related operations.  Here, it will install Jekyll-related dependencies & many more related operations. Users need to run this command there.

Command: docker run -v $(pwd):/site bretfisher/jekyll new .

In the terminal write docker command.

 

Step 3: It will take some time to complete the process. Users need to have patience until the process is completed.

jekyll installation.

 

Step 4: Now, as the process is completed, users can run the following command. This command will help to see the installed or downloaded folder in the file. This means that the installation process is successful.

Command: ls

Run another command

 

Step 5: Now, users need to execute another command. This command will help to finalize the installation process. For that purpose, users need to run the below-mentioned command. This command will complete the installation process. This is a very important command. Without this command, the installation will not be completed.

Command: docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve

Again run command

 

Step 6: This will take a long time to complete. Users need to wait till the process is completed.

wait till the process is completed.

 

Step 7: When the process will be completed, users will find one server address there. This server address is the Jekyll server address for the Docker container. Users can develop their Jekyll-related applications on this website. So, the installation process of Jekyll in Docker is completed.

 find one server address there.

 

Step 8: Now, users can make a change in the server. To make changes in the server, users need to make changes in the About file. This file is installed in the Docker container. The Docker container is the file or folder where all the processes are executed. Now, to open that About file, users need to execute the following command. This command will open the About file in the Vim editor.

Command: vim about.markdown

Again run command

 

Step 9: Now, users can write any statement there. After writing the statements, users need to press Enter key from the keyboard. Hence, the About file is now changed. And hence, the Jekyll server is also changed.

write any statement

 

Step 10: Now, users need to browse the following link. This is the server link that was received earlier. Now, on the webpage, users will find their made changes in the About file.

Link: http://0.0.0.0:4000/

Installed succesfully.

 

Hence, we have successfully installed Jekyll on Docker.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads