Self-Host Directus: Requirements, Costs & Real Maintenance Burden
What you need to self-host Directus: specs, database, Docker, costs. Infrastructure EUR 200-300/mo. Labor EUR 250-400/mo. Managed hosting is cheaper at EUR 100-150/mo.
- Minimum specs: 0.25 vCPU, 512MB RAM, Docker, PostgreSQL database; production needs 1 vCPU, 2GB RAM, and Redis caching
- Infrastructure costs EUR 200-300/mo; labor costs EUR 250-400/mo for patching, backups, monitoring, and incident response
- Total self-hosting cost: EUR 500-620/mo versus EUR 100-150/mo for managed hosting with included backups and GDPR compliance
- Self-hosting makes sense only if you have dedicated DevOps expertise, already run PostgreSQL in-house, or face on-premises regulatory requirements
Self-hosting Directus means running it on your own infrastructure. You need a database (PostgreSQL recommended), Docker to containerize it, a server with at least 0.25 vCPU and 512MB RAM, and operational knowledge to maintain it. The real cost isn't the server--it's the time spent on backups, updates, and fixing things when they break. This guide covers what you actually need, what it truly costs, and when managed hosting makes more sense.
System Requirements for Self-Hosted Directus
Directus will run on surprisingly modest hardware. The minimum is 0.25 vCPU and 512MB RAM--roughly equivalent to a entry-level VPS. For production workloads, Directus recommends 1 vCPU and 2GB RAM. This is the floor where you can handle moderate traffic without constant memory pressure. If you're running a production CMS serving 1,000+ API requests per hour, you'll need the higher spec or face degradation.
Docker is required. Directus doesn't ship as a standalone binary you drop on a server. You must run it in a container, which means learning Docker basics at minimum, and Docker Compose for managing multiple services (Directus, database, cache) together. This is a hard prerequisite, not optional.
You'll need one of seven supported SQL databases. PostgreSQL is the official recommendation and what most teams use in production. MySQL, MariaDB, SQLite, Oracle, MSSQL, and CockroachDB are also supported, but PostgreSQL is the most tested path and has the largest community. Your database server needs its own hardware--running Postgres on the same 1 vCPU as Directus starves both services.
Redis for caching is optional for small deployments but becomes mandatory as you scale. Directus uses Redis to cache API responses, authentication tokens, and asset metadata. Without it, every request hits the database, and performance collapses around 5,000+ concurrent users. You should plan for it in production from day one.
Node.js 18.x or later powers Directus. You don't install Node directly on most self-hosted setups--it's baked into the Directus Docker image. But if you're building custom extensions or modifying core behavior, you'll need Node expertise.
Infrastructure Costs: What You'll Actually Pay
A bare-minimum managed VPS with 0.25 vCPU and 512MB RAM costs EUR 15-30 per month from providers like Hetzner or Linode. That's your Directus application server. Your database needs separate resources. A managed PostgreSQL instance starts at EUR 10-15/mo for shared infrastructure, EUR 50-100/mo for dedicated resources. If you want Redis for caching, add another EUR 5-10/mo.
Production-grade infrastructure doubles or triples this. A load balancer to distribute traffic across two Directus instances: EUR 20/mo. A CDN to serve static assets: EUR 10-30/mo. A managed backup service with automated snapshots and point-in-time recovery: EUR 20-50/mo. A dedicated database server with automatic failover: EUR 80-150/mo alone. SSL certificates are usually free (Let's Encrypt), but the infrastructure to manage certificate renewal costs EUR 5-10/mo in tooling.
Realistic production costs: EUR 200-300/mo in raw infrastructure. This assumes moderate usage (under 1 million API requests/month, under 100GB data). If you scale beyond that, costs climb linearly.
But infrastructure is the visible cost. The hidden cost is far larger.
The Hidden Cost: DevOps Labor and Operational Burden
Self-hosting Directus requires 4-6 hours of active maintenance per month, minimum. This time goes to security patching, database backups, performance monitoring, and troubleshooting when things break--and they will break.
Security patches arrive weekly in the open-source world. Each patch requires you to rebuild the Docker image, test it in staging, coordinate a deployment window, execute the update, and monitor for problems. On a EUR 15/hr senior engineer (loaded cost EUR 30-40/hr), one update costs EUR 50-100 in labor. One per week is EUR 200-400/mo in security patching alone.
Database backups must be automated, but monitoring them manually is essential. A failed backup you don't know about is worse than no backup at all--it means data loss risk. Monthly restore tests (to prove backups work) cost 2-3 hours: EUR 60-120/mo.
Monitoring requires tools. Prometheus or Datadog to watch CPU, RAM, disk I/O, database connection pools, API latency, and error rates. Setting up monitoring takes 8-16 hours upfront (EUR 240-640). Responding to alerts takes 1-2 hours/mo: EUR 30-80/mo ongoing.
When performance degrades--and it will--you must diagnose whether the bottleneck is CPU, database queries, network, or the application itself. Query optimization on a 50GB PostgreSQL database is a specialist skill. Budget EUR 200-300 per incident if you lack in-house expertise.
Add it up: EUR 200/mo in patching, EUR 90/mo in backups, EUR 50/mo in monitoring, EUR 100/mo in incidents. That's EUR 440/mo in labor costs. A team of one or two can't sustain this indefinitely. Most organizations report 6-8 hours/month, which at EUR 40/hr loaded cost is EUR 240-320/mo.
Total realistic self-hosting cost: EUR 500-620/mo (EUR 250 infrastructure + EUR 250-370 labor).
Setting Up Directus with Docker Compose
The core deployment stack uses three containers: Directus application, PostgreSQL database, and optionally Redis cache. A minimal docker-compose.yml looks like this:
version: '3.8'
services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: directus
POSTGRES_USER: directus
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
directus:
image: directus/directus:latest
ports:
- "8055:8055"
environment:
DB_CLIENT: postgres
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: directus
DB_USER: directus
DB_PASSWORD: ${DB_PASSWORD}
KEY: ${DIRECTUS_KEY}
SECRET: ${DIRECTUS_SECRET}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
volumes:
- directus-uploads:/directus/uploads
- directus-extensions:/directus/extensions
Environment variables control the setup: database credentials, encryption keys for tokens and passwords, admin account details, and the public URL. Store these in a.env file, never in code.
Start the stack with docker-compose up. The database initializes, Directus runs migrations, and the admin panel is ready to access on your local machine in seconds. For development, this is perfect.
Production requires extras: a reverse proxy (Nginx) to handle SSL and route requests, persistent volumes mounted on fast storage, health checks to automatically restart failed containers, and log aggregation to track errors. A production Docker Compose file is 150+ lines. Many teams move to Kubernetes at scale to get these guarantees without manual configuration.
This is where self-hosting gets heavy: a 10-minute development setup becomes a 40-hour production deployment if done right.
Ongoing Maintenance: What Actually Breaks
Security patches are the most frequent maintenance task. Directus releases updates weekly containing bug fixes and security patches. Each one requires testing and deployment. If you skip updates, you accumulate risk: known vulnerabilities in Node.js dependencies, logic bugs, and deprecated features that will break in future releases. A skipped patch today becomes a urgent crisis in six months.
Database backups are non-negotiable. A single corruption, malware incident, or accidental delete can destroy months of content. Automated backups run nightly, but they're only valuable if you've tested recovery. A once-per-month restore test takes 2 hours and catches 80% of backup failures before they matter. Skip this, and you'll learn the hard way when recovery fails during an emergency.
Performance degradation creeps up slowly. Your Directus API feels snappy with 10K records. At 1M records, the same queries that took 50ms now take 2 seconds. Database indexes help, but rebuilding indexes is manual and locks tables during the rebuild. A 100GB database reindex can take 30 minutes with users unable to edit content.
Disk space runs out without warning. Directus stores uploaded files (images, PDFs, videos) on disk. A popular app generating 1GB/month of uploads hits 100GB in eight years--sooner if you handle media. When disk fills, Directus can't accept new uploads or backups. Recovery means migrating to larger storage, which takes downtime.
Third-party dependencies break. Directus depends on 300+ npm packages. A major version bump in any one of them can break Directus extensions or custom code. Node.js itself releases major versions with breaking changes every 10 months. Staying current requires testing each upgrade in staging.
Scaling hits a hard ceiling. A single 2GB server handles 10K-50K API requests per day. Beyond that, you need clustering: multiple Directus instances behind a load balancer, all reading from the same PostgreSQL database. Clustering requires:
- A load balancer (EUR 20-50/mo)
- A shared cache (Redis) so sessions stay consistent across instances
- Careful database connection pooling to prevent exhaustion
- Reverse proxy configuration to route requests correctly
Most teams don't plan for clustering until they desperately need it, then face weeks of downtime or costly emergency consulting to set it up.
When Self-Hosting Directus Makes Sense
Self-hosting is right in narrow scenarios. If you're building a prototype or hobby project, you can accept downtime and rough edges. If your team already runs PostgreSQL, Docker, and Kubernetes in-house for other workloads, you've already invested in the skills and infrastructure--Directus becomes a small additional burden.
On-premises requirements (regulatory, security) justify self-hosting. Financial institutions, healthcare, and government sometimes mandate data storage within specific physical geography or data centers. That's real. Most teams in developed economies do not face this constraint.
Self-hosting makes no sense if your team is fewer than five people, has no dedicated DevOps engineer, or views infrastructure as a cost center rather than a competitive advantage. Maintenance will consume one person's entire calendar. Your focus narrows to database tuning instead of product features.
Managed Hosting: The Practical Alternative
Managed Directus hosting handles everything: infrastructure, security, backups, updates, scaling. Opsily's managed Directus hosting services handle the entire operational stack, freeing your team to focus on building your CMS instead of maintaining it. Costs are EUR 30-300/mo depending on storage and data requests, with daily backups, zero-downtime updates, and GDPR compliance baked in. A managed provider deploys your instance in under 5 minutes versus 40+ hours for self-hosted.
Comparison is stark. Self-hosting costs EUR 250 infrastructure + EUR 250 labor = EUR 500/mo. Managed hosting costs EUR 100-150/mo. Managed wins on cost, reliability, and focus. You ship features instead of tuning databases.
Managed services include monitoring, alerting, and incident response 24/7. Your database grows to 500GB? The provider adds storage automatically. A security patch lands? It's deployed overnight with zero downtime. Your team focuses on content and workflows, not keeping systems running.
The choice is simple: buy back your time or spend it on infrastructure you'll never turn into a product.
Frequently Asked Questions
What databases does Directus support?
Directus supports PostgreSQL, MySQL, MariaDB, SQLite, Oracle Database, Microsoft SQL Server, and CockroachDB. PostgreSQL is the official recommendation and most battle-tested. SQLite works for development but fails under concurrent load. Use PostgreSQL for production.
Do I need Docker to self-host Directus?
Docker is the officially supported deployment method. You can run Directus on bare metal with Node.js, but Docker is far easier and portable across servers, cloud providers, and development machines. Treat Docker as a requirement, not optional.
Can I migrate from self-hosted to managed Directus hosting?
Yes. Export your database and uploads, then import them into a managed instance. The process takes minutes if your data is under 10GB. Larger migrations may need direct database replication to avoid downtime. See the database guide for optimization and migration strategies.
How often should I update self-hosted Directus?
Apply security patches immediately (within 24 hours). Minor releases (bug fixes, features) apply weekly or monthly during maintenance windows. Major releases can wait 30-60 days to let the community identify breaking changes. Skipping updates accumulates technical debt and risk.
What happens if my Directus database runs out of disk space?
Directus stops accepting new uploads, backups fail, and API requests may error. You'll need to manually add storage, which typically requires downtime to resize the volume and restart services. Prevent this by monitoring disk usage and alerting when it reaches 70% capacity.
Is Directus free to self-host?
Yes. Directus is open-source and free for organizations under EUR 5M annual revenue with fewer than 50 employees. Larger organizations should purchase a commercial license. Hosting costs (server, database, backups) are separate.
What DevOps skills do I need to self-host Directus successfully?
You need Docker fundamentals, Linux command-line basics, PostgreSQL configuration, SSL certificate management, and log analysis. If any of those sound unfamiliar, self-hosting will be painful. Plan 40+ hours of learning before you're comfortable.
The Bottom Line
Self-hosting Directus is technically possible but operationally expensive. Infrastructure costs EUR 200-300/mo, but labor costs EUR 250-400/mo in reality. Most teams discover that managed hosting at EUR 100-150/mo saves money, eliminates downtime risk, and frees your engineering team to ship features instead of maintaining databases. Self-host only if you have dedicated DevOps expertise and regulatory requirements that demand it.
Explore managed Directus hosting services to skip the operational burden and launch in minutes instead of weeks.
For advanced deployments, learn how Directus runs on enterprise infrastructure for scaling and reliability.