---
title: "Deploy Gitea"
description: "Lightweight self-hosted Git forge with issues, pull requests, and wikis."
category: "Other"
url: https://railway.com/deploy/gitea-2
---

# Deploy Gitea

Lightweight self-hosted Git forge with issues, pull requests, and wikis.

**[Deploy Gitea on Railway](https://railway.com/template/gitea-2)**

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Gitea

- **Image:** gitea/gitea:1.27.1
- **Health check:** /api/healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host Gitea on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/gitea-2)

**Published on the Railway marketplace:** https://railway.com/deploy/gitea-2 (category: Other).

Gitea is a lightweight, self-hosted Git forge for teams and individual developers. It provides repository hosting, code review, issues, pull requests, project boards, package registries, and wikis in a fast Go application, offering a focused alternative to larger source-control platforms while keeping source code and collaboration data under your control.

## About Hosting Gitea

Hosting Gitea requires the web application, a durable database, persistent storage for repositories and attachments, and a correctly configured public URL. This template runs the official Gitea 1.27.1 container with a `/data` volume and Railway's PostgreSQL service. Gitea reaches Postgres over Railway's private network, while Railway terminates public HTTPS and forwards traffic to Gitea on port 3000. The public domain is injected into `DOMAIN` and `ROOT_URL`, so browser links and HTTPS clone URLs use the generated Railway hostname. Database migrations run automatically at startup, and `/api/healthz` gates deployments until the service is ready.

## Common Use Cases

- Hosting private or public Git repositories for an individual, team, or organization
- Managing software development with issues, pull requests, reviews, milestones, and wikis
- Running an internal source-code forge for air-gapped, privacy-sensitive, or compliance-focused workflows

## Dependencies for Gitea Hosting

- PostgreSQL (Railway's official `postgres` template) for users, repositories, issues, and application metadata
- Persistent volumes for Gitea data at `/data` and PostgreSQL data at `/var/lib/postgresql/data`

### Deployment Dependencies

- [Gitea documentation](https://docs.gitea.com/)
- [Installation with Docker](https://docs.gitea.com/installation/install-with-docker)
- [Configuration cheat sheet](https://docs.gitea.com/administration/config-cheat-sheet)
- [Reverse proxy configuration](https://docs.gitea.com/administration/reverse-proxies)
- [Gitea source repository](https://github.com/go-gitea/gitea)
- [Official container image](https://hub.docker.com/r/gitea/gitea) — `gitea/gitea:1.27.1`

## Implementation Details

- **Gitea:** official non-rootless image `gitea/gitea:1.27.1`, one persistent volume at `/data`, public Railway domain on port 3000, health check at `/api/healthz`, and `ON_FAILURE` restart policy with ten retries.
- **Postgres:** Railway's official PostgreSQL template (`ghcr.io/railwayapp-templates/postgres-ssl:18`) with its persistent data volume. Gitea uses `PGHOST`, `PGPORT`, `PGDATABASE`, `PGUSER`, and `PGPASSWORD` references over the private network.
- **Public URL and cloning:** Gitea listens internally over HTTP on port 3000 because Railway terminates TLS. `ROOT_URL=https://${{Gitea.RAILWAY_PUBLIC_DOMAIN}}/` produces HTTPS browser and Git clone URLs; HTTP Git remains enabled. SSH is intentionally disabled because this template does not configure a Railway TCP proxy.
- **First run:** `INSTALL_LOCK=true` skips the public installation wizard because the database is fully configured through variables. Registration starts enabled so the deployer can create the first account, which Gitea promotes to administrator. After that account is created, set `GITEA__service__DISABLE_REGISTRATION=true` to close public registration; administrators can create additional users.
- **Persistence:** the official non-rootless image keeps configuration, repositories, attachments, packages, indexes, and generated application secrets below `/data`. Database migrations run automatically during startup.
- **Umbrel deviation:** Umbrel 1.27.1 uses `gitea/gitea:1.27.1-rootless`, separate `/var/lib/gitea` and `/etc/gitea` mounts, MariaDB, and an exposed SSH port. Railway uses the non-rootless image so one `/data` volume covers all Gitea state, replaces MariaDB with Railway Postgres, and leaves SSH unexposed.

## Why Deploy Gitea on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Gitea on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

---

*This is a community Railway template and is not officially affiliated with the Gitea project.*


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/gitea-2
