Damp

MongoDB Database

NoSQL document database

Document-oriented NoSQL database using MongoDB latest version.

Docker Configuration

Image: mongo:latest
Ports: 27017:27017
Volume: damp-mongodb:/data/db

DAMP identifies the service using Docker labels. Container name is auto-generated by Docker.

Port Configuration

Default ports: 27017 (host) → 27017 (container)

If port 27017 is occupied on the host machine, DAMP automatically uses the next available port. Check the DAMP interface to see the actual port assigned.

Environment Variables

VariableValueDescription
MONGODB_INITDB_ROOT_USERNAMErootRoot username
MONGODB_INITDB_ROOT_PASSWORDrootpasswordRoot password

Connection Information

From Host Machine (Windows)

Connect from your Windows host to the MongoDB service.

mongosh "mongodb://root:rootpassword@localhost:27017"

Connection Details:

  • Host: localhost
  • Port: 27017 (or actual port shown in DAMP)
  • Username: root
  • Password: rootpassword

Connection String:

mongodb://root:rootpassword@localhost:27017/development?authSource=admin

From Project Containers

Connect from your DevContainers or other Docker containers to the MongoDB service.

Use the container name or ID shown in the DAMP interface.

# Using container name from DAMP
mongosh "mongodb://root:rootpassword@[container-name]:27017"

Laravel .env Configuration (with MongoDB package):

MONGODB_HOST=[container-name]
MONGODB_PORT=27017
MONGODB_DATABASE=development
MONGODB_USERNAME=root
MONGODB_PASSWORD=rootpassword

Replace [container-name] with the actual container name displayed in DAMP.

Common Operations

Create Database & Collection

use my_app;
db.users.insertOne({ name: "John", email: "john@example.com" });

List Databases

show dbs

Export Collection

# From host
mongoexport --host=localhost --username=root --password=rootpassword \
  --db=development --collection=users --out=users.json

# From project container (use container name from DAMP)
mongoexport --host=[container-name] --username=root --password=rootpassword \
  --db=development --collection=users --out=users.json

Data Persistence

All data is stored in the damp-mongodb Docker volume. Removing the service preserves your databases.

On this page