docker.recipes

DbGate Universal Database Manager

beginner

Cross-platform database manager supporting multiple database engines.

Overview

DbGate is an open-source universal database management tool that provides a web-based interface for working with multiple database engines simultaneously. Originally developed as a cross-platform alternative to platform-specific database tools, DbGate offers a unified experience for managing PostgreSQL, MySQL, MongoDB, SQLite, and other databases through a single interface. Its browser-based architecture makes it particularly valuable for teams working across different operating systems and environments. This multi-database stack combines DbGate's universal management capabilities with three of the most popular database engines: PostgreSQL for advanced relational operations with JSON support, MySQL for high-performance web applications, and MongoDB for flexible document storage. The configuration creates an isolated environment where DbGate can connect to all three databases simultaneously, enabling side-by-side comparisons, cross-database queries, and unified data management workflows. This setup is ideal for full-stack developers working on polyglot persistence architectures, database administrators managing heterogeneous environments, and development teams evaluating different database technologies. The combination provides hands-on experience with relational and document databases while offering the convenience of managing everything through DbGate's intuitive web interface, complete with syntax highlighting, query building, and data visualization tools.

Key Features

  • Universal database connectivity supporting PostgreSQL, MySQL, and MongoDB through a single web interface
  • Advanced SQL editor with syntax highlighting, autocomplete, and query execution plans
  • Visual query builder for constructing complex queries without writing SQL
  • Data import/export capabilities with support for CSV, JSON, and SQL formats across all database types
  • Schema comparison tools for identifying differences between database structures
  • Real-time query result visualization with charts and graphs
  • Database structure explorer with table relationships and index information
  • Cross-database query execution for comparing data between PostgreSQL, MySQL, and MongoDB

Common Use Cases

  • 1Full-stack development teams prototyping applications with different database backends
  • 2Database administrators migrating data between PostgreSQL, MySQL, and MongoDB systems
  • 3Educational environments teaching database concepts across multiple database paradigms
  • 4Startup teams evaluating which database technology best fits their application requirements
  • 5Development agencies managing client projects with diverse database requirements
  • 6Data analysts performing cross-database comparisons and reporting
  • 7Quality assurance teams validating data consistency across multiple database systems

Prerequisites

  • Minimum 4GB RAM to support all three database engines plus DbGate interface
  • Docker and Docker Compose installed with at least 10GB available disk space
  • Port 3000 available for DbGate web interface access
  • Basic understanding of SQL for PostgreSQL and MySQL operations
  • Familiarity with JSON document structure for MongoDB operations
  • Environment variables configured: POSTGRES_PASSWORD, MYSQL_PASSWORD, and MONGO_PASSWORD

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 dbgate:
3 image: dbgate/dbgate:latest
4 ports:
5 - "3000:3000"
6 volumes:
7 - dbgate_data:/root/.dbgate
8 environment:
9 - CONNECTIONS=postgres,mysql,mongodb
10 networks:
11 - dbgate_net
12
13 postgres:
14 image: postgres:15-alpine
15 environment:
16 - POSTGRES_USER=admin
17 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
18 - POSTGRES_DB=testdb
19 volumes:
20 - postgres_data:/var/lib/postgresql/data
21 networks:
22 - dbgate_net
23
24 mysql:
25 image: mysql:8.0
26 environment:
27 - MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
28 - MYSQL_DATABASE=testdb
29 volumes:
30 - mysql_data:/var/lib/mysql
31 networks:
32 - dbgate_net
33
34 mongodb:
35 image: mongo:6
36 environment:
37 - MONGO_INITDB_ROOT_USERNAME=admin
38 - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
39 volumes:
40 - mongo_data:/data/db
41 networks:
42 - dbgate_net
43
44volumes:
45 dbgate_data:
46 postgres_data:
47 mysql_data:
48 mongo_data:
49
50networks:
51 dbgate_net:

.env Template

