{"id":17204,"library":"dbgate-serve","title":"DbGate Server - Web Interface","description":"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.","status":"active","version":"7.1.9","language":"javascript","source_language":"en","source_url":"https://github.com/dbgate/dbgate","tags":["javascript","sql","dbgate","web"],"install":[{"cmd":"npm install dbgate-serve","lang":"bash","label":"npm"},{"cmd":"yarn add dbgate-serve","lang":"bash","label":"yarn"},{"cmd":"pnpm add dbgate-serve","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The `dbgate-serve` package provides a command-line executable (`dbgate-serve`) to start the web server. It is an application, not a library meant for direct JavaScript/TypeScript imports. For programmatic interaction with DbGate's functionality, consider using the `dbgate-api` package instead.","wrong":"import dbgateServe from 'dbgate-serve';\nimport { startServer } from 'dbgate-serve';\nconst dbgateServe = require('dbgate-serve');","symbol":"dbgate-serve","correct":"This package is not designed for programmatic import. Run it as a CLI tool."},{"note":"If you intend to interact with DbGate's database functionalities from your JavaScript/TypeScript code (e.g., opening connections, querying), the `dbgate-api` package is the correct entry point, not `dbgate-serve`.","wrong":"import { openDatabase } from 'dbgate-serve';","symbol":"DbGate API (recommendation)","correct":"import { openDatabase } from 'dbgate-api';"},{"note":"The primary method of using `dbgate-serve` is by executing its installed command-line interface. Direct programmatic execution via `node` and `require()` is not supported as it's an application entry point, not an exportable module function.","wrong":"node -e \"require('dbgate-serve').start()\"","symbol":"CLI Execution","correct":"dbgate-serve"}],"quickstart":{"code":"npm install -g dbgate-serve\n\n# Create a .env file for configuration (optional)\n# Example .env content for local storage (Premium feature, but demonstrates pattern):\n# STORAGE_SERVER=localhost\n# STORAGE_USER=root\n# STORAGE_PASSWORD=mypassword\n# STORAGE_DATABASE=dbname\n# STORAGE_ENGINE=mysql@dbgate-plugin-mysql\n\n# Run the DbGate server\ndbgate-serve\n\n# Then open http://localhost:3000 in your browser","lang":"bash","description":"This quickstart demonstrates how to install `dbgate-serve` globally, optionally configure it using a `.env` file for various database settings, and then run the server to access the web interface."},"warnings":[{"fix":"No direct code fix needed for `dbgate-serve` CLI users, but be aware of potential changes if integrating with DbGate cloud services or premium features. Ensure your network allows connections to the new infrastructure if applicable.","message":"Public DbGate cloud infrastructure has been migrated. Endpoints are now on new infrastructure.","severity":"breaking","affected_versions":">=7.1.9"},{"fix":"Upgrade to version 7.1.9 or later to receive the security patch. Regularly update `dbgate-serve` to benefit from the latest security improvements and bug fixes.","message":"Security vulnerability fixed related to validation of function and file names.","severity":"gotcha","affected_versions":">=7.1.9"},{"fix":"For Oracle database users requiring features only supported in thick mode, download and unpack the Oracle Instant Client and set the `ORACLE_INSTANT_CLIENT` environment variable to its directory path. Refer to the DbGate documentation and Oracle's `node-oracledb` guide for detailed setup instructions.","message":"Oracle Instant Client (thick mode) requires specific configuration and external binaries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"To run the application, use the `dbgate-serve` command in your terminal. For programmatic interactions with DbGate's features (e.g., managing connections, executing queries), use the `dbgate-api` package instead.","message":"This package (`dbgate-serve`) is a CLI application, not a library for programmatic import.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Stop the conflicting application or configure `dbgate-serve` to use a different port by setting the `PORT` environment variable (e.g., `PORT=4000 dbgate-serve`).","cause":"Another application (or another instance of dbgate-serve) is already using port 3000.","error":"Address already in use :::3000"},{"fix":"Ensure the required database plugin package is correctly installed (e.g., `npm install dbgate-plugin-mysql`) and spelled correctly in your configuration.","cause":"A database plugin specified in your `.env` file (e.g., `STORAGE_ENGINE=mysql@dbgate-plugin-mysql`) is not installed or incorrectly referenced.","error":"Error: Cannot find module 'dbgate-plugin-mysql'"},{"fix":"Verify 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.","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.","error":"Error connecting to database: Handshake inactivity timeout"}],"ecosystem":"npm","meta_description":null}