Supported Databases
Dokploy supports the following database systems:- PostgreSQL - Popular open-source relational database
- MySQL - World’s most popular open-source relational database
- MariaDB - MySQL-compatible relational database
- MongoDB - Document-oriented NoSQL database
- Redis - In-memory data structure store
Features
Automatic Configuration
When you create a database in Dokploy, it automatically:- Creates a Docker Swarm service with the selected database image
- Sets up persistent volume mounts for data storage
- Configures authentication credentials
- Generates connection strings for your applications
- Enables health checks and restart policies
Volume Management
Each database automatically creates a data volume:- PostgreSQL
- MySQL
- MariaDB
- MongoDB
- Redis
Mount path:
/var/lib/postgresql/data (varies by image)
Volume name: {appName}-dataNetwork Access
Internal Access: All databases are accessible within the Docker Swarm network using their service name. External Access: You can optionally expose databases to external networks by configuring an external port.Environment Variables
Databases can inherit environment variables from:- Project-level environment variables
- Environment-level variables (e.g., staging, production)
- Database-specific environment variables
Resource Limits
You can configure resource limits for each database:- Memory Limit - Maximum memory allocation
- Memory Reservation - Guaranteed memory allocation
- CPU Limit - Maximum CPU usage
- CPU Reservation - Guaranteed CPU allocation
Connection Strings
Each database type has a specific connection string format. See the individual database pages for details:- PostgreSQL Connection Strings
- MySQL Connection Strings
- MariaDB Connection Strings
- MongoDB Connection Strings
- Redis Connection Strings
Backups
Dokploy includes automated backup functionality for all database types. Learn more in the Backups section.Common Operations
Starting a Database
Databases can be started through the Dokploy UI or API. When started, the service is created or updated in Docker Swarm.Stopping a Database
Stopping a database removes the running container but preserves data volumes.Reloading a Database
Reloading stops and starts the database, applying any configuration changes.Rebuilding a Database
The rebuild operation:- Stops the database service
- Removes associated volumes
- Recreates the service with fresh configuration
Best Practices
- Use Strong Passwords - Generate secure, random passwords for production databases
- Regular Backups - Configure automated backups to prevent data loss
- Resource Limits - Set appropriate memory and CPU limits based on workload
- Internal Networks - Keep databases on internal networks when possible
- Monitoring - Monitor database logs and health status regularly
- Version Pinning - Use specific Docker image tags instead of
latest
Next Steps
PostgreSQL
Deploy and configure PostgreSQL databases
MySQL
Deploy and configure MySQL databases
MongoDB
Deploy and configure MongoDB databases
Backups
Configure automated database backups