
How to Install Jekyll on Ubuntu 24.04 and Newer
Welcome to the Greenhost.cloud blog! Today, we will guide you through the process of installing Jekyll on Ubuntu 24.04 and newer. Jekyll is a popular static site generator that allows you to transform plain text into beautiful websites. It’s particularly favored by developers for its simplicity and flexibility, making it an ideal choice for building blogs, portfolios, and documentation sites.
Prerequisites
Before we dive into the installation process, ensure that you have the following:
- Ubuntu 24.04 or newer: Make sure your system is up to date.
- Root or Sudo Access: You’ll need administrative privileges to install packages.
- Ruby: Jekyll is built on Ruby, so we need to have it installed on our system.
Step 1: Update Your System
Start by updating your package list to ensure you have the latest version of all packages. Open your terminal and run the following commands:
sudo apt update
sudo apt upgrade -y
Step 2: Install Ruby
Jekyll is a Ruby-based application, so we need to install Ruby first. Ubuntu 24.04 comes with a version of Ruby, but it’s good practice to install a version manager like RVM (Ruby Version Manager) to manage different Ruby versions easily.
Install RVM
Run the following commands to install RVM and the necessary dependencies:
sudo apt install curl gpg -y
\curl -sSL https://get.rvm.io | bash -s stable
After the installation is complete, load RVM into your shell session:
source ~/.rvm/scripts/rvm
Install Ruby
Now that RVM is installed, you can install Ruby. You can check the latest stable version of Ruby with:
rvm list known
To install a specific version (for example, Ruby 3.1.2), run:
rvm install 3.1.2
rvm use 3.1.2 --default
To verify the installation, run:
ruby -v
You should see the installed Ruby version output.
Step 3: Install Bundler
Bundler is a Ruby gem that manages dependencies for your Ruby applications. Install it using the following command:
gem install bundler
Step 4: Install Jekyll
Now we’re ready to install Jekyll! Run the following command:
gem install jekyll
To verify that Jekyll has been installed successfully, check its version:
jekyll -v
You should see the Jekyll version output in your terminal.
Step 5: Create a New Jekyll Site
With Jekyll installed, you can now create a new site. Run the following command, replacing my-awesome-site
with your desired site name:
jekyll new my-awesome-site
This command will create a new directory with the necessary files and structure for your Jekyll site.
Step 6: Build and Serve Your Jekyll Site
Navigate into your new site’s directory:
cd my-awesome-site
To build and serve your site locally, run:
bundle exec jekyll serve
You should see output indicating that your site is running, typically at http://localhost:4000/
. Open your web browser and visit this URL to see your new Jekyll site in action!
Step 7: Customize Your Site
Now that you have your Jekyll site up and running, you can customize it! Modify the _config.yml
file to change settings like the site title, description, and more. You can also add posts, pages, and themes to enhance the look and functionality of your site.
Conclusion
Congratulations! You’ve successfully installed Jekyll on Ubuntu 24.04 and newer. You now have a powerful static site generator at your fingertips, ready to help you create beautiful and performant websites.
Feel free to explore the extensive Jekyll documentation for more advanced features and plugins.
For more tutorials, tips, and insights on web hosting and development, stay tuned to the Greenhost.cloud blog!