docker.recipes

CloudBeaver + Multiple Databases

intermediate

Web-based database manager for multiple database types.

Overview

CloudBeaver is DBeaver's web-based database administration platform that brings the power of the popular desktop database client to your browser. Developed by the same team behind DBeaver, CloudBeaver provides a universal database management interface supporting over 80 database types including relational, NoSQL, and cloud databases. It offers advanced features like visual query building, data visualization, schema browsing, and collaborative database management without requiring client-side installations. This configuration combines CloudBeaver with three fundamentally different database paradigms: PostgreSQL for complex relational data with ACID compliance, MySQL for high-performance web applications, and MongoDB for flexible document storage. Together, they create a comprehensive database laboratory where developers can compare query performance, test data migration strategies, and prototype applications using different data models. The setup eliminates the complexity of managing separate database tools and provides a unified interface for polyglot persistence architectures. This stack is ideal for database administrators managing heterogeneous environments, development teams building microservices with different data requirements, and organizations evaluating database technologies. Educational institutions can use it for teaching database concepts, while consultants can demonstrate various database capabilities to clients. The combination provides hands-on experience with SQL, NoSQL, and document databases through a single, powerful web interface.

Key Features

  • Universal database connectivity supporting PostgreSQL, MySQL, MongoDB, and 80+ other database types through CloudBeaver's extensive driver library
  • Advanced SQL editor with syntax highlighting, auto-completion, and query execution plans for both PostgreSQL and MySQL optimization
  • Visual data modeling and ER diagram generation for comparing relational schemas between PostgreSQL and MySQL databases
  • MongoDB document browser with JSON syntax highlighting and aggregation pipeline builder for NoSQL operations
  • Cross-database query comparison tools allowing performance testing between PostgreSQL and MySQL for identical datasets
  • Real-time connection monitoring and database metrics dashboard for tracking performance across all three database engines
  • Team collaboration features including saved queries, shared connections, and role-based access control for multi-user database environments
  • Data export/import wizards supporting CSV, JSON, and SQL formats for seamless data migration between PostgreSQL, MySQL, and MongoDB

Common Use Cases

  • 1Polyglot persistence development where different microservices require PostgreSQL for transactions, MySQL for content management, and MongoDB for user profiles
  • 2Database migration projects comparing MySQL and PostgreSQL performance with identical datasets before making technology decisions
  • 3Educational database courses teaching students SQL fundamentals with MySQL, advanced features with PostgreSQL, and NoSQL concepts with MongoDB
  • 4Multi-tenant SaaS applications using PostgreSQL for billing data, MySQL for application data, and MongoDB for user-generated content and analytics
  • 5Data science teams prototyping with structured data in PostgreSQL/MySQL and unstructured data in MongoDB through a single interface
  • 6Database consulting firms demonstrating different database capabilities to clients without installing multiple management tools
  • 7DevOps teams maintaining legacy MySQL systems while migrating to PostgreSQL and implementing MongoDB for new document-based features

Prerequisites

  • Minimum 4GB RAM recommended (2GB+ for MongoDB, 1GB+ each for PostgreSQL and MySQL, plus CloudBeaver overhead)
  • Docker Engine 20.10+ and Docker Compose V2 for proper networking and volume management across multiple database containers
  • Available ports 8978 for CloudBeaver web interface, plus internal ports 5432, 3306, and 27017 for database communication
  • Basic understanding of SQL for PostgreSQL and MySQL management, plus familiarity with JSON documents for MongoDB operations
  • Knowledge of database connection parameters, user management, and basic security concepts for multi-database environments
  • Understanding of Docker networking concepts for troubleshooting inter-container database connectivity issues

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 cloudbeaver:
3 image: dbeaver/cloudbeaver:latest
4 volumes:
5 - cloudbeaver-data:/opt/cloudbeaver/workspace
6 ports:
7 - "8978:8978"
8 networks:
9 - database-network
10 restart: unless-stopped
11
12 postgres:
13 image: postgres:15
14 environment:
15 - POSTGRES_USER=${POSTGRES_USER}
16 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
17 - POSTGRES_DB=sampledb
18 volumes:
19 - postgres-data:/var/lib/postgresql/data
20 networks:
21 - database-network
22 restart: unless-stopped
23
24 mysql:
25 image: mysql:8.0
26 environment:
27 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
28 - MYSQL_DATABASE=sampledb
29 - MYSQL_USER=${MYSQL_USER}
30 - MYSQL_PASSWORD=${MYSQL_PASSWORD}
31 volumes:
32 - mysql-data:/var/lib/mysql
33 networks:
34 - database-network
35 restart: unless-stopped
36
37 mongodb:
38 image: mongo:6.0
39 environment:
40 - MONGO_INITDB_ROOT_USERNAME=${MONGO_USER}
41 - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
42 volumes:
43 - mongodb-data:/data/db
44 networks:
45 - database-network
46 restart: unless-stopped
47
48volumes:
49 cloudbeaver-data:
50 postgres-data:
51 mysql-data:
52 mongodb-data:
53
54networks:
55 database-network:
56 driver: bridge

.env Template

.env
1# CloudBeaver + Databases
2POSTGRES_USER=postgres
3POSTGRES_PASSWORD=secure_postgres_password
4MYSQL_ROOT_PASSWORD=secure_root_password
5MYSQL_USER=mysql
6MYSQL_PASSWORD=secure_mysql_password
7MONGO_USER=mongo
8MONGO_PASSWORD=secure_mongo_password

Usage Notes

  1. 1CloudBeaver at http://localhost:8978
  2. 2Setup wizard on first run
  3. 3Add connections to databases
  4. 4PostgreSQL at port 5432
  5. 5MySQL at port 3306, MongoDB at 27017

Individual Services(4 services)

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

cloudbeaver
cloudbeaver:
  image: dbeaver/cloudbeaver:latest
  volumes:
    - cloudbeaver-data:/opt/cloudbeaver/workspace
  ports:
    - "8978:8978"
  networks:
    - database-network
  restart: unless-stopped
postgres
postgres:
  image: postgres:15
  environment:
    - POSTGRES_USER=${POSTGRES_USER}
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - POSTGRES_DB=sampledb
  volumes:
    - postgres-data:/var/lib/postgresql/data
  networks:
    - database-network
  restart: unless-stopped
mysql
mysql:
  image: mysql:8.0
  environment:
    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
    - MYSQL_DATABASE=sampledb
    - MYSQL_USER=${MYSQL_USER}
    - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  volumes:
    - mysql-data:/var/lib/mysql
  networks:
    - database-network
  restart: unless-stopped
mongodb
mongodb:
  image: mongo:6.0
  environment:
    - MONGO_INITDB_ROOT_USERNAME=${MONGO_USER}
    - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
  volumes:
    - mongodb-data:/data/db
  networks:
    - database-network
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 cloudbeaver:
5 image: dbeaver/cloudbeaver:latest
6 volumes:
7 - cloudbeaver-data:/opt/cloudbeaver/workspace
8 ports:
9 - "8978:8978"
10 networks:
11 - database-network
12 restart: unless-stopped
13
14 postgres:
15 image: postgres:15
16 environment:
17 - POSTGRES_USER=${POSTGRES_USER}
18 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
19 - POSTGRES_DB=sampledb
20 volumes:
21 - postgres-data:/var/lib/postgresql/data
22 networks:
23 - database-network
24 restart: unless-stopped
25
26 mysql:
27 image: mysql:8.0
28 environment:
29 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
30 - MYSQL_DATABASE=sampledb
31 - MYSQL_USER=${MYSQL_USER}
32 - MYSQL_PASSWORD=${MYSQL_PASSWORD}
33 volumes:
34 - mysql-data:/var/lib/mysql
35 networks:
36 - database-network
37 restart: unless-stopped
38
39 mongodb:
40 image: mongo:6.0
41 environment:
42 - MONGO_INITDB_ROOT_USERNAME=${MONGO_USER}
43 - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
44 volumes:
45 - mongodb-data:/data/db
46 networks:
47 - database-network
48 restart: unless-stopped
49
50volumes:
51 cloudbeaver-data:
52 postgres-data:
53 mysql-data:
54 mongodb-data:
55
56networks:
57 database-network:
58 driver: bridge
59EOF
60
61# 2. Create the .env file
62cat > .env << 'EOF'
63# CloudBeaver + Databases
64POSTGRES_USER=postgres
65POSTGRES_PASSWORD=secure_postgres_password
66MYSQL_ROOT_PASSWORD=secure_root_password
67MYSQL_USER=mysql
68MYSQL_PASSWORD=secure_mysql_password
69MONGO_USER=mongo
70MONGO_PASSWORD=secure_mongo_password
71EOF
72
73# 3. Start the services
74docker compose up -d
75
76# 4. View logs
77docker 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/pgadmin-cloudbeaver/run | bash

Troubleshooting

  • CloudBeaver shows 'Connection failed' for databases: Verify all database containers are running with 'docker compose ps' and check the database-network connectivity
  • PostgreSQL connection refused: Ensure POSTGRES_USER and POSTGRES_PASSWORD environment variables are set and PostgreSQL container has fully initialized
  • MySQL 'Access denied for user': Check MYSQL_USER and MYSQL_PASSWORD match your CloudBeaver connection settings and MySQL container logs for authentication errors
  • MongoDB authentication failed: Verify MONGO_INITDB_ROOT_USERNAME and MONGO_INITDB_ROOT_PASSWORD are correctly configured and use admin database for initial connection
  • CloudBeaver web interface not loading: Check if port 8978 is available and not blocked by firewall, and verify cloudbeaver-data volume has proper permissions
  • High memory usage with all databases running: Monitor individual container resource usage with 'docker stats' and consider limiting memory allocation for non-production use

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