Deploy Harness Open Source
Self-hosted Git, code review and artifact registry (formerly Gitness)
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host Harness Open Source on Railway
Harness Open Source (formerly Gitness) is a self-hosted developer platform from Harness, licensed Apache-2.0. It hosts Git repositories with pull requests, code review, branch rules and webhooks, and includes an artifact registry for container images and packages. You get one web UI and a REST API on your own server and database.
About Hosting Harness Open Source
This template runs Harness Open Source 3.3.0 from the official harness/harness image, pinned by version and digest, built from a public GitHub repo. A Railway Postgres database holds users, spaces and pull requests. A volume at /data keeps the Git repositories, uploads, registry blobs and the SSH host key, so nothing is lost on a redeploy. The encryption key, registry secret and admin password are generated at deploy. Railway asks only for your email, and the admin account is created with it on first boot. Open sign-up is off. Git over SSH goes through a Railway TCP proxy. A health check guards every deploy.
Common Use Cases
- Private Git hosting with pull requests and code review for a team or for side projects
- A private container and package registry next to your code
- A self-hosted alternative to GitHub or GitLab for repositories you want to keep on your own infrastructure
Dependencies for Harness Open Source Hosting
- Harness Open Source 3.3.0 (
harness/harness), built from this template's GitHub repo - PostgreSQL (Railway's Postgres service)
Deployment Dependencies
- Harness Open Source source code: https://github.com/harness/harness
- Release 3.3.0: https://github.com/harness/harness/releases/tag/v3.3.0
- Documentation: https://developer.harness.io/docs/open-source
- Settings reference: https://developer.harness.io/docs/open-source/installation/settings
- Template repo, with the changelog: https://github.com/aalfath/harness-open-source-railway-template
Implementation Details
After the deploy finishes:
- Open the Harness service's public URL.
- Sign in as
admin(or with the email you entered). The password is theGITNESS_PRINCIPAL_ADMIN_PASSWORDvariable on the Harness service. Change it in your profile afterwards. - Add team members under Admin, Users. To let anyone register, set
GITNESS_USER_SIGNUP_ENABLED=true. - For Git over HTTPS, create a token in your profile and use it as the password. For Git over SSH, add your public key. The clone URL shown in each repository uses the TCP proxy address.
Pipelines (CI/CD) and Gitspaces start Docker containers, and Railway services have no Docker host, so Gitspaces are turned off. Pipelines can use a Docker host you run elsewhere through GITNESS_DOCKER_HOST. If you add a custom domain, set GITNESS_URL_BASE to it. Email works once you add GITNESS_SMTP_HOST, GITNESS_SMTP_PORT, GITNESS_SMTP_USERNAME, GITNESS_SMTP_PASSWORD and GITNESS_SMTP_FROM_MAIL.
Updates: when a new Harness version is tested, this template's GitHub repo gets the new pinned image and a changelog entry, and Railway shows you an update notice. Read the changelog, then apply the update. Harness migrates its database on start.
Why Deploy Harness Open Source 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 Harness Open Source 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
GITNESS_PRINCIPAL_ADMIN_EMAIL
Your email address. The admin account is created with it on first boot.
