How to create a personal website with GitHub pages (2024)

You can use GitHub pages to create and host a personal website, which can be accessible to the public. GitHub pages is a free resource that you can use to showcase your talents and feature your work.

“GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.”
~Github Hello World

Follow the steps below to create your project. Don’t worry if you don’t know some of the terms. Keep reading for terms definitions below.

  1. Go to https://github.com and click the ‘Sign up’ button. Follow the prompts and enter in your information.
How to create a personal website with GitHub pages (3)

2. Create your project’s repository. Login to your GitHub account and go to https://github.com/new or click the green ‘New’ button next to Repositories.

How to create a personal website with GitHub pages (4)

3. Enter your username in the Repository field. You will see a green message saying you found a secret.

Leave the default setting to public and check the ‘Add a README file’ box.

How to create a personal website with GitHub pages (6)

4. Create a new file by clicking the ‘creating a new file’ link under the Set up in Desktop button.

How to create a personal website with GitHub pages (7)

5. Enter index.html in the field next to your username.

How to create a personal website with GitHub pages (8)

6. Enter the following into the ‘Edit new file’ window, updating the text in capital letters with YOUR NAME and YOUREMAIL:


<!DOCTYPE html>
<html>
<head>
<title>YOUR NAME Portfolio</title>
</head>
<body>
<nav>
<ul>
<li><a href=”/”>Home</a></li>
<li><a href=”/about”>About</a></li>
<li><a href=”/resume”>Resume</a></li>
<li><a href=”/blog”>Blog</a></li>
</ul>
</nav>
<div class=”container”>
<div class=”blurb”>
<h1>Hi, I am YOUR NAME!</h1>
<p>This is my first page for my personal website!</a></p>
</div>
</div>
<footer>
<ul>
<li><a href=”mailto:YOUREMAIL”>YOUREMAIL</a></li>
</ul>
</footer>
</body>
</html>

7. Scroll to the bottom of the window and add a message to field under ‘Commit new file’. Then click the green ‘Commit new file’ button.

How to create a personal website with GitHub pages (9)

You will then be redirected to your project repository, where you will see the README.md file and the index.html file.

Congratulations! You have created your personal webpage. Once you are redirected page to the repository, select the ‘Settings’ link.

How to create a personal website with GitHub pages (10)

8. Then select ‘Pages’ on the left sidebar menu.

How to create a personal website with GitHub pages (11)

9. Under Source, select the dropdown and select the main branch and leave the default as root and click the ‘Save’ button. You will then see a confirmation message with the link to your new website. For ex: https://jbaum02s.github.io/jbaum02s/. Visit the link to see your new page.

How to create a personal website with GitHub pages (12)

You will see the content from the code, without any styles applied.

How to create a personal website with GitHub pages (13)

10. To style the content click the ‘Add file’ > ‘Create a new file’ button. Create a new file named css/styles.css. The css/ before the filename will automatically create a subdirectory called css as you type.

How to create a personal website with GitHub pages (14)

11. Paste the following into the ‘Edit new file’ window:

body {
margin: 60px auto;
width: 70%;
}
nav ul, footer ul {
font-family:'Helvetica', 'Arial', 'Sans-Serif';
padding: 0px;
list-style: none;
font-weight: bold;
}
nav ul li, footer ul li {
display: inline;
margin-right: 20px;
}
a {
text-decoration: none;
color: #999;
}
a:hover {
text-decoration: underline;
}
h1 {
font-size: 3em;
font-family:'Helvetica', 'Arial', 'Sans-Serif';
}
p {
font-size: 1.5em;
line-height: 1.4em;
color: #333;
}
footer {
border-top: 1px solid #d5d5d5;
font-size: .8em;
}

ul.posts {
margin: 20px auto 40px;
font-size: 1.5em;
}

ul.posts li {
list-style: none;
}

You will then be redirected to the css directory with your new file. You can click on your username to get back to the main folder.

How to create a personal website with GitHub pages (15)

Now we need to link your new css file in the index.html file in order for your styles to display. Link to your CSS file inside your HTML document’s <head>.

12. Click on your index.html and select the “Edit” button which is a pencil in the right side on the file window.

How to create a personal website with GitHub pages (16)

13. Enter the following in between your<head> and </head> tags, after the title, in your index.html file

<link rel="stylesheet" href="css/styles.css">
How to create a personal website with GitHub pages (17)

Add a message and commit your changes.

Go back to your webpage and refresh your browser. You should now see your page with the menu displayed horizontally, the fonts different sizes, etc.

How to create a personal website with GitHub pages (18)

Additional files can be added directly through the browser, like in the previous steps, or they can be uploaded to the repository. Select ‘Add file’ > ‘Upload files’ to do so.

How to create a personal website with GitHub pages (19)

Repository contains all of your project’s files and each file’s revision history.

Commit — creating a commit is like taking a snapshot of your repository. These commits are snapshots of your entire repository at specific times.

Branch — When you create a repository with content on GitHub.com, GitHub creates the repository with a single branch. This first branch in the repository is the default branch. The default branch is the branch that GitHub displays when anyone visits your repository. The default branch is also the initial branch that Git checks out locally when someone clones the repository. Unless you specify a different branch, the default branch in a repository is the base branch for new pull requests and code commits.

GitHub Page — is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website. By default, GitHub names the default branch main in any new repository.

How to create a personal website with GitHub pages (2024)

FAQs

Are GitHub Pages good for a personal website? ›

This allows you to easily deploy and update sites without needing separate hosting. There are two types of GitHub Pages sites: Project Pages and User/Organization Pages. Since you're building a personal site, you'll use a User Page which is tied to your user account rather than a specific project repository.

How to create a personal web page on GitHub? ›

Creating your site
  1. On GitHub, navigate to your site's repository.
  2. Decide which publishing source you want to use. ...
  3. Create the entry file for your site. ...
  4. Configure your publishing source. ...
  5. Under your repository name, click Settings. ...
  6. In the "Code and automation" section of the sidebar, click Pages.

Can I host my website on GitHub Pages? ›

You can use GitHub Pages to host a website about yourself, your organization, or your project directly from a repository on GitHub.com.

Can a GitHub Pages site be private? ›

With access control for GitHub Pages, you can restrict access to your project site by publishing the site privately. A privately published site can only be accessed by people with read access to the repository the site is published from.

Does GitHub give you a free website? ›

This is all possible thanks to the GitHub Pages feature, which is GitHub's very own free hosting service. Using GitHub Pages, you can create a website by simply publishing static HTML, JavaScript, and CSS files from GitHub's repository.

Do you need to buy a domain for GitHub Pages? ›

You must purchase a domain from certain vendors such as. For test projects or unofficial websites, I would use the URL that GitHub pages created, however, if it is for an official website (such as my website Elephant - The Ultimate Student Suite) I would consider investing in a domain.

Does GitHub Pages cost money? ›

How much does GitHub Pages cost? GitHub Pages is free of charge for every GitHub user. It is available in public GitHub repositories with a GitHub Free account, plus available in public and private GitHub repositories with a GitHub Pro, GitHub Team or GitHub Enterprise account.

Can I publish my website on GitHub for free? ›

Is GitHub hosting free, or are there any costs involved? GitHub offers free hosting for static websites through GitHub Pages. However, if you require custom domain support or need to host private repositories, there may be additional costs associated with those features.

How to create a personal website for free? ›

  1. Define your message. First and foremost, ask yourself why you're creating a personal website. ...
  2. Look for inspiration. Before creating your personal website, browse the web for inspiration. ...
  3. Choose a template. ...
  4. Add your own content. ...
  5. Customize your design. ...
  6. Make sure you're mobile-friendly. ...
  7. Optimize for SEO. ...
  8. Get a second opinion.

Why is GitHub not hosting my website? ›

If you have named your repository correctly like <username>. github.io , and it is showing Github pages is under maintenance, then wait for a few minutes and then refresh. Your site will show up. But, if it is showing 404 error, then check if you have index.

Can GitHub host a dynamic website? ›

Can GitHub host a dynamic website? No, GitHub cannot host dynamic websites. But you can utilise serverless backend to provide dynamic features. Example of serverless backend services are Google Firebase, AWS API Gateway, MongoDB Stitch etc.

How to use GitHub for web development? ›

Basic Git Workflow for Collaborative Projects
  1. Get a local copy of the project by cloning a repository, or repo. ...
  2. Create a branch with a representative name of the feature you'll be working on.
  3. Edit the project.
  4. Commit the changes to your local machine.
  5. Push the changes to the remote repo.
Jan 11, 2022

How to live a website on GitHub? ›

Steps to follow
  1. Creating a new repository. To set up a new public repository on GitHub, please follow the given steps: ...
  2. Setting up the repository on GitHub. Rules for repository name.
  3. Upload site code to GitHub repository. ...
  4. Go to “Settings” option. ...
  5. Navigate to “GitHub Pages” page. ...
  6. Select the branch. ...
  7. Publishing an site.

Is GitHub a secure website? ›

GitHub has security features that help keep code and secrets secure in repositories and across organizations.

How to create a portfolio website on GitHub? ›

It's a fantastic way to highlight your work, share your story, and stand out in the tech world.
  1. Step 1: Set Up a GitHub Account. ...
  2. Step 2: Create a New Repository. ...
  3. Step 3: Choose a Theme. ...
  4. Step 4: Customize Your Portfolio. ...
  5. Step 5: Project Pages. ...
  6. Step 6: Local Testing with Jekyll (Optional) ...
  7. Step 7: Commit and Push Changes.
Oct 14, 2023

Is GitHub Pages better than WordPress? ›

Hosting: GitHub Pages is primarily a hosting platform for static websites, while WordPress is a content management system that allows for both static and dynamic content. GitHub Pages is best suited for simple websites or portfolios, while WordPress offers more flexibility for complex sites with dynamic content.

What is the benefit of GitHub Pages? ›

GitHub Pages is one of the best features of GitHub. It is a service that allows you to host a static website directly from a GitHub repository. This means you can use your repository to store your website's code and files, and GitHub will automatically publish them as a website you can access online.

Is GitHub Pages good for SEO? ›

One of the appealing aspects of using GitHub Pages is the SEO advantage it inherently provides. Sites hosted on GitHub Pages get a subdomain under github.io, benefiting from GitHub's strong reputation and high domain authority.

Is GitHub Pages good for resume? ›

It shows you know how to write code

It's easy to claim you're a programmer, but it's another thing to prove it. Showcasing GitHub work on your resume gives a prospective employer tangible evidence of your skills. (This is especially important if you don't have professional programming work experience yet.)

References

Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 6487

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.