Skip to main content

Database Templates

The database category includes 5 production-ready database templates with persistent storage, health checks, and secure defaults.

Template List

TemplateDescriptionDefault PortMin RAMSecurity
PostgreSQLAdvanced open-source relational database5432256 MBsecure
MySQLPopular open-source relational database3306512 MBsecure
MariaDBMySQL-compatible community fork3306512 MBsecure
MongoDBDocument-oriented NoSQL database27017512 MBsecure
RedisIn-memory key-value store and cache6379128 MBsecure

Common Configuration

All database templates include:

  • Persistent volumes for data storage (survives container restarts)
  • Health checks using database-native commands (pg_isready, mysqladmin ping, etc.)
  • Auto-generated passwords — secure random passwords created at deploy time
  • No exposed ports — databases are accessible only within the Docker network

Variables

VariableTypeDescription
SERVICE_NAMEstringService identifier (required)
DB_NAMEstringInitial database name
DB_USERstringDatabase admin username
DB_PASSWORDpasswordDatabase admin password (auto-generated if empty)

PostgreSQL

Image: postgres:16

The default database for AI Admin Panel itself. Configured with:

  • WAL archiving support
  • pg_stat_statements extension enabled
  • Tuned shared_buffers and work_mem for the allocated memory
  • Automatic vacuum configuration

MySQL

Image: mysql:8.4

Configured with:

  • InnoDB as the default storage engine
  • utf8mb4 character set and utf8mb4_unicode_ci collation
  • Binary logging enabled for point-in-time recovery
  • Secure default authentication (caching_sha2_password)

MariaDB

Image: mariadb:11

MySQL-compatible with additional features:

  • Aria storage engine for crash-safe temporary tables
  • Thread pool for better concurrent connection handling
  • utf8mb4 character set by default

MongoDB

Image: mongo:7

Document database configured with:

  • Authentication enabled by default
  • WiredTiger storage engine
  • Journal enabled for crash recovery
  • Initial database and user created from variables

Redis

Image: redis:7

In-memory store configured with:

  • appendonly yes for persistence
  • maxmemory-policy allkeys-lru to handle memory limits
  • Password authentication required
  • RDB snapshots every 60 seconds

Connecting to Databases

Databases deployed through the panel are accessible to other services on the same Docker network. Use the service name as the hostname:

# From another service on the same panel
postgresql://db_user:db_pass@my-postgres:5432/mydb
mysql://db_user:db_pass@my-mysql:3306/mydb
mongodb://db_user:db_pass@my-mongo:27017/mydb
redis://:password@my-redis:6379

For external access, databases intentionally do not expose ports. If you need external access, deploy a connection proxy or use the panel's API to stream queries.

Backup Integration

Database templates work with the panel's backup system. Backups use database-native dump tools:

  • PostgreSQL: pg_dump
  • MySQL/MariaDB: mysqldump
  • MongoDB: mongodump
  • Redis: RDB snapshot copy