What URL will my Codeberg Pages site have?

Updated

Your Codeberg Pages site is served at https://USERNAME.codeberg.page/REPOSITORY, where USERNAME is your Codeberg user or organization name and REPOSITORY is the name of the repository holding the site. The one exception: if the repository is named pages, the repository segment is dropped and the site lives at https://USERNAME.codeberg.page/. If you attach a custom domain, visitors use that domain instead.

The default URL structure

Codeberg Pages maps a repository to a subdomain of codeberg.page:

Repository Resulting URL
https://codeberg.org/USERNAME/my-blog https://USERNAME.codeberg.page/my-blog
https://codeberg.org/USERNAME/pages https://USERNAME.codeberg.page/

Two details matter here:

  • USERNAME is the owner, not the pusher. If the repository belongs to an organization, the organization name appears in the URL, not your personal username.
  • The repository name is case-sensitive in the URL path. Match the exact repository name as it appears on Codeberg.

Why the pages repository is special

A repository literally named pages is treated as the account's main site, so it occupies the bare subdomain https://USERNAME.codeberg.page/ with no path segment. This is the closest equivalent to a "user site" — one per account, at the root of your subdomain.

Any other repository name becomes a path under that subdomain. So USERNAME.codeberg.page/REPOSITORY is the general case, and USERNAME.codeberg.page/ is the reserved case for the repository named pages.

What you need for the URL to resolve

The URL only serves content once three things are in place:

  1. A public repository — private repositories are not served.
  2. A branch named pages — this is the branch Codeberg Pages deploys from, regardless of your default branch.
  3. Deployment configured — either a Forgejo Actions workflow (for static site generators like Jekyll or Hugo) or a webhook pointing at your site URL with the branch filter set to pages.

If you use the webhook route, the Target URL you enter is the same URL your visitors will use — https://USERNAME.codeberg.page/REPOSITORY (or without the repository segment when the repo is named pages). Setting it correctly is what tells the deploy server where the site belongs.

Switching to a custom domain

Once a custom domain is configured, that domain becomes the address visitors use; the codeberg.page URL is no longer the public entry point. Configuration involves:

  • A DNS record: CNAME codeberg.page. — or ALIAS codeberg.page. for apex domains where CNAME does not work.
  • If ALIAS is unsupported, a TXT record plus A 217.197.84.141 and AAAA 2a0a:4580:103f:c0de::2.
  • A TXT record on _git-pages-repository containing the Git HTTPS clone URL of your repository (https://codeberg.org/user/repo.git), which authorizes the Pages server to deploy it.

Plan your repository name with this in mind: renaming a repository later changes its default URL, so pick the name you want before you start publishing.