Skip to content
FR EN

Publish your first website for free with GitHub Pages

Time 15 min Level Intermediate Updated

GitHub Pages hosts static sites (HTML, CSS, JavaScript) for free. Ideal for a portfolio or a landing page.

  1. Create the repository

    On github.com, click New repository. Name it yourname.github.io and choose Public.

  2. Add the home page

    Click Add file › Create new file, name it index.html and paste:

    <!doctype html>
    <html lang="en">
    <head><meta charset="utf-8"><title>My site</title></head>
    <body><h1>Hello!</h1></body>
    </html>
    html
  1. Turn on Pages

    In Settings › Pages, pick the main branch as the source, then Save.

  2. Open your site

    After a minute or two, your site is live at https://yourname.github.io. Every change you commit updates it.

Good to know : To use your own domain name, add it under Settings › Pages › Custom domain.

Read next