Deploy GitBucket
Self-hosted Git server with issues, pull requests and a GitHub-style API
Just deployed
/var/lib/postgresql/data
gitbucket
Just deployed
/gitbucket
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:
- Open the public URL and sign in as
rootwith theADMIN_PASSWORDvalue from thegitbucketservice's Variables tab. - Add users under Administration, User management. Self-registration is off by default.
- 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.
- For SSH, add your key under Account settings, SSH keys, and use the
ssh://git@…clone URL GitBucket shows. - 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.
Template Content
