ContainDB is a CLI tool written in Go that automates the installation and management of popular database containers (MongoDB, Redis, MySQL, PostgreSQL, Cassandra) as well as PHPMyAdmin and MongoDB Compass. It handles Docker installation (if missing), network setup, container orchestration, optional port mapping, restart policies, and data persistence.
- ✅ Automatic Docker installation and setup
- 🌐 Dedicated Docker network (
ContainDB-Network
) for seamless inter-container communication - 📦 Pulls and runs database images with sensible defaults
- 🔌 Interactive prompts for:
- Port mapping (default or custom)
- Auto-restart policies
- Environment variables for credentials
- Volume persistence and management
- 🔗 One-click PHPMyAdmin linking to existing SQL containers
- 🧭 Optional MongoDB Compass download and install
- Linux or macOS (with Bash)
- Internet connection to download Docker images
Option 1: Download and install via Debian package
# download latest .deb from Releases
wget https://github.com/AnkanSaha/ContainDB/releases/download/v3.11.17-beta/containDB_3.11.17-beta_amd64.deb
# install the package
sudo dpkg -i containDB_3.11.17-beta_amd64.deb
Option 2: Build from source
# clone the reposito
8000
ry
git clone https://github.com/AnkanSaha/ContainDB.git
cd ContainDB
# build the CLI
./Scripts/BinBuilder.sh
# install binary to /usr/local/bin
sudo mv ./bin/containDB /usr/local/bin/
Run the CLI with root privileges:
sudo containDB
- Welcome Banner – Displays version and basic info.
- Main Menu – Choose one of:
- Install Database
- List Databases
- Remove Database
- Exit
- Follow Prompts – Configure and launch containers in a few keystrokes.
sudo containDB
# Select "Install Database"
# Pick "mysql" (or any supported service)
# Answer port mapping, restart policy, persistence, credentials
sudo containDB
# Select "Install Database"
# Choose "phpmyadmin"
# Pick an existing SQL container and assign host port
sudo containDB
# Select "Install Database"
# Choose "MongoDB Compass"
sudo containDB --version
sudo containDB
# Select "List Databases"
sudo containDB
# Select "Remove Database"
# Pick the container to delete (with optional volume cleanup)
--version
: Print ContainDB CLI version and exit.
- Permission Denied
Ensure you run withsudo
. - Docker Not Found
The CLI auto-installs Docker on first run; please restart your terminal after installation. - Port Already in Use
Choose a different host port when prompted. - Volume Conflicts
On existing volumes, you can opt to reuse or recreate fresh ones.
- Fork the repo
- Create your feature branch (
git checkout -b feature/…
) - Commit your changes (
git commit -m 'Add …'
) - Push to the branch (
git push origin feature/…
) - Open a Pull Request
This project is licensed under the MIT License. See LICENSE for details.