Overview
This template provides a production‑ready Directus instance as a Monk runnable. You can:- Run it directly to get a managed headless CMS and data platform
- Inherit it in your own applications to add a powerful API-first content management system
What this template manages
- Directus server with admin UI
- PostgreSQL or MySQL database
- Redis for caching (optional)
- REST and GraphQL APIs
- File storage and asset management
- Web UI on port 8055
Quick start (run directly)
- Load templates
- Run Directus stack
- Customize credentials (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesindirectus.yaml, thenmonk load MANIFESTand run.
http://localhost:8055 and create your admin user on first login.
Configuration
Key variables you can customize in this template:${monk-volume-path}/directus and ${monk-volume-path}/postgres on the host.
Use by inheritance (recommended for apps)
Inherit the Directus stack in your application and declare a connection. Example:Ports and connectivity
- Service:
directuson TCP port8055 - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the Directus host. - REST API:
http://\<host>:8055/items/\<collection> - GraphQL API:
http://\<host>:8055/graphql
Persistence and configuration
- Data path:
${monk-volume-path}/directus/uploads:/directus/uploads - Extensions path:
${monk-volume-path}/directus/extensions:/directus/extensions - Database path:
${monk-volume-path}/postgres:/var/lib/postgresql/data - You can add custom Directus extensions by placing them in the extensions path.
Features
- Headless CMS: API-first content management
- Database Wrapper: Works with any SQL database
- Auto-Generated APIs: REST and GraphQL from database schema
- No-Code App: Intuitive UI for non-technical users
- File Management: Upload, transform, and serve assets
- User & Role Management: Granular permissions
- Webhooks & Automation: Trigger actions on data changes
- Translations: Multi-language content support
- Custom Extensions: Extend with modules, interfaces, and hooks
API Access
REST API example:Use cases
Directus excels at:- Headless CMS for websites and apps
- Backend-as-a-Service (BaaS)
- Admin panels and dashboards
- Data management platforms
- API layer for legacy databases
- Multi-channel content delivery
- Internal tools and workflows
Related templates
- Combine with databases (PostgreSQL, MySQL) for content storage
- Use with CDN for static asset delivery
- Integrate with object storage (S3, Minio) for media files
Troubleshooting
- Access Directus UI at
http://localhost:8055 - Generate random keys:
openssl rand -hex 32 - Create API token in Settings → Access Tokens
- If you changed
admin-passwordbut the instance has existing data, authentication may fail. Either reset the data volume or update the password in Directus settings. - Ensure the host volumes are writable by the container user.
- Check logs:
- For database connection issues, verify PostgreSQL is running
- For file upload issues, check volume permissions
- For API errors, verify authentication token is valid
- Monitor PostgreSQL performance for large datasets