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.
| Engine | Default Port | Available Versions | Use Case |
|---|---|---|---|
| PostgreSQL | 5432 | 14, 15, 16, 17 | General purpose, advanced queries, JSONB |
| MySQL | 3306 | 8.0, 8.4, 9.0 | Traditional web apps, WordPress, Laravel |
| MariaDB | 3306 | 10.11, 11.2, 11.4 | MySQL-compatible, open-source alternative |
| Redis | 6379 | 7.0, 7.2, 7.4 | Caching, sessions, queues, pub/sub |
| MongoDB | 27017 | 6.0, 7.0, 8.0 | Document store, flexible schemas |
Creating a Database
Databases are created within a stack. Navigate to your stack, then click Add Service and select Database.
- Open the Stack where you want the database to live.
- Click Add Service in the top-right corner.
- Select Database from the service type picker.
- Choose your engine (e.g., PostgreSQL).
- Give the database a name -- this becomes the container hostname on the internal network.
- Configure version, credentials, and resource limits.
- Click Create.
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.
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.
| Setting | Default | Description |
|---|---|---|
| CPU Limit | 1.0 core | Maximum CPU cores the container can use |
| Memory Limit | 512 MB | Maximum RAM allocation |
| Memory Reserve | 256 MB | Guaranteed minimum RAM |
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.
| Status | Meaning |
|---|---|
| Running | Container is up and accepting connections |
| Starting | Container is booting up |
| Stopped | Container has exited or been stopped |
| Error | Container failed to start or crashed |
Click on any database to see detailed health information, including current CPU and memory usage, connection count, uptime, and recent logs.
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.