---
title: "Deploy GitBucket"
description: "Self-hosted Git server with issues, pull requests and a GitHub-style API"
category: "Other"
url: https://railway.com/deploy/gitbucket-1
---

# Deploy GitBucket

Self-hosted Git server with issues, pull requests and a GitHub-style API

**[Deploy GitBucket on Railway](https://railway.com/template/gitbucket-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/gitbucket-1/manifest.json

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

## Template content

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

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

### gitbucket https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/gitbucket.png

- **Source:** https://github.com/aalfath/gitbucket-railway-template
- **Health check:** /signin
- **Public domain:** Yes

## Documentation

# Deploy and Host GitBucket on Railway

GitBucket is an open-source Git platform written in Scala. It gives a team its own Git server with public and private repositories over HTTPS and SSH, issues, pull requests with code review, wikis, releases and a GitHub-compatible REST API, all in one Java application. This template runs GitBucket 4.48.0 from the official image (Apache-2.0).

## About Hosting GitBucket

GitBucket needs a JVM, a database and a disk for its Git repositories. This template runs the official image with PostgreSQL on Railway's private network, keeps repositories, wikis, attachments, plugins and the SSH host key on a volume, and serves the web UI, API and Git over HTTPS on a public domain. A Railway TCP proxy carries Git over SSH. GitBucket ships with an admin account `root`/`root`; here the start script replaces that password with a generated one before the public port opens. Nothing has to be typed in at deploy time. After deploy, sign in as `root` with `ADMIN_PASSWORD` from the `gitbucket` service's Variables tab.

## Common Use Cases

* Private Git hosting for a team, with issues, pull requests and wikis, on your own infrastructure
* A GitHub-compatible API (`/api/v3`) for testing integrations and scripts without github.com rate limits
* A self-hosted mirror or archive of repositories, reachable over HTTPS and SSH

## Dependencies for GitBucket Hosting

* PostgreSQL (Railway's PostgreSQL service)
* A volume for Git repositories and attachments (included)

### Deployment Dependencies

* GitBucket source and docs: https://github.com/gitbucket/gitbucket
* GitBucket 4.48.0 release: https://github.com/gitbucket/gitbucket/releases/tag/4.48.0
* Official Docker image: https://github.com/gitbucket/gitbucket-docker
* Template repository: https://github.com/aalfath/gitbucket-railway-template

### Implementation Details

Services in this template:

* **gitbucket** (public): the official GitBucket image, pinned by version and digest, built from the template repo. Web UI, REST API and Git over HTTPS on the public domain, Git over SSH on a TCP proxy, data on a volume at `/gitbucket`. Health check `/signin`.
* **Postgres**: accounts, issues, pull requests and settings, on its own volume.

After deploy:

1. Open the public URL and sign in as `root` with the `ADMIN_PASSWORD` value from the `gitbucket` service's Variables tab.
2. Add users under Administration, User management. Self-registration is off by default.
3. Anonymous access is on by default, as upstream ships it, so public repositories are readable without an account. Turn it off in System settings for a fully private server.
4. For SSH, add your key under Account settings, SSH keys, and use the `ssh://git@…` clone URL GitBucket shows.
5. Email notifications are optional: set SMTP in System settings.

GitBucket runs within 0.5 GB RAM / 1 vCPU (tested: about 0.4 GB after pushing and browsing a 1,100-file repository). The JVM heap is sized to the memory limit, and an unexpected stop exits non-zero so Railway restarts it. When we release a new version in the template repo, Railway shows an update notice on your project; read the CHANGELOG, back up Postgres and the volume, then apply it. GitBucket migrates its database on start.

## Why Deploy GitBucket 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 GitBucket 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.



## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/gitbucket-1
