Bohdan Danyliuk
← All guides

How to Create and Host a Website for Free

Generate a website with ChatGPT and publish it on GitHub Pages in 15 minutes. All free, no coding experience needed.

LevelBeginnerTime~15 min

What you’ll end up with

A real website on the internet with your own address — for example, https://your_login.github.io.

Try it right here — edit the code and see the result immediately:

index.htmleditable — try changing something!
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>Ivan Ivanov — photographer</title>
  <style>
    body {
      font-family: system-ui, sans-serif;
      margin: 0;
      min-height: 100vh;
      display: grid;
      place-items: center;
      background: #0f1115;
      color: #fff;
      text-align: center;
    }
    h1 { color: #d97757; font-size: 2.5rem; margin: 0; }
    p { color: #9ca3af; max-width: 32rem; }
    a {
      display: inline-block;
      margin-top: 1rem;
      padding: 0.6rem 1.4rem;
      background: #d97757;
      color: #fff;
      border-radius: 0.5rem;
      text-decoration: none;
    }
  </style>
</head>
<body>
  <div>
    <h1>Ivan Ivanov</h1>
    <p>Photographer. I shoot life, not poses.</p>
    <a href="#">My work</a>
  </div>
</body>
</html>

What you’ll need

Nothing else. Everything runs right in your browser — no payment needed.

Step by step

  1. Find a reference site

    Find a website online whose design you like. Copy the link — ChatGPT will build you a site in a similar style, but with your content.

  2. Generate the site in ChatGPT

    Sign up for ChatGPT and send the prompt from the template below — substitute your link and your own info:

    Prompt for ChatGPT
    Create a website similar to [REFERENCE SITE LINK].
    
    But it must be my own working page. Tell about me: [what you do, your experience], my work: [services/projects], contacts: [phone, email, socials], service prices: [your list].
    
    Requirements: everything in a single index.html file (HTML + CSS inside), mobile-friendly, modern design.
    The prompt in ChatGPT and the generated code
    ChatGPT generates the whole site as one file
    The prompt in ChatGPT and the generated code

    Press Copy on the code block — you’ll need it in step 6.

  3. Sign up for GitHub

    Go to github.com and create an account:

    The GitHub homepage
    github.com — the Sign up button is in the top right corner
    The GitHub homepage
  4. Create a repository

    Press the “+” in the top right corner → New repository and name it exactly your_login.github.io:

    Creating the ivanov-dev.github.io repository
    The repository name = the address of your future site
    Creating the ivanov-dev.github.io repository

    The name can't be changed later

    Name the repository login.github.io — lowercase, no spaces. Then the site will open at https://login.github.io with no extra prefixes. It’s the cleanest possible name for a personal page.

    Add a short description, choose PublicCreate repository.

  5. Open the code editor

    The repository is empty, so press the Create a codespace button right on the page — or use the Code → Codespaces menu. An online version of VS Code opens, where you can add, delete and edit files right in your browser.

    The Create a codespace button on the empty repository page
    Press Create a codespace — the online editor opens right in your browser
    The Create a codespace button on the empty repository page
  6. Create index.html and paste the code

    In the file explorer on the left, press new file (+), name it exactly index.html, and paste the code ChatGPT generated:

    Creating index.html in the online editor
    Pasting the ChatGPT code into index.html
    Creating index.html in the online editor
  7. Commit and sync

    Open the Source Control tab (the branch icon on the left), write a message for the change history (e.g. “My first website”) and press Commit. Then press Sync Changes at the bottom and confirm:

    Commit and Sync in Source Control
    Commit, then Sync — the code goes to GitHub
    Commit and Sync in Source Control
  8. Wait a couple of minutes — done!

    GitHub Pages deploys your site in 1–2 minutes. Open https://your_login.github.io — your site is already on the internet 🎉

  9. Improve it as much as you like

    Ask ChatGPT: “make the header sticky”, “add a gallery with a hover effect”, “change the colors to blue”. Each time, ask for the whole file again and repeat steps 6–7 — the site updates in about a minute.

Screenshots are illustrative

The GitHub and ChatGPT interfaces change from time to time — buttons may be named slightly differently, but the order of steps hasn’t changed in years.

Common mistakes

  • The file isn’t named index.html — e.g. Index.html or main.html. GitHub Pages looks for exactly index.html, in lowercase.
  • The repository doesn’t follow the patternlogin-github-io or mysite.github.io won’t work. You need the exact format: login.github.io.
  • Forgot to Sync — a Commit without Sync keeps the changes only on your machine.
  • Checking immediately — deployment takes 1–2 minutes. Refresh the page a bit later.

What’s next?

Once the basic site works, you can: connect your own domain, add a blog page, ask ChatGPT for a dark/light theme with a toggle. All of that — in the next guides in the Learn section. Check the blog too — new stuff appears there.

Questions?

If something didn’t work or you have questions — join the Telegram channel.