how to create a website using github

"If You Can Code, You Can Build a Website: Step-by-Step Guide to Creating a Site using GitHub"

By Rachel Moore
AD

Ever wanted to create a website but found the technical aspects daunting? GitHub, a sprawling platform for version control and collaboration, can actually help you launch a personal or professional website with minimal coding and at breakneck speed. Let's explore how to create a website using GitHub.

GitHub offers a service called GitHub Pages to host your personal website directly from a repository in your GitHub account. It's a powerful tool that's gaining traction among developers and non-developers alike, thanks to its simplicity, speed, and accessibility. So, let's brave the world of web creation and make your online presence a reality.

Understanding GitHub Pages and Static Sites

Before we embark on our journey, let's understand what GitHub Pages is and why it uses static sites. GitHub Pages is a static site hosting service, meaning it serves plain HTML, CSS, and JavaScript files. This makes it lightweight, performant, and perfect for personal websites or portfolios. Static sites are also easier to understand and manage compared to dynamic sites.

AD
How to Host a Website for Free Using GitHub Pages
How to Host a Website for Free Using GitHub Pages
How to Get Started With GitHub in 2026 and Build Real Projects Fast
How to Get Started With GitHub in 2026 and Build Real Projects Fast
GitHub Basics Tutorial - How to Use GitHub
GitHub Basics Tutorial - How to Use GitHub

prophylaxis, GitHub uses a naming convention based on your username to host your website. For instance, if your GitHub username is 'johndoe', your website would be accessible at https://johndoe.github.io/. That's a nice, clean URL!

Creating a GitHub Account (If You Don't Have One)

If you don't have a GitHub account, sign up for one at https://github.com/. It's free, and you'll gain access to a vast network of developers and resources.

Host a website in under 2 minutes (Github Pages)
Host a website in under 2 minutes (Github Pages)
GitHub Beginner Guide: 8 Easy Steps to Start Coding in 2026
GitHub Beginner Guide: 8 Easy Steps to Start Coding in 2026

Once you're in, familiarize yourself with the interface. It may feel intimidating at first, but GitHub is actually quite user-friendly once you grasp the lingo and workflows.

Setting Up GitHub Pages

Now that you're set up, it's time to configure GitHub Pages. Navigate to the Settings tab inside any of your repositories. Look for the Pages setting, click on it, then click Enable GitHub Pages. Select your theme and your repository name (usually 'yourusername.github.io'), then click Save.

AD

After a few minutes, your personal website will be live at 'yourusername.github.io'. Congratulations, you've just launched your first website!

Customizing Your Website

Your website is live, but it's still pretty boring. Let's jazz it up with some customization. GitHub Pages supports a variety of static site generators, but Jekyll is the default and easiest to use.

In your repository, create a new folder named _layouts. Inside, create another file called default.html. This is where you'll start building your website's structure.

AD

Designing Your Website (HTML, CSS)

With the default.html file open, you can start creating your website's layout. It's just HTML, so use the same tags and formats you'd use in any other HTML document. For example:

```html Your Title

Hello, World!

This is your new website!

```

Too much typing? Use a text editor or IDE that supports GitHub Flavored Markdown and HTML like Atom or Visual Studio Code for a smoother workflow.

AD

Adding Style with CSS

Create a new folder named css. In this folder, create another file called styles.css. Here, you can start adding style to your website:

```css body { font-family: Arial, sans-serif; background-color: #f0f0f0; margin: 0; padding: 0; } h1 { color: #333; } ```

To use these styles, add a link to your stylesheet in the head section of your HTML file:

```html Your Title ```

Now, your website should look a whole lot better!

Publishing Your Changes

Once you're happy with your design, you need to push your changes back to GitHub. Open a terminal, navigate to your repository folder, and use the following commands:

```bash git add . git commit -m "Your commit message" git push origin master ```

Your changes should now be live on your website!

Custom Domain (Optional)

If you prefer a custom domain like 'example.com' instead of 'yourusername.github.io', GitHub Pages supports that too. Buy a custom domain, and update your domain's CNAME record to 'yourusername.github.io'. Then, in your GitHub repository settings, add your custom domain to the Pages section. Voila! Your website now lives at 'example.com'.

Creating a website with GitHub is fun, rewarding, and surprisingly easy. With a bit of tweaking, you could turn it into a personal blog, a portfolio, or even a simple business website. As you grow your skills, consider learning more about version control, GitHub workflows, and other web development techniques. Your online presence can only get better from here!

AD