Directus Deployment: From Docker Starter to Production
Directus Deployment: From Docker Starter to Production A Directus deployment is easy to start and easy to get subtly wrong. You can have a working instance in minutes with Docker.
Directus Deployment: From Docker Starter to Production
A Directus deployment is easy to start and easy to get subtly wrong. You can have a working instance in minutes with Docker. A production system needs a real database, persistent file storage, HTTPS, pinned versions, backups and monitoring, and each of those is a decision someone on your team has to own. The cleanest path for most organizations is to treat deployment as a small engineering project with a defined scope, not as a weekend install. At Ridiculous Engineering, Directus implementation and migration is part of the work we do, alongside cloud architecture, DevOps and CI/CD.
This guide walks through the options, the infrastructure each one needs, the steps in order, and where deployments usually go wrong.
Key Takeaways
- Directus can be deployed three ways: on Directus Cloud, self-hosted with Docker, or through platform-specific guides for AWS, Azure, Google Cloud, DigitalOcean, Ubuntu, Railway and Render (Directus docs).
- The official starter Docker Compose file is explicitly not production-ready. Production needs an external database, a cache, persistent storage, HTTPS and a pinned image version.
- Most production incidents come from the same short list: unpersisted uploads, unpinned image tags, public permissions that are too broad, and no tested backup.
- Self-hosting is available on every Directus tier, and qualifying small organizations can self-host with a free full-featured license.
- Scope the deployment before you start: who owns the database, the secrets, the upgrades and the on-call response.
Table of Contents
- Your Three Deployment Paths
- What Directus Needs to Run
- Step-by-Step: A Production Deployment
- Securing a Directus Deployment
- Backups, Monitoring and Upgrades
- Planning for Scale
- What It Costs to Self-Host
- How We Help
- FAQ
- Sources
Your Three Deployment Paths
Directus documents three routes: the managed Directus Cloud service, self-hosting with Docker on a VPS or your own server, and step-by-step guides for specific platforms. The right one depends on who in your organization will carry the operational load.
| Path | You control | You operate | Best fit |
|---|---|---|---|
| Directus Cloud | Content model, permissions | Very little; hosting, updates and scaling are handled for you | Teams without platform engineers who want to start quickly |
| Self-hosted with Docker | Database, cache, file storage, network, region | Everything: upgrades, backups, monitoring, security | Teams with data residency, compliance or cost-control requirements |
| Cloud platform guides (AWS, Azure, Google Cloud, DigitalOcean, Railway, Render) | Same as self-hosted, on a platform you already use | Most of the stack, on managed building blocks | Organizations already standardized on one cloud |
Directus describes its Cloud option as fully managed, with 15+ global regions and autoscaling. Self-hosting trades that convenience for control. If your security team requires that data stay in your own cloud account, or you already run containers at scale, self-hosting is the natural choice. If you are not sure, the question to answer first is not “Docker or Cloud?” but “who gets paged when the database fills up?”
What Directus Needs to Run
Before choosing hosting, know what the application expects. Directus is distributed as a Docker image, so you need a Docker-capable environment. If you install from npm instead, the same page lists a minimum Node.js version (26 or newer at the time of writing).
The requirements page also gives sizing guidance: a minimum of one container at 0.25 vCPU and 512 MB, and a recommended minimum of two containers at 1 vCPU and 2 GB each. Supported databases are LTS versions of PostgreSQL, MySQL, SQLite, MS SQL Server, MariaDB, CockroachDB and OracleDB. The same page recommends, without requiring, a backup system for the database and asset storage, a CDN, a load balancer across instances and a monitoring system.
Translated for a leader reviewing a plan, the checklist looks like this:
- Database: a managed relational database, not a file on a container disk. PostgreSQL is the common production choice.
- File storage: a mounted volume or external object storage, so uploads survive restarts.
- Cache: Redis when you run more than one instance or want shared caching.
- Edge: a reverse proxy or load balancer that terminates HTTPS.
- Operations: backups, health checks, alerting and a documented upgrade routine.
What Directus does at its core explains why the database matters so much. It wraps your SQL database and generates REST and GraphQL APIs from the schema. Your data model lives in your database, so the database is the system of record, and protecting it is the main job.
Step-by-Step: A Production Deployment
1. Start from the official starter, then leave it behind
The Create a Project guide has you make a directus directory with database, uploads and extensions subfolders, then write a docker-compose.yml that runs the Directus image on port 8055 with persistent volumes. It sets a SECRET, a database client and a public URL. The guide itself says this starter is not production-ready. Its SQLite database is ideal for a laptop and a poor fit for a business system.
Where it goes wrong: the starter quietly becomes production. A proof of concept gets shown to stakeholders, someone points a domain at it, and now the company’s content lives in a single file on one server. Decide early whether the first environment is disposable or the seed of the real one.
2. Choose and provision the database
The Deploying Directus docs state that at minimum you configure a database and set a SECRET, both through environment variables. The production Compose example there uses PostGIS 17-3.5 and Redis 7, with PostgreSQL as the client and Redis as the cache store.
Where it goes wrong: running the database as a container on the same host as the application, with no snapshot schedule. Use a managed database service where you can, with automated backups and a restore you have actually rehearsed.
3. Persist files
Uploads are not stored in the database. The Deploying Directus docs say files persist by mounting a volume or configuring external storage. On Azure, for example, the official guide mounts Azure Files shares for the database, extensions and uploads folders, and requires that the platform’s own app storage setting stay off. On DigitalOcean, the App Platform guide calls for a managed database, a Redis droplet for synchronized instances, and S3-compatible object storage for uploads.
Where it goes wrong: a redeploy wipes the container, and every image your marketing team uploaded goes with it. Every platform handles persistence differently, so confirm it on day one by uploading a file and recreating the container.
4. Set secrets and an admin account properly
Generate a random SECRET and keep it in a secret manager, not in a .env file committed to a repository. For scripted deployments, Directus says you can pre-configure the initial admin user with the ADMIN_* variables and a static access token. When applying templates with the official CLI, the directus-labs starter documentation recommends interactive mode so the token does not end up in shell history or process lists.
Where it goes wrong: credentials in chat threads, build logs and repositories. Decide who can read production secrets and how they rotate before the first deploy.
5. Put HTTPS in front
The Ubuntu server guide opens firewall ports 22, 80, 443 and 8055, starts Directus with Docker Compose, and makes it reachable at the server IP on port 8055 before you add a reverse proxy. That is a stepping stone, not an endpoint. In production, terminate TLS at a reverse proxy or load balancer, set PUBLIC_URL to the HTTPS address, and stop exposing port 8055 to the internet.
Where it goes wrong: leaving the raw port open, or mixed HTTP and HTTPS URLs that break the admin app and API calls from your front end.
6. Pin the version
The docs recommend pinning the Docker image to a specific version tag in production rather than using latest, so a restart never pulls in breaking changes by surprise. Treat upgrades as planned releases: read the release notes, back up the database, test on a staging copy, then change the tag.
Where it goes wrong: “latest” in a Compose file. It works for months, then a routine restart changes behavior on a Tuesday afternoon.
7. Automate the pipeline
Once there is more than one environment, schema changes and extensions need a repeatable path from development to staging to production. This is where CI/CD earns its keep: the same build, the same configuration pattern, and a rollback you can run under pressure. We build and support this kind of delivery pipeline as part of our custom software development work.
Securing a Directus Deployment
Security in Directus has two layers: the infrastructure around it and the permission model inside it.
Infrastructure. Keep the database off the public internet, expose only the proxy, restrict allowed origins explicitly, and trust proxy headers only when a trusted proxy is actually in front. Keep secrets out of source control.
Permissions. The official security guidance is blunt about the Public role: it applies to unauthenticated requests, so anything granted there should be treated as readable by the whole world, and as writable by the whole world if you grant create, update or delete. Audit it before launch and after every schema change. Equally important is who can edit system collections and automation. Flows can run logic with elevated reach, so write access to them deserves the same scrutiny as server access. We cover both topics in depth in our guides to Directus permissions, roles and policies and Directus Flows in production.
A useful review question for leaders: if a content editor’s account were compromised tomorrow, what is the worst thing it could do? If the answer involves system collections, tighten roles before go-live.

Backups, Monitoring and Upgrades
The Directus requirements page treats backups and monitoring as recommendations. For a business system, treat them as requirements.
- Backups: back up both the database and the file storage, and restore into a clean environment on a schedule. A backup you have never restored is a hypothesis.
- Health checks: Directus exposes two endpoints, per the deployment docs. The /server/ping endpoint is unauthenticated and suited to load balancer probes. The /server/health endpoint is authenticated, checks the database, Redis, storage and email, and returns a 503 when a dependency is unhealthy.
- Alerting: wire those checks to an alert that reaches a named person or rotation, not an inbox nobody watches.
- Upgrades: a short runbook covering backup, staging test, tag change, verification and rollback. Keep it in the repository next to the Compose file.
This is the part that gets neglected after launch, because nothing looks broken until it is. It is also the part that long-term support exists for, and our software consulting and delivery support covers ongoing improvement after go-live.
Planning for Scale
One instance is simple. Multiple instances behind a load balancer are where the infrastructure dependencies appear: shared Redis for cache and synchronization, shared object storage so every instance sees the same uploads, and a single database all of them connect to. The DigitalOcean guide notes that Directus does not currently support clustered Redis, which is the kind of detail worth knowing before you design the topology.

Caching is usually the first lever when traffic grows. Teams coming from other CMS platforms will recognize the pattern; Drupal caching plugins follow the same idea of serving repeated requests without hitting the application every time. For the larger picture of getting infrastructure ready for spikes, see our piece on preparing infrastructure for high-traffic events, and for keeping the bill in check as you grow, our cloud cost governance guide.
What It Costs to Self-Host
The software license and the infrastructure bill are separate questions. On licensing, Directus states that self-hosting is available on every tier, and organizations with under $5M in annual revenue and fewer than 50 employees can qualify for fully permissive access at no software cost. The Open Innovation Grant describes that free license as having no caps on seats, collections or features for self-hosted use. Check the current terms on those pages, since they can change.
The infrastructure bill is your database, containers, storage, bandwidth and monitoring, plus the engineering time to run them. For the engineering side, the honest comparison is between a one-time deployment project and the recurring effort of upgrades, security review and incident response.
How We Help
If you want Directus in production without building the operational muscle yourself, we handle implementation and migration, and we work with you from discovery through long-term support. Clients work directly with senior engineers. Our Content Systems and CMS Infrastructure work covers the headless CMS layer, and Consus is our managed headless CMS, offered through a focused beta and consultation process. Scope and pricing for implementation work are provided on request, based on your requirements. For a closer look at what a Directus engagement should contain, read our guide to Directus consulting scope, budget and timeline, or our honest Directus review to see when it is the right fit.
FAQ
Is Directus free to self-host?
Self-hosting is available on every Directus tier. Organizations under $5M in annual revenue with fewer than 50 employees can qualify for a free full-featured license, according to Directus pricing. You still pay for the infrastructure and the people who run it.
Can I run Directus with just Docker Compose?
Yes for local development and testing. The official starter Compose file is described as not production-ready, so a production setup adds an external database, Redis, persistent storage, HTTPS and a pinned image version.
Which database should I use for production?
Directus supports PostgreSQL, MySQL, MariaDB, MS SQL Server, SQLite, CockroachDB and OracleDB. The production example in the docs uses PostgreSQL with Redis. SQLite suits local work, not a shared business system.
How do I know my Directus instance is healthy?
Use /server/ping for simple liveness checks and the authenticated /server/health endpoint for dependency checks covering the database, Redis, storage and email. Connect both to alerting so a failure reaches a person quickly.
Do I need a team to run it?
Someone must own upgrades, backups, secrets and monitoring. If that is not an existing role on your team, scoping it with an engineering partner before launch is cheaper than discovering the gap during an outage.
Sources
- How to Deploy Directus
- Self-Hosting Requirements
- Deploying Directus
- Create a Project
- Deploy Directus to an Ubuntu Server
- Deploy Directus to Digital Ocean
- Deploy Directus to Azure Web Apps
- Security Best Practices
- directus-labs starters README
- Directus on GitHub
- Directus Pricing
- Get Started with Directus
- Drupal caching plugins