Webstudio Self-Hosted CMS
Build pages by writing Webstudio-native build objects into the Postgres Build row,
then publish via the publisher API. This skill manages a self-hosted Webstudio
instance (Docker Compose) and everything you can do with it.
Quick Reference
| Topic | File |
|---|---|
| Install / self-host setup, CLI, deploy | install.md |
| Security boundaries, credentials, approval gates | security.md |
| Authenticated PostgREST migration | postgrest-auth.md |
| Stack, services, health, gotchas | database.md (stack) |
| Build table schema, PostgREST, load/commit | database.md |
| Element tree, pages, instances, props | build-objects.md |
| Styling, css-data parser, tokens, breakpoints | styling.md |
| Pages, folders, assets, MinIO storage | assets-pages.md |
| Publishing, domains, auth tokens | publishing.md |
| Canvas verification, Playwright audit | verification.md |
| Full documented API surface | api.md |
| The Builder UI (canvas, navigator, modes) | ui-builder.md |
| Webstudio design system (tokens, variables) | design.md |
| Advanced features (CMS, variables, forms, AI) | features.md |
Read the file for the area you're working in BEFORE touching the build. The master file stays lean on purpose - detail lives in the per-area files.
Where things live
This skill is generic to any self-hosted Webstudio deployment. Replace the placeholders with your own values before relying on them:
- Deployment:
<your-dir>/docker-compose.ymland its deployment-managed secret/config sources. Do not read.envautomatically; seesecurity.md. - This skill folder: the skill itself (publishable as-is, pure markdown - no runnable code)
Critical Rules
- Read
security.mdbefore any login, database write, asset change, domain change, or publish. - Identify the PostgREST profile before acting. Broad internal
anonprivileges plus Docker-network isolation are the current community self-host default. Preserve that capability when required, but never expose it. Read the validation status and bounded-use procedure inpostgrest-auth.md. Treat its JWT profile as a staged migration until it passes the documented disposable-stack test; do not revokeanonfirst and break the Builder. - Do not discover credentials. Use an existing authenticated session or a credential that the operator explicitly authorizes through an approved secret-injection mechanism. Never read, print, log, commit, or paste secret values.
- Get explicit approval before external or production changes. Publishing, DNS changes, account changes, and destructive database or asset operations require a named target and a final user confirmation.
- Use the official CLI/MCP for native project edits when the Builder supports it. Use direct database operations only as the documented self-hosted maintenance fallback.
- One fix per turn. Save a NEW named copy after every change. Never overwrite in place.
- Resolve one exact draft by project ID and build ID. Never update every row whose
deploymentis null. - Back up the exact row before a direct database edit. Use a transaction, bound parameters, optimistic concurrency, and an exact one-row result. Roll back on any mismatch.
- Never hand-write a style value. Use Webstudio's own css-data parser (see
styling.md). - When you mutate instances, preserve every loaded namespace and metadata field. Direct SQL
must also advance
version,lastTransactionId, andupdatedAtas Webstudio does. - Every styled element needs a bound local style source in
styleSourceSelections, or the style silently won't apply. - Styles are element-scoped with no cascade. Apply every needed property to every target instance; don't rely on inheritance.
- Publish SSG (
buildMode:"ssg"), not SSR unless the operator has deliberately configured the additional SSR runtime boundary. - Verify with canvas DOM measurements, not eyeballs. Text-only, no images into the model.
- Assets upload to MinIO (S3-compatible); they are not stored in Postgres.
Standard Workflow
- Confirm the target deployment and authorization boundary (
security.md). - Prefer the official CLI/MCP linked with a project-scoped Build-access share link.
- Use
meta.index, request only the needed tools, and dry-run supported mutations. - Make the requested change in Webstudio's native model and verify the committed version.
- If the CLI/MCP cannot perform the operation, use the exact-row database fallback in
database.md; do not silently switch to anonymous PostgREST. - Verify by inspecting the canvas DOM or XML (
verification.md). - Publish only after separate explicit approval (
publishing.md).
Memory
Operator/instance-specific preferences are not part of this published skill. The skill is generic; any local customization lives in your own deployment notes, not here.
