Docs/ Databases/ Provisioning

Database Provisioning

Create production-ready databases in seconds. sh0 manages the container lifecycle, networking, and persistent storage so you can focus on your application.

Supported Databases

sh0 supports five database engines out of the box. Each runs as a managed Docker container within your stack, with persistent volumes and automatic networking.

EngineDefault PortAvailable VersionsUse Case
PostgreSQL543214, 15, 16, 17General purpose, advanced queries, JSONB
MySQL33068.0, 8.4, 9.0Traditional web apps, WordPress, Laravel
MariaDB330610.11, 11.2, 11.4MySQL-compatible, open-source alternative
Redis63797.0, 7.2, 7.4Caching, sessions, queues, pub/sub
MongoDB270176.0, 7.0, 8.0Document store, flexible schemas
Supported database engines in the sh0 dashboard -- showing PostgreSQL, MySQL, MariaDB, Redis, and MongoDB cards

Creating a Database

Databases are created within a stack. Navigate to your stack, then click Add Service and select Database.

  1. Open the Stack where you want the database to live.
  2. Click Add Service in the top-right corner.
  3. Select Database from the service type picker.
  4. Choose your engine (e.g., PostgreSQL).
  5. Give the database a name -- this becomes the container hostname on the internal network.
  6. Configure version, credentials, and resource limits.
  7. Click Create.
Create database dialog -- selecting PostgreSQL, entering a name, and configuring credentials
Tip
The database name you choose becomes the internal hostname. For example, naming your database mydb means your app can reach it at mydb:5432 within the same stack.

Selecting a Version

Each engine offers multiple major versions. sh0 pulls the official Docker image for the version you select. You can change versions later, but this requires a data migration for major version upgrades.

Warning
Downgrading database versions is not supported. Always test major version upgrades in a preview environment first. Create a backup before upgrading.

Resource Limits

sh0 lets you set CPU, memory, and disk limits for each database container. This prevents a single database from consuming all server resources.

CPU and Memory

Set limits on CPU cores and memory allocation. The defaults work well for most workloads, but you can adjust them based on your application needs.

SettingDefaultDescription
CPU Limit1.0 coreMaximum CPU cores the container can use
Memory Limit512 MBMaximum RAM allocation
Memory Reserve256 MBGuaranteed minimum RAM
Resource limits configuration panel -- CPU, memory limit, and memory reservation sliders

Disk Allocation

Database data is stored on a persistent Docker volume. By default, there is no disk quota -- the database can use available disk space on the host. You can set a soft warning threshold in the monitoring configuration to get alerts before disk fills up.

Database Status & Health

sh0 continuously monitors your database containers. The dashboard shows a real-time status indicator for each database.

StatusMeaning
RunningContainer is up and accepting connections
StartingContainer is booting up
StoppedContainer has exited or been stopped
ErrorContainer failed to start or crashed
Database list in the stack view -- showing status indicators, versions, and resource usage

Click on any database to see detailed health information, including current CPU and memory usage, connection count, uptime, and recent logs.

Database detail view -- health metrics, uptime, connections, and resource usage graphs

Managing Databases

From the database detail page, you can perform common management tasks:

  • Start / Stop / Restart -- Control the container lifecycle.
  • View Logs -- Stream real-time container logs.
  • Terminal -- Open a shell inside the database container.
  • Edit Settings -- Change resource limits, version, or credentials.
  • Backups -- Configure and trigger backups (see Backups & Restore).
  • Delete -- Remove the database and its data volume.
Danger
Deleting a database permanently removes its data volume. This action cannot be undone. Always create a backup before deleting a database.
Database management actions -- start, stop, restart, terminal, backups, and delete buttons