Stack Templates
Stack Templates turn a working compose.yaml into a reusable blueprint. Save a well-configured Postgres stack once, then deploy identical (or parameterized) copies on any host with one click.
Creating a template
Section titled “Creating a template”Two paths:
From an existing stack:
- Open the stack detail page
- Actions → Save as template
- Name + description + (optional) icon
- Pick which variables should be parameters
From scratch:
- Templates → New template
- Paste
compose.yaml - Define parameters manually
Parameters
Section titled “Parameters”Parameters are placeholders that get filled at deploy time. Syntax is {{param_name}}:
services: postgres: image: postgres:{{version|default:16-alpine}} environment: POSTGRES_USER: {{user|default:postgres}} POSTGRES_PASSWORD: {{password|secret}} POSTGRES_DB: {{database}} volumes: - {{stack_name}}_pgdata:/var/lib/postgresql/data ports: - "{{port|default:5432}}:5432"
volumes: {{stack_name}}_pgdata:Each parameter can have:
default:...— pre-filled value in the deploy dialogsecret— renders as password field, stored encrypteddescription— shown as help textenum:...— dropdown of allowed valuespattern:...— regex validation
Built-in parameters
Section titled “Built-in parameters”dockmesh auto-provides these:
{{stack_name}}— the name the user picks for the new stack{{host}}— the target host{{timestamp}}— current ISO timestamp (useful for unique volume names)
Deploying from a template
Section titled “Deploying from a template”- Templates → [your template] → Deploy
- dockmesh shows a form with all parameters
- Required fields, defaults, help text, validation
- Pick target host
- Click Deploy
Behind the scenes: dockmesh substitutes parameters, writes the final compose.yaml to the stack directory, and runs deploy.
Sharing templates
Section titled “Sharing templates”Export produces a .yml file with the template + metadata. Import it on another dockmesh instance or commit it to a Git repo for team sharing.
Built-in template library
Section titled “Built-in template library”dockmesh ships with starter templates for common self-host apps:
- PostgreSQL
- MySQL / MariaDB
- Redis
- Nginx reverse proxy
- Caddy with auto-HTTPS
- Nextcloud
- Gitea
- Vaultwarden
- Plex / Jellyfin
- Watchtower (for auto-updates)
- Uptime Kuma
Clone and customize for your environment.
Update flow
Section titled “Update flow”When a template is updated, existing stacks deployed from it are not touched — they keep running with their original config. To apply template changes, redeploy the stack from the template (with the current parameters).
If you want stacks to update automatically, use Git-backed stacks instead.
See also
Section titled “See also”- Stack Management — manual stack creation
- Environment Variables — alternative to template params for env
- Deploy Tutorials — end-to-end deploy walkthroughs