devlk
c/showcase u/devlk Team

How do I host my portfolio for free on GitHub Pages?

Team FAQ: this question comes up often, so we've answered it below. Add your own experience, or a different view, in the comments.

You've built a portfolio site and want it online without paying for hosting. How does GitHub Pages work?

1
1 comment
No account needed: you'll get a random guest name, kept on this device. Or sign up to choose yours.
Sort by: Best Top New Old
devlk Team·

GitHub Pages hosts static sites (HTML, CSS, JavaScript) for free from a repository. It's ideal for portfolios, documentation and project demos.

Quick setup for a personal site:

  1. Create a public repo named <username>.github.io (for example your-username.github.io).
  2. Push your site with an index.html at the root.
  3. Go to Settings > Pages and set the source to Deploy from a branch, branch main, folder / (root).
  4. After a minute or two, it's live at https://<username>.github.io.

For any other repo, the same settings publish it at https://<username>.github.io/<repo-name>/.

Using React, Vue, Astro or another build tool? Choose GitHub Actions as the source in Settings > Pages. GitHub suggests a workflow for common frameworks that builds and deploys on every push. For apps built with Vite or similar, set the base path to /<repo-name>/ if it's not your username.github.io repo, or assets will 404.

Custom domain: add it under Settings > Pages, then create the DNS records GitHub shows (a CNAME record for www, or A records for the root domain). Tick Enforce HTTPS once the certificate is issued.

Limits to know:

  • Static only: no PHP, Node.js server or database. Use a separate API service if you need a backend.
  • Free accounts can publish Pages from public repos; private repo Pages needs a paid plan.
  • It's meant for personal, project and documentation sites, not online shops or commercial SaaS, and has soft limits on site size and bandwidth.

A portfolio is only as good as what's in it: developer portfolio projects that impress hiring managers.

Hosted your portfolio somewhere else? Share what you used and why.

1