DbGate Server - Web Interface
DbGate Server (dbgate-serve) is the open-source community edition of a cross-platform database administration tool, providing a web-based user interface for managing various databases. It supports MySQL, PostgreSQL, SQL Server, MongoDB, Redis, SQLite, CockroachDB, MariaDB, and ClickHouse, with premium versions offering additional support for Amazon Redshift and CosmosDB. The current stable version is 7.1.9, with a frequent release cadence evidenced by numerous patches and minor versions in its recent history. Key differentiators include its broad database support, schema comparison, visual query designer, chart visualization, and robust batch export/import functionalities. It operates primarily as a command-line executable, configured via environment variables or `.env` files, and serves a local web application.
Common errors
-
Address already in use :::3000
cause Another application (or another instance of dbgate-serve) is already using port 3000.fixStop the conflicting application or configure `dbgate-serve` to use a different port by setting the `PORT` environment variable (e.g., `PORT=4000 dbgate-serve`). -
Error: Cannot find module 'dbgate-plugin-mysql'
cause A database plugin specified in your `.env` file (e.g., `STORAGE_ENGINE=mysql@dbgate-plugin-mysql`) is not installed or incorrectly referenced.fixEnsure the required database plugin package is correctly installed (e.g., `npm install dbgate-plugin-mysql`) and spelled correctly in your configuration. -
Error connecting to database: Handshake inactivity timeout
cause The DbGate server could not establish a connection to the configured database within the allowed timeout period, often due to incorrect credentials, firewall rules, or the database server not running/being inaccessible.fixVerify database credentials, host, and port in your `.env` file or connection settings. Check firewall rules on both the DbGate server and database server. Ensure the database server is running and accessible from where `dbgate-serve` is hosted.
Warnings
- breaking Public DbGate cloud infrastructure has been migrated. Endpoints are now on new infrastructure.
- gotcha Security vulnerability fixed related to validation of function and file names.
- gotcha Oracle Instant Client (thick mode) requires specific configuration and external binaries.
- gotcha This package (`dbgate-serve`) is a CLI application, not a library for programmatic import.
Install
-
npm install dbgate-serve -
yarn add dbgate-serve -
pnpm add dbgate-serve
Imports
- dbgate-serve
import dbgateServe from 'dbgate-serve'; import { startServer } from 'dbgate-serve'; const dbgateServe = require('dbgate-serve');This package is not designed for programmatic import. Run it as a CLI tool.
- DbGate API (recommendation)
import { openDatabase } from 'dbgate-serve';import { openDatabase } from 'dbgate-api'; - CLI Execution
node -e "require('dbgate-serve').start()"dbgate-serve
Quickstart
npm install -g dbgate-serve # Create a .env file for configuration (optional) # Example .env content for local storage (Premium feature, but demonstrates pattern): # STORAGE_SERVER=localhost # STORAGE_USER=root # STORAGE_PASSWORD=mypassword # STORAGE_DATABASE=dbname # STORAGE_ENGINE=mysql@dbgate-plugin-mysql # Run the DbGate server dbgate-serve # Then open http://localhost:3000 in your browser