Skip to content

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.

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 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:

FlagEffect
default:valuePre-fills the deploy dialog with value. Spaces are allowed (default:my default).
secretMarks the parameter as secret. If the operator leaves it blank at deploy, dockmesh auto-generates a 32-byte random value rather than prompting.
requiredRefuses to render until a non-empty value is supplied.
enum:a,b,cRestricts 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.

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.

  1. Templates → [your template] → Deploy
  2. dockmesh shows a form with all parameters
  3. Required fields, defaults, help text, validation
  4. Pick target host
  5. Click Deploy

Behind the scenes: dockmesh substitutes parameters, writes the final compose.yaml to the stack directory, and runs deploy.

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.

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.

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.