Templates
Deploy pre-configured apps with one click.
Available Templates
Databases
| Template | Description | Default Port |
|---|---|---|
| PostgreSQL | Relational database | 5432 |
| MySQL | Popular SQL database | 3306 |
| MariaDB | MySQL-compatible | 3306 |
| MongoDB | Document database | 27017 |
| Redis | In-memory cache | 6379 |
Database Admin
| Template | Description | Default Port |
|---|---|---|
| pgAdmin | PostgreSQL admin UI | 80 |
| phpMyAdmin | MySQL/MariaDB admin | 80 |
| Adminer | Universal DB admin | 8080 |
| RedisInsight | Redis GUI | 8001 |
Web Servers
| Template | Description | Default Port |
|---|---|---|
| Nginx | Static file server | 80 |
| Apache | HTTP server | 80 |
| Caddy | Modern web server | 80 |
CMS
| Template | Description | Default Port |
|---|---|---|
| WordPress | Blog/CMS platform | 80 |
| Ghost | Modern publishing | 2368 |
| Strapi | Headless CMS | 1337 |
Development Tools
| Template | Description | Default Port |
|---|---|---|
| Gitea | Git server | 3000 |
| Code Server | VS Code in browser | 8080 |
| Portainer | Container management | 9000 |
| n8n | Workflow automation | 5678 |
Monitoring
| Template | Description | Default Port |
|---|---|---|
| Uptime Kuma | Status monitoring | 3001 |
| Grafana | Metrics dashboard | 3000 |
| Prometheus | Metrics collection | 9090 |
Storage
| Template | Description | Default Port |
|---|---|---|
| MinIO | S3-compatible storage | 9000 |
| File Browser | Web file manager | 80 |
Using Templates
Via Dashboard
- Open Basepod dashboard
- Go to Templates
- Click on a template
- Enter app name
- Click Deploy
Via CLI
bash
# List templates
bp templates
# Deploy from template
bp deploy mydb --template postgresTemplate Configuration
Each template includes sensible defaults. You can customize:
- Name: Your app name (becomes subdomain)
- Environment Variables: Pre-filled with defaults
- Volumes: Persistent storage paths
Example: PostgreSQL
Default environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: (generated)
POSTGRES_DB: postgresDefault volume:
/var/lib/postgresql/dataExample: WordPress
Default environment:
WORDPRESS_DB_HOST: (your-db-container)
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: (generated)
WORDPRESS_DB_NAME: wordpressConnecting Apps
Templates that need databases can connect via internal networking.
- Deploy a database (e.g., PostgreSQL)
- Deploy your app
- Use the internal hostname:
basepod-postgres:5432
Example WordPress + MySQL:
bash
# Deploy MySQL
bp deploy mydb --template mysql
# Deploy WordPress
bp deploy myblog --template wordpress
# In WordPress config, use:
# DB_HOST=basepod-mydb:3306Creating Custom Templates
Create your own templates for single apps or multi-service stacks.
Template File Structure
Create a .yaml file with your template definition:
yaml
# mytemplate.yaml
name: myapp
version: "1.0"
services:
- name: web
image: nginx:alpine
port: 80
env:
NGINX_HOST: example.com
volumes:
- html:/usr/share/nginx/htmlDeploy Custom Template
bash
# Deploy local template file
bp template deploy ./mytemplate.yaml
# Deploy with custom name
bp template deploy ./mytemplate.yaml --name mysiteMulti-Service Stacks
Define multiple services in one template, similar to docker-compose.
Example: Node.js + PostgreSQL
yaml
# nodeapp.yaml
name: nodeapp
version: "1.0"
services:
- name: api
build: .
port: 3000
env:
DATABASE_URL: postgres://postgres:secret@db:5432/app
NODE_ENV: production
depends_on:
- db
- name: db
template: postgres
env:
POSTGRES_PASSWORD: secret
POSTGRES_DB: app
volumes:
- pgdata:/var/lib/postgresql/dataExample: WordPress Stack
yaml
# wordpress-stack.yaml
name: myblog
version: "1.0"
services:
- name: wordpress
template: wordpress
port: 80
env:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: secret
WORDPRESS_DB_NAME: wordpress
volumes:
- wp-content:/var/www/html/wp-content
depends_on:
- db
- name: db
template: mysql
env:
MYSQL_ROOT_PASSWORD: rootsecret
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: secret
volumes:
- mysql-data:/var/lib/mysqlExample: LAMP Stack
yaml
# lamp.yaml
name: lamp
version: "1.0"
services:
- name: web
image: php:8.2-apache
port: 80
env:
DB_HOST: db
DB_NAME: app
volumes:
- ./src:/var/www/html
depends_on:
- db
- name: db
template: mysql
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: app
volumes:
- mysql-data:/var/lib/mysql
- name: phpmyadmin
template: phpmyadmin
port: 8080
env:
PMA_HOST: dbTemplate Schema Reference
Root Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Stack name (used as prefix) |
version | string | No | Template version |
services | array | Yes | List of services |
Service Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Service name |
image | string | No* | Docker image |
template | string | No* | Use predefined template |
build | string | No* | Build from path |
port | integer | No | Exposed port |
env | object | No | Environment variables |
volumes | array | No | Volume mounts |
depends_on | array | No | Service dependencies |
*One of image, template, or build is required.
Service Types
1. From Docker Image
yaml
- name: web
image: nginx:alpine
port: 802. From Predefined Template
yaml
- name: db
template: postgres
env:
POSTGRES_PASSWORD: secret3. From Local Source
yaml
- name: api
build: ./api
port: 3000Volumes
Named volumes for persistence:
yaml
volumes:
- data:/app/data # named volume
- ./local:/container/path # bind mount (dev only)Dependencies
Control startup order:
yaml
services:
- name: api
depends_on:
- db
- cache
- name: db
template: postgres
- name: cache
template: redisSharing Templates
Export Running Stack
bash
# Export current app configuration as template
bp template export myapp > myapp-template.yamlTemplate Library
Store templates in a git repository:
my-templates/
├── stacks/
│ ├── lamp.yaml
│ ├── mean.yaml
│ └── wordpress.yaml
└── apps/
├── api-server.yaml
└── static-site.yamlDeploy from URL:
bash
bp template deploy https://github.com/user/templates/raw/main/stacks/lamp.yamlEnvironment Variables
Inline Values
yaml
env:
NODE_ENV: production
API_KEY: mysecretReference Other Services
Use service names as hostnames:
yaml
services:
- name: api
env:
DATABASE_URL: postgres://user:pass@db:5432/mydb
REDIS_URL: redis://cache:6379
- name: db
template: postgres
- name: cache
template: redisGenerated Values
Use placeholders for auto-generated values:
yaml
env:
SECRET_KEY: ${RANDOM_32} # 32-char random string
API_TOKEN: ${RANDOM_64} # 64-char random string
DB_PASSWORD: ${RANDOM_16} # 16-char random stringBest Practices
- Use named volumes for data persistence
- Set
depends_onfor proper startup order - Use templates for standard services (postgres, redis, etc.)
- Keep secrets in environment variables, not in the template file
- Version your templates in git for reproducibility