Codeberg Pages allows you to easily publish static websites with a human-friendly address (`{username}.codeberg.page`) or your custom domain on Codeberg.
Codeberg Pages are served using a deployment of [git-pages](https://git-pages.org/), which itself is [developed on Codeberg](https://codeberg.org/git-pages/git-pages).
It is free/libre open source software.
Git-pages works with any Forgejo host out there, as well as many other Git forges.
If you are running your own forge, you can also run it yourself and help with the development.
There are two ways to get started with Codeberg Pages on git-pages:
1. Using a [webhook](/advanced/using-webhooks/) on your repository
2. Using [Forgejo Actions](/codeberg-pages/forgejo-actions/) to deploy the output of a static site generator
This page documents the first method. See the [separate page on using Forgejo Actions](/codeberg-pages/forgejo-actions/) for information on the second method.
### User/organization websites
1. Create a repository called `pages` under your own username or under the organization you want to create a website for
5. Enter `https://username.codeberg.page/` as the **Target URL**, replacing the `username` with your Codeberg username or organization name. This is the URL your website will be available from.
6. Set the **Branch filter** to `pages`.
7. Click the **Add webhook** button at the bottom of the settings page.
8. Push or upload your content to the `pages` branch, and it will automatically be published to `https://username.codeberg.page/`.
4. Enter `https://username.codeberg.page/repository-name/` as the **Target URL**, replacing the `username` with your Codeberg username or organization name, and `repository-name` with the name of your repository. This is the URL your website will be available from.
7. Push or upload your content to a branch called `pages` on your repository, and it will automatically be published to `https://username.codeberg.page/repository-name/`.
## Getting started with a custom domain
{% admonition "warning" %}
You can only use the ‘legacy’ v2 Pages deployment method at the moment if you want to serve your site with a custom domain.
Websites deployed this way will keep working indefinitely.
You will be able to seamlessly migrate to the new version of Pages once it is supported.
{% endadmonition %}
There are two steps to getting started with a custom domain: configuration on Codeberg’s side, and configuration on the side of your DNS.
To set up your website for publication on a custom domain on the Codeberg side, simply upload your content to a branch of a repository called `pages`. You then also need to create a plain text file called `.domains` listing the domains your website should be available at.
You then need to set up DNS records to point to Codeberg. Instructions on how to do this are available on the [documentation page about using custom domains](/codeberg-pages/using-custom-domain/).
## Having problems?
See our [troubleshooting page](/codeberg-pages/troubleshooting).
## Advanced usage: custom 404 pages, redirects, and rewrites
For sites hosted with Codeberg Pages, you can customize the look of the 404 page when someone tries to access a page that doesn’t exist, and you can make URLs redirect to other URLs or serve the same content as at some other URL.
See the [advanced usage](/codeberg-pages/advanced-usage/) documentation to learn how to do these things.
## Do you have questions, feedback, or have you found a bug?
Support for Codeberg Pages is available at the [Pages Server repository](https://codeberg.org/Codeberg/pages-server);