.env
1# DbGate
2POSTGRES_PASSWORD=secure_postgres_password
3MYSQL_PASSWORD=secure_mysql_password
4MONGO_PASSWORD=secure_mongo_password
5
6# DbGate at http://localhost:3000

Usage Notes

  1. 1DbGate at http://localhost:3000
  2. 2Connect to multiple databases
  3. 3Query editor with autocomplete
  4. 4Export/import data
  5. 5Dark theme available

Individual Services(4 services)

Copy individual services to mix and match with your existing compose files.

dbgate
dbgate:
  image: dbgate/dbgate:latest
  ports:
    - "3000:3000"
  volumes:
    - dbgate_data:/root/.dbgate
  environment:
    - CONNECTIONS=postgres,mysql,mongodb
  networks:
    - dbgate_net
postgres
postgres:
  image: postgres:15-alpine
  environment:
    - POSTGRES_USER=admin
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - POSTGRES_DB=testdb
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - dbgate_net
mysql
mysql:
  image: mysql:8.0
  environment:
    - MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
    - MYSQL_DATABASE=testdb
  volumes:
    - mysql_data:/var/lib/mysql
  networks:
    - dbgate_net
mongodb
mongodb:
  image: mongo:6
  environment:
    - MONGO_INITDB_ROOT_USERNAME=admin
    - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
  volumes:
    - mongo_data:/data/db
  networks:
    - dbgate_net

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 dbgate:
5 image: dbgate/dbgate:latest
6 ports:
7 - "3000:3000"
8 volumes:
9 - dbgate_data:/root/.dbgate
10 environment:
11 - CONNECTIONS=postgres,mysql,mongodb
12 networks:
13 - dbgate_net
14
15 postgres:
16 image: postgres:15-alpine
17 environment:
18 - POSTGRES_USER=admin
19 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
20 - POSTGRES_DB=testdb
21 volumes:
22 - postgres_data:/var/lib/postgresql/data
23 networks:
24 - dbgate_net
25
26 mysql:
27 image: mysql:8.0
28 environment:
29 - MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
30 - MYSQL_DATABASE=testdb
31 volumes:
32 - mysql_data:/var/lib/mysql
33 networks:
34 - dbgate_net
35
36 mongodb:
37 image: mongo:6
38 environment:
39 - MONGO_INITDB_ROOT_USERNAME=admin
40 - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
41 volumes:
42 - mongo_data:/data/db
43 networks:
44 - dbgate_net
45
46volumes:
47 dbgate_data:
48 postgres_data:
49 mysql_data:
50 mongo_data:
51
52networks:
53 dbgate_net:
54EOF
55
56# 2. Create the .env file
57cat > .env << 'EOF'
58# DbGate
59POSTGRES_PASSWORD=secure_postgres_password
60MYSQL_PASSWORD=secure_mysql_password
61MONGO_PASSWORD=secure_mongo_password
62
63# DbGate at http://localhost:3000
64EOF
65
66# 3. Start the services
67docker compose up -d
68
69# 4. View logs
70docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/dbgate-multidb/run | bash

Troubleshooting

  • DbGate shows 'Connection refused' errors: Ensure all database containers are fully started by checking docker-compose logs for each service
  • PostgreSQL connection fails with authentication error: Verify POSTGRES_PASSWORD environment variable matches the password configured in DbGate connection settings
  • MySQL container exits with 'mysqld: ready for connections' then stops: Increase Docker memory allocation to at least 2GB for MySQL 8.0 operations
  • MongoDB connection shows 'Authentication failed': Use 'admin' as both username and authentication database when configuring the MongoDB connection in DbGate
  • DbGate interface loads but databases appear empty: Check network connectivity by ensuring all services are on the dbgate_net network and can resolve container names
  • Query timeouts on large datasets: Increase DbGate query timeout settings in the application preferences and ensure adequate memory allocation for database containers

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space