Self-hosting Forgejo the easy way

Self-hosting Forgejo the easy way

Yulei Chen - Content-Engineerin bei sliplane.ioYulei Chen
4 min

Forgejo is a lightweight, open-source software forge. Think of it as your own self-hosted GitHub: Git hosting, pull requests, issue tracking, CI/CD with Forgejo Actions, and more. It's a community-driven fork of Gitea, focused on staying truly free and open.

Sliplane is a managed container platform that makes self-hosting painless. With one-click deployment, you can get Forgejo running in minutes - no server setup, no reverse proxy config, no infrastructure to maintain.

Prerequisites

Before deploying, ensure you have a Sliplane account (free trial available).

Quick start

Sliplane provides one-click deployment with presets.

SliplaneDeploy Forgejo >
  1. Click the deploy button above
  2. Select a project
  3. Select a server. If you just signed up you get a 48-hour free trial server
  4. Click Deploy!

About the preset

The one-click deploy above uses Sliplane's Forgejo preset. Here's what it includes:

  • Forgejo 8 image (codeberg.org/forgejo/forgejo:8) - check Codeberg for newer versions
  • Persistent storage mounted to /data for repositories, database, and configuration
  • Healthcheck configured on the web UI port
  • Ready for HTTPS out of the box via Sliplane's automatic TLS

Next steps

Once Forgejo is running, open the domain Sliplane provided (e.g. forgejo-xxxx.sliplane.app).

Initial setup

On your first visit, Forgejo shows an installation page. Most settings are pre-configured, but you'll want to:

  1. Set the Site Title to whatever you like
  2. Create an Administrator Account at the bottom of the page
  3. Click Install Forgejo

After that, you're logged in and ready to create repositories.

Configuration

Forgejo stores its configuration in /data/gitea/conf/app.ini inside the container. You can customize behavior through environment variables using the FORGEJO__section__key format. For example:

VariableDescription
FORGEJO__server__ROOT_URLThe public URL of your instance
FORGEJO__mailer__ENABLEDEnable email notifications (true/false)
FORGEJO__service__DISABLE_REGISTRATIONDisable public sign-ups after creating your admin account

See the Forgejo configuration cheat sheet for the full list of options.

SSH access

The preset runs Forgejo's built-in SSH server. If you need SSH-based Git access, you can configure it through the Forgejo admin panel or environment variables. For most users, HTTPS cloning works out of the box with the domain Sliplane provides.

Logging

By default, Forgejo logs to STDOUT, which works well with Sliplane's built-in log viewer. You can adjust the log level by setting the FORGEJO__log__LEVEL variable to debug, info, warn, or error. For general Docker log tips, check out our post on how to use Docker logs.

Cost comparison

Here's how self-hosting Forgejo on different platforms compares:

ProvidervCPU CoresRAMDiskEstimated Monthly CostNotes
Sliplane22 GB40 GB€9charge per server
Render12 GB40 GB~$35-$45VM Small
Fly.io22 GB40 GB~$20-$25VM + volume
Railway22 GB40 GB~$15-$66Usage-based

FAQ

Can Forgejo replace GitHub for my team?

For most small-to-medium teams, yes. Forgejo supports Git hosting, pull requests, code review, issue tracking, a package registry, and CI/CD via Forgejo Actions. You won't get GitHub's massive ecosystem of integrations, but for day-to-day development workflows, Forgejo covers the essentials.

How do I disable public registration?

Set the environment variable FORGEJO__service__DISABLE_REGISTRATION to true and redeploy. This is recommended after you've created your admin account and invited your team.

How do I update Forgejo?

Change the image tag in your service settings (e.g. from forgejo:8 to a newer version) and redeploy. Check Codeberg for the latest stable release. Forgejo handles database migrations automatically on startup.

What's the difference between Forgejo and Gitea?

Forgejo is a hard fork of Gitea, created in 2022 when the Gitea community had governance concerns. Both share the same codebase roots, but Forgejo is run by a community-driven organization and focuses on staying fully open source. Feature-wise, they're very similar.

Can I migrate repositories from GitHub or GitLab?

Yes. Forgejo has a built-in migration tool that can import repositories (including issues, pull requests, and labels) from GitHub, GitLab, Gitea, and other platforms. You can find it under New Migration in the UI.

Self-host Forgejo now - It's easy!

Sliplane gives you everything you need to run your own Git forge without server hassle.