Deploy Gitea
Lightweight self-hosted Git forge with issues, pull requests, and wikis.
Just deployed
/var/lib/postgresql/data
Gitea
Just deployed
/data
Deploy and Host Gitea on Railway
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
postgrestemplate) for users, repositories, issues, and application metadata - Persistent volumes for Gitea data at
/dataand PostgreSQL data at/var/lib/postgresql/data
Deployment Dependencies
- Gitea documentation
- Installation with Docker
- Configuration cheat sheet
- Reverse proxy configuration
- Gitea source repository
- Official container image —
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, andON_FAILURErestart policy with ten retries. - Postgres: Railway's official PostgreSQL template (
ghcr.io/railwayapp-templates/postgres-ssl:18) with its persistent data volume. Gitea usesPGHOST,PGPORT,PGDATABASE,PGUSER, andPGPASSWORDreferences 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=trueskips 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, setGITEA__service__DISABLE_REGISTRATION=trueto 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/giteaand/etc/giteamounts, MariaDB, and an exposed SSH port. Railway uses the non-rootless image so one/datavolume 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.
Template Content
