ChartDB
Overview
ChartDB is an open source, web-based database schema visualization and diagram editor. You import an existing database schema by running a single query that the app provides and pasting the result. You then edit the entity-relationship (ER) diagram in your browser and export it as SQL, DBML or an image. ChartDB is a pure client-side single-page app. All of your diagram data lives in your own browser, with no external database or service.
The SecureAnyCloud image serves the built ChartDB app with nginx on port 80, hardened and ready on first boot. Because ChartDB has no built-in authentication, nginx gates the whole app behind per-VM HTTP Basic Auth. A unique password is generated on the first boot of every instance and written to a root-only file, so no two instances share a credential. A public, unauthenticated health endpoint is exposed at /health. The image is built from ChartDB 1.20.1 (AGPL-3.0).
What you get:
- ChartDB 1.20.1 static app, built from the official source and served from
/var/www/chartdb - nginx on
:80as the single public listener, gating the app behind per-VM HTTP Basic Auth - A public, unauthenticated health endpoint at
/health - A first-boot service that generates a unique
adminpassword into a root-only0600file - The unmodified upstream source archive at
/usr/share/chartdb(AGPL-3.0 section 13) nginx.serviceandchartdb-firstboot.serviceas systemd units, enabled on every boot- 24/7 SecureAnyCloud support
Prerequisites
You need an active Azure subscription, an SSH key pair, and a VNet plus subnet in the target region. Standard_B2s (2 vCPU / 4 GiB RAM) is a comfortable starting point, because ChartDB serves static files and is light on resources.
In the NSG, allow inbound 22/tcp from your management network and 80/tcp for the editor. ChartDB serves plain HTTP on port 80. For production, terminate TLS in front of it with your own domain.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure portal, choose Create a resource, search the Marketplace for ChartDB by SecureAnyCloud, and select Create. On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80). Then choose Review + create, and then Create.
Step 2 - Deploy from the Azure CLI
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:chartdb-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name chartdb \
--image sac1647283583153:chartdb-ubuntu-24-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name chartdb --port 80 --priority 1010Step 3 - Connect to your VM
ssh azureuser@<vm-public-ip>Step 4 - Confirm the service is running
ChartDB is served by nginx, and a one-shot first-boot service prepares the per-VM login. Confirm that both services run and that nginx is the only public listener:
systemctl is-active nginx.service chartdb-firstboot.service ss -tln | grep ':80 ' test -f /var/lib/sac/data/chartdb-firstboot.done && echo "first boot complete"The output shows active for nginx.service and active for chartdb-firstboot.service. nginx is listening on :80, and the sentinel confirms that first boot finished.
Step 5 - Verify the authentication gate
ChartDB has no login of its own, so nginx gates the whole app behind HTTP Basic Auth. The public /health endpoint returns 200 without credentials. The app returns 401 without credentials and 200 with the per-VM login:
curl -s -o /dev/null -w 'health: %{http_code}\n' http://127.0.0.1/health
curl -s -o /dev/null -w 'unauth: %{http_code}\n' http://127.0.0.1/
sudo bash -c 'U=$(grep ^CHARTDB_USERNAME= /var/lib/sac/data/chartdb-credentials.txt | cut -d= -f2-); P=$(grep ^CHARTDB_PASSWORD= /var/lib/sac/data/chartdb-credentials.txt | cut -d= -f2-); curl -s -o /dev/null -w "auth: %{http_code}\n" -u "$U:$P" http://127.0.0.1/'You see health: 200, unauth: 401 and auth: 200. These results show that the app is reachable only with the per-VM credential.
Step 6 - Read your per-VM login
On first boot, the image writes the unique per-VM credential (username admin) to a root-only file. Read the file with:
sudo cat /var/lib/sac/data/chartdb-credentials.txtExample output (your password is unique to this VM):
# ChartDB 1.20.1 on Ubuntu 24.04 (sac Azure Marketplace image)
# Per-VM HTTP Basic-Auth credentials - UNIQUE to this VM, minted at first boot. CHARTDB_URL=http://<vm-public-ip>/ CHARTDB_USERNAME=admin CHARTDB_PASSWORD=<set-at-first-boot>Step 7 - Open ChartDB
Browse to http://<vm-public-ip>/ in any modern browser. Your browser prompts for the HTTP Basic Auth login. Enter admin and the password from Step 6. ChartDB opens and asks which database you are diagramming. Pick your engine (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite or Oracle).
Step 8 - Import a schema
After you choose a database, ChartDB shows the Import your Database dialog. Paste the output of the Smart Query that ChartDB generates for your live database. Alternatively, switch to the SQL Script tab and paste a CREATE TABLE script directly. ChartDB parses the tables, columns, keys and foreign keys, and reports how many tables it found.
Step 9 - Explore the ER diagram
Click Import, and ChartDB draws the entity-relationship diagram. Each table is a node that lists its columns and types, primary keys are marked, and foreign keys are drawn as relationship connectors with cardinality. Drag tables to rearrange them, zoom and fit the view, and add or edit tables and columns directly on the canvas.
Step 10 - Edit as DBML and export
Open the DBML panel to see your diagram as DBML (Database Markup Language). Edit the DBML and the diagram updates, or edit the diagram and the DBML updates. Use the Export SQL action (under Actions) to generate DDL for your target database, or export the diagram as an image. Because all data lives in your browser, use Backup to export and import your diagrams.
Maintenance
- Data. ChartDB is client-side, and your diagrams are stored in your browser. There is no server-side database to back up. Use the in-app Backup to export and import your diagrams as files.
- Change the login. The per-VM password lives in the nginx htpasswd file. To set your own, run
sudo htpasswd -B /etc/nginx/.chartdb-htpasswd adminand follow the prompts, then runsudo systemctl reload nginx. - Source code. The unmodified upstream source for this AGPL-3.0 release ships on disk at
/usr/share/chartdb/chartdb-v1.20.1-source.tar.gz. - TLS. ChartDB serves plain HTTP on port 80. Before you run it in production, front it with TLS (for example, certbot) and your own domain.
- Restart. To restart the web server, run
sudo systemctl restart nginx.service. - Security patches. Unattended upgrades remain enabled, so the OS continues to receive security updates automatically.
Support
SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.
ChartDB is open source software released under the GNU Affero General Public License v3.0 (AGPL-3.0). SecureAnyCloud is not affiliated with, endorsed by or sponsored by the ChartDB project. This image packages the open source ChartDB software for convenient deployment on Microsoft Azure. All trademarks are the property of their respective holders.
Deploy on Azure
Launch ChartDB on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com