Deploy DbGate

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

Deploy DbGate

/root/.dbgate

/var/lib/postgresql/data

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

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. 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.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
51
View Template
Foundry Virtual Tabletop
Self-hosted virtual tabletop for role-playing games (license required)

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
52