Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dokploy/dokploy/llms.txt

Use this file to discover all available pages before exploring further.

Dokploy provides built-in support for deploying and managing popular database systems. Each database runs as a Docker container with persistent storage, automated backups, and easy configuration through the UI.

Supported Databases

PostgreSQL

Open-source relational database with advanced features

MySQL

Popular open-source relational database management system

MariaDB

MySQL-compatible database with enhanced features

MongoDB

Document-oriented NoSQL database for modern applications

Redis

In-memory data store for caching and real-time applications

Common Features

All database services in Dokploy share these capabilities:

Quick Deployment

Deploy databases in seconds with sensible defaults. Each database is deployed as a Docker service with:
  • Automatic volume mounting for data persistence
  • Pre-configured default ports
  • Environment-based organization
  • Resource limits and reservations

Connection Management

Applications within the same Dokploy environment can connect using internal DNS:
# Format: <app-name>:<internal-port>
postgres-prod:5432
mysql-app:3306

Resource Management

Control database resource usage through the UI:
  • Memory Reservation: Minimum memory guaranteed to the database
  • Memory Limit: Maximum memory the database can use
  • CPU Reservation: Minimum CPU cores allocated
  • CPU Limit: Maximum CPU cores available
Resources are specified in Docker format:
  • Memory: 256MB, 1GB, 2GB
  • CPU: 0.5, 1.0, 2.0 (cores)

Volume Management

Each database automatically creates a Docker volume for data persistence:
DatabaseMount PathVolume Name Pattern
PostgreSQLVaries by version{appName}-data
MySQL/var/lib/mysql{appName}-data
MariaDB/var/lib/mysql{appName}-data
MongoDB/data/db{appName}-data
Redis/data{appName}-data

Environment Variables

Add custom environment variables to configure database behavior:
# Example for PostgreSQL
POSTGRES_MAX_CONNECTIONS=200
POSTGRES_SHARED_BUFFERS=256MB

# Example for MySQL
MYSQL_MAX_CONNECTIONS=150
MYSQL_INNODB_BUFFER_POOL_SIZE=512M

Database Operations

Lifecycle Management

Manage database state through the UI:
1

Deploy

Initial deployment pulls the Docker image and starts the container with your configuration.
2

Start/Stop

Control database availability without losing data. Stopped databases retain all data in volumes.
3

Reload

Restart the database to apply configuration changes or clear temporary state.
4

Rebuild

Completely rebuild the database container while preserving data volumes.

Moving Between Environments

Move databases between environments (dev, staging, production) while preserving:
  • Database credentials
  • Environment variables
  • Volume mounts
  • Resource limits
Moving a database does not migrate the data itself. You’ll need to backup and restore data separately.

Docker Image Selection

Dokploy allows you to specify custom Docker images for each database:
# Default images
postgres:18
mysql:8
mariadb:6
mongo:15
redis:8

# Custom versions
postgres:16-alpine
mysql:8.0.35
mongo:7.0

Advanced Configuration

Custom Commands and Arguments

Override the default container command or add arguments:
# Command
postgres

# Arguments
-c max_connections=200
-c shared_buffers=256MB

Docker Swarm Settings

For production deployments, configure advanced Docker Swarm options:
  • Health Checks: Monitor database health and automatic restarts
  • Restart Policies: Define restart behavior on failures
  • Placement Constraints: Control which nodes run the database
  • Update/Rollback Config: Configure rolling updates
  • Resource Limits: Set hard limits with ulimits

Security Best Practices

Password RequirementsDatabase passwords cannot contain certain special characters:
  • Avoid: $ ! ' " \ / and spaces
  • Use: a-zA-Z0-9@#%^&*()_+-=[]{}|;:,.<>?~
These restrictions ensure compatibility across all database systems.

Recommendations

  1. Use strong passwords: Generate random passwords for production databases
  2. Limit external access: Only expose databases externally when required
  3. Regular backups: Configure automated backups to protect your data
  4. Resource limits: Set appropriate limits to prevent resource exhaustion
  5. Monitor logs: Check container logs regularly for errors or security issues

Next Steps

Database Backups

Set up automated backups and restore procedures

PostgreSQL Setup

Deploy your first PostgreSQL database