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”Today there’s one path: Templates → New template in the sidebar. Paste a compose.yaml, optionally add an env template, and declare your parameters in the form. A direct “Save as template” button from a stack detail page is not shipped yet — copy the stack’s compose into the New-Template form for now.
Parameters
Section titled “Parameters”Parameters are placeholders that get filled at deploy time. Syntax is {{name|...flags}} with pipe-separated flags:
services: postgres: image: postgres:{{version|default:16-alpine}} environment: POSTGRES_USER: {{user|default:postgres}} POSTGRES_PASSWORD: {{password|secret}} POSTGRES_DB: {{database|required}} volumes: - pgdata:/var/lib/postgresql/data ports: - "{{port|default:5432|pattern:^[0-9]+$}}:5432"
volumes: pgdata:Supported inline flags:
| Flag | Effect |
|---|---|
default:value | Pre-fills the deploy dialog with value. Spaces are allowed (default:my default). |
secret | Marks the parameter as secret. If the operator leaves it blank at deploy, dockmesh auto-generates a 32-byte random value rather than prompting. |
required | Refuses to render until a non-empty value is supplied. |
enum:a,b,c | Restricts input to one of the listed values (rendered as a dropdown in the form). |
pattern:^regex$ | Validates the value against the regex before rendering. |
A description is not an inline flag — supply it on the parameter’s declared metadata (the Parameters list in the template editor) which also drives type, ordering, and the help text shown next to each input in the deploy dialog.
No auto-injected parameters
Section titled “No auto-injected parameters”The {{stack_name}}, {{host}}, and {{timestamp}} placeholders are not magic — dockmesh does not auto-resolve them. If you use them in your template body without declaring them as parameters, the deploy dialog will prompt for them like any other input. If you really want a unique-per-deploy value, declare the parameter explicitly and let the operator pick it on each spin-up.
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 six starter templates seeded on first boot:
- PostgreSQL — bare postgres with default user/db/password params
- MySQL — same pattern as postgres
- Redis — single-service Redis cache
- Nginx — simple Nginx file server
- Vaultwarden — Bitwarden-compatible password manager
- Uptime Kuma — status-page / uptime monitor
The set is intentionally minimal — they exist to validate the template engine, not to be a curated marketplace. Add your own under New template for anything else (Gitea, Nextcloud, the *-arrs, Plex/Jellyfin, etc.). The Deploy-Guides under /docs/deploy/ walk through hand-rolling those.
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