# Forgejo

Source: https://next.coolify.io/docs/services/forgejo

![forgejo](https://forgejo.org/images/forgejo-wordmark.svg)

## What is Forgejo?

Forgejo is a self-hosted lightweight software forge. It's easy to install and low maintenance, it just does the job.

## Deployment Variants

Forgejo is available in four deployment configurations in Coolify:

### Forgejo (Default)

* **Database:** SQLite (embedded)
* **Use case:** Simple deployments, testing, or personal Git hosting
* **Components:** Single Forgejo container with built-in SQLite database

### Forgejo with PostgreSQL

* **Database:** PostgreSQL
* **Use case:** Production deployments requiring better performance and scalability
* **Components:**
  * Forgejo container
  * PostgreSQL container
  * Automatic database configuration and health checks

### Forgejo with MySQL

* **Database:** MySQL
* **Use case:** Production deployments with MySQL preference
* **Components:**
  * Forgejo container
  * MySQL container
  * Automatic database configuration and health checks

### Forgejo with MariaDB

* **Database:** MariaDB
* **Use case:** Production deployments with MariaDB preference
* **Components:**
  * Forgejo container
  * MariaDB container
  * Automatic database configuration and health checks

## SSH Access

Git over SSH uses a port on the server, because the proxy routes only HTTP and HTTPS by domain. The default port is `22222`, and Forgejo shows it in the SSH clone URL.

To run more than one Forgejo instance on the same server, set the `FORGEJO_SSH_PORT` environment variable to a free port for each instance, then redeploy. Cloning over HTTPS always works through the domain.

## Forgejo Actions Runner

Forgejo has available a first party "actions runner" to [execute task jobs on a repository](https://forgejo.org/docs/latest/user/actions/), much like [GitHub Actions](https://docs.github.com/en/actions) or [GitLab CI](https://docs.gitlab.com/ee/ci/index.html).

Coolify includes Forgejo services with a single runner, using [Docker-in-Docker](https://hub.docker.com/_/docker) to run the jobs. They are available with SQLite, PostgreSQL, MySQL, and MariaDB, like the variants above.

The runner is ready after the deployment. No manual setup is necessary:

* Coolify generates the shared secret (`SERVICE_HEX_64_RUNNER`) that the runner uses to register.
* The Forgejo installation is completed for you. Log in with the administrator credentials from the `SERVICE_USER_ADMIN` and `SERVICE_PASSWORD_ADMIN` environment variables. Set `FORGEJO_ADMIN_EMAIL` to change the administrator email before the first deployment.
* Jobs can use the labels `docker` (Node.js 22), `ubuntu-latest`, and `ubuntu-22.04`. A job can also use Docker commands, for example to build images.

Forgejo is also compatible with third-party CI apps and platforms. Forgejo is a Gitea-fork, so instructions to incorporate these CI may be the same for both.

## Demo

* [Demo](https://next.forgejo.org/)

## Links

* [The official website](https://forgejo.org/)
* [Codeberg](https://codeberg.org/forgejo/forgejo)
