Host static websites with Codeberg Pages!

It's quick, easy, free & fast - just put your open source project's homepage, developer blog or web experiment into a Git repository at Codeberg, and we'll do the rest.

Set up your website (with CI)

If you use a static site generator like Jekyll, Hugo, or any other similar tool, you can integrate deployment into the Forgejo Actions workflow which builds your site.

To learn how to do this, see our documentation.

Set up your website (without CI)

If you just want to serve plain old hand-made static files, you can also configure a webhook on your repository to deploy changes to Codeberg Pages.

1 Set up your repository

Create a public repository named pages with a branch called pages to make the site available at the main subdomain.


or

Create a branch pages in a public repository:
git switch --orphan pages
git rm --cached -r .

2 Set up deployment

In the Settings for your repository, go to Webhooks and click Add webhook.

Select Forgejo from the drop down list of webhook types.

Set the Target URL to the URL of your website. If you don’t have a custom domain, that’s https://USERNAME.codeberg.page/REPOSITORY, replacing USERNAME with your user or organization name and REPOSITORY with the name of your repository. (If your repository is called pages, omit it.) If you have a custom domain, remember to configure it with the instructions below.

Set the Branch filter to pages.

Click Add webhook.

3 Upload your files and you’re done!

Push your static content, HTML, style, fonts, images or anything else. They will be accessible at https://USERNAME.codeberg.page[/REPOSITORY].

Custom domain configuration

To use a custom domain, create a file .domains in your pages branch with the domain name you wish to use.

Then, add a DNS record for that domain:
CNAME [[branch.]repo.]user.codeberg.page.

Or for apex domains where CNAME doesn't work:
ALIAS codeberg.page.
TXT [[branch.]repo.]user.codeberg.page

If ALIAS isn't supported, use add the TXT record as described above, and use A+AAAA as following:

A 217.197.84.141
AAAA 2a0a:4580:103f:c0de::2