
Deploy ChartDB
Database diagram editor: pinned ChartDB 1.21.0 with login and health check
Just deployed
Deploy and Host ChartDB on Railway
ChartDB is an open-source database diagram editor. You run one "smart query" against PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, CockroachDB or ClickHouse, paste its JSON result, and ChartDB draws your schema as an editable diagram. You can then change tables and relations and export the result as SQL, DBML or an image.
About Hosting ChartDB
This template deploys one service built from the public repo aalfath/chartdb-railway-template. It runs ChartDB 1.21.0 from the official image, pinned by version and digest, behind nginx on port 8080 with a Railway domain and a /healthz health check. A login prompt (HTTP Basic auth) protects the app: the user is admin, and the template generates a 24-character password, which you find in the service's Variables tab as CHARTDB_PASSWORD. ChartDB stores your diagrams in your browser's IndexedDB, not on the server, so the service needs no database and no volume, and redeploys lose nothing. Use Export to back up or move diagrams between browsers.
Common Use Cases
- Draw an editable diagram of an existing database from a single query
- Design a new schema visually and export it as SQL or DBML
- Share schema images and documentation with your team without a cloud account
Dependencies for ChartDB Hosting
- The ChartDB official image
ghcr.io/chartdb/chartdb, version 1.21.0 - A modern web browser, which stores the diagrams
Deployment Dependencies
- ChartDB source and docs: https://github.com/chartdb/chartdb
- ChartDB 1.21.0 release: https://github.com/chartdb/chartdb/releases/tag/v1.21.0
- Template repo and changelog: https://github.com/aalfath/chartdb-railway-template
Implementation Details
After deploy, open the Railway URL and log in as admin with the CHARTDB_PASSWORD value from the Variables tab.
Optional settings, added to the service's variables when you need them:
OPENAI_API_KEYturns on the AI export to another SQL dialect. ChartDB calls the AI provider from the browser, so anyone who can log in can read this key. Keep the login on and use a key with a spending limit.OPENAI_API_ENDPOINTandLLM_MODEL_NAMEpoint the AI export at an OpenAI-compatible server instead.DISABLE_ANALYTICSandHIDE_CHARTDB_CLOUDaretrueby default and turn off upstream's analytics script and "star us" pop-up.
Diagrams don't sync between browsers or devices, and clearing the browser's site data deletes them, so export the ones you want to keep.
Updates: the service builds from the template repo's main branch. When a new ChartDB version is merged there, Railway shows your project an "update available" notice and you choose when to apply it. Read CHANGELOG.md in the repo first.
Why Deploy ChartDB 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 ChartDB 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
