---
title: "Deploy DbGate"
description: "Web SQL and NoSQL database client with login and a Railway Postgres ready"
category: "Other"
url: https://railway.com/deploy/dbgate-1
---

# Deploy DbGate

Web SQL and NoSQL database client with login and a Railway Postgres ready

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

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

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

## Template content

### DbGate https://dashboard.snapcraft.io/site_media/appmedia/2023/02/512x512_qejBX2W.png

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

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

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

## Documentation

# Deploy and Host DbGate on Railway

DbGate is an open-source database client that runs in the browser. It works with PostgreSQL, MySQL, MariaDB, SQL Server, MongoDB, Redis, SQLite, CockroachDB and more. Use it to browse and edit table data, write and run SQL, design queries visually, compare schemas, draw ER diagrams, and import or export data.

## About Hosting DbGate

DbGate is a single Node.js web app with no database of its own. It keeps settings, saved connections, scripts and archives in a data folder. This template builds the official `dbgate/dbgate` image, pinned to 7.3.5, from a small GitHub repo, with that folder on a Railway volume so it survives redeploys. Login is always on: the username is `admin` and the password is generated at deploy. A Railway Postgres is included, and DbGate is pointed at it over the private network on first start, so you can run a query straight away. You can add other databases in the DbGate UI as well: anything reachable from the service, including other services in the same Railway project through their private domains.

## Common Use Cases

* Browse, query and edit the Postgres, MySQL, MongoDB or Redis databases in your Railway projects from the browser
* Run ad-hoc SQL, export query results to CSV, Excel or JSON, and import data files into tables
* Compare and sync database schemas, or draw ER diagrams of an existing database

## Dependencies for DbGate Hosting

* A volume for DbGate's settings, saved connections and files (included)
* PostgreSQL (included: Railway's Postgres 18, pre-connected in DbGate; optional)

### Deployment Dependencies

* DbGate on GitHub: https://github.com/dbgate/dbgate
* DbGate 7.3.5 release: https://github.com/dbgate/dbgate/releases/tag/v7.3.5
* DbGate Docker image: https://hub.docker.com/r/dbgate/dbgate
* This template's repo: https://github.com/aalfath/dbgate-railway-template
* DbGate environment variables: https://docs.dbgate.io/env-variables/

### Implementation Details

**Signing in:** open the Railway domain and sign in as `admin` (the `LOGIN` variable) with the password in the DbGate service's `PASSWORD` variable. Changing either variable and redeploying changes the login. The service refuses to start with an empty `PASSWORD`, so DbGate never runs without a login.

**The included Postgres:** on the first start, DbGate saves a connection named "Railway Postgres" from `POSTGRES_URL` (`${{Postgres.DATABASE_URL}}`). It's an ordinary saved connection, so you can edit it, delete it or add more alongside it. If you don't need the bundled database, delete the Postgres service and the `POSTGRES_URL` variable.

**Your other Railway databases:** deploy this template into the project that holds them, or add DbGate to it, and connect to their private domain (for example `postgres.railway.internal`, port 5432). Nothing has to be exposed publicly.

**Updates:** the DbGate service builds from [aalfath/dbgate-railway-template](https://github.com/aalfath/dbgate-railway-template). When a new DbGate release is merged there, Railway shows your project an "update available" notice, and you choose when to apply it. Read the repo's CHANGELOG.md first. Your connections and settings stay on the volume.

## Why Deploy DbGate 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 DbGate 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)
- [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/dbgate-1
