---
title: "Deploy ChartDB"
description: "Database diagram editor: pinned ChartDB 1.21.0 with login and health check"
category: "Other"
url: https://railway.com/deploy/chartdb-2
---

# Deploy ChartDB

Database diagram editor: pinned ChartDB 1.21.0 with login and health check

**[Deploy ChartDB on Railway](https://railway.com/template/chartdb-2)**

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

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

## Template content

### ChartDB https://raw.githubusercontent.com/chartdb/chartdb/v1.21.0/src/assets/logo-2.png

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

## Documentation

# 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_KEY` turns 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_ENDPOINT` and `LLM_MODEL_NAME` point the AI export at an OpenAI-compatible server instead.
* `DISABLE_ANALYTICS` and `HIDE_CHARTDB_CLOUD` are `true` by 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.



## 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)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/chartdb-2
