For Directus
Directus on Edge: any database, instant API
Free to sign up. No egress fees on any product.
Why Directus on Edge
Real database, real storage, real network
Bring your own SQL database
Postgres, MySQL, MariaDB, SQLite or MS SQL. Directus mirrors the schema and exposes a REST and GraphQL API.An S3-compatible file library
Set the STORAGE_* variables and uploads, thumbnails and exports land in an Edge Storage bucket.Transforms at the edge
Directus has its own asset transforms. For busy sites, hand the work to the CDN and cache every variant.Flows without time-outs
Automation flows and webhooks run on a real VM. No serverless execution limits to work around.A global CDN for the API
Cache GETs in 988 locations and mutate at the origin, with no egress on the way out.Agent-deployable
The Edge agent API can stand up Directus, point a domain at it and create the file bucket from one prompt.
Reference architecture
How Directus maps to Edge
Sites and apps
@directus/sdk over REST
Editors
Data Studio in the browser
cms.acme.io
caches public GETs + assets
directus :8055
Node 22 · s-2vcpu-4gb
postgres :5432
own VM · 10.0.0.3
directus-files
STORAGE_EDGE_* location
- Compute
Runs Directus (Node.js) and a separate Postgres VM.
- Storage
The s3 storage location for the file library.
- CDN
Caches public API responses and asset URLs worldwide.
- Image optimisation
Optional: replace Directus asset transforms with edge processing.
- DNS
Anycast DNS for the API subdomain.
- Shield
Checks public form endpoints with a humanity score before they write.
- Assist
AI answers on the sites your Directus data powers.
Deploy
Directus on Edge in five steps
- 01
Create the database and app VMs
The postgresql script installs PostgreSQL 16 with remote access. A security group keeps port 5432 on the private range.
shell$ edge compute create --name directus-db --size s-2vcpu-4gb \ --image ubuntu-24 --region london --script postgresql \ --script-param db_name=directus $ edge compute groups create --name pg-private $ edge compute groups add-rule grp-abc123 --port 5432 \ --protocol tcp --source 10.0.0.0/8 $ edge compute create --name directus --size s-2vcpu-4gb \ --image ubuntu-24 --region london --script nodejs $ edge storage create directus-files - 02
Configure the database and storage
Directus reads everything from the environment. The s3 driver takes a custom endpoint and path-style addressing.
.envPUBLIC_URL="https://cms.acme.io" SECRET="..." DB_CLIENT="pg" DB_HOST="10.0.0.3" DB_PORT="5432" DB_DATABASE="directus" DB_USER="postgres" DB_PASSWORD="..." STORAGE_LOCATIONS="edge" STORAGE_EDGE_DRIVER="s3" STORAGE_EDGE_KEY="..." STORAGE_EDGE_SECRET="..." STORAGE_EDGE_BUCKET="directus-files" STORAGE_EDGE_REGION="us-east-1" STORAGE_EDGE_ENDPOINT="https://storage.edge.network" STORAGE_EDGE_FORCE_PATH_STYLE="true" - 03
Install and run it as a service
bootstrap migrates the database and creates the first admin. systemd keeps it running and restarts it after upgrades.
shell$ cd /srv/directus && npm install directus $ npx directus bootstrap $ sudo tee /etc/systemd/system/directus.service <<'EOF' [Service] WorkingDirectory=/srv/directus ExecStart=/usr/bin/npx directus start Restart=always [Install] WantedBy=multi-user.target EOF $ sudo systemctl enable --now directus - 04
Put the CDN in front
Cache public reads with a short TTL. Writes and authenticated requests pass through to the VM.
shell$ edge cdn create --name acme-cms $ edge cdn domains add cdn-a1b2c3 --domain cms.acme.io \ --origin https://<vm-ip> --cache-ttl 60 - 05
Query it from your front end
Directus's own asset transforms use width, quality and format too, so the URLs read the same either way.
lib/directus.tsimport { createDirectus, rest, readItems } from '@directus/sdk' const directus = createDirectus('https://cms.acme.io').with(rest()) export const articles = await directus.request( readItems('articles', { fields: ['id', 'title', 'cover'] }), ) // <img src={`https://cms.acme.io/assets/${a.cover}?width=800`} />
Prefer to hand it off? Give the job to your AI agent or have our engineers do it.
What it costs
An instant API with a fixed monthly cost
- Free bandwidth between VMs on a private network
- File delivery at $0 egress
- Root on both VMs, full database access
- Hourly billing with optional hard caps
Estimated monthly bill on Edge
Directus + Postgres on separate VMs · ~3.5M requests/mo · 105 GB of files
- Compute · app$19.24Standard VM · 2 vCPU · 4 GiB · Directus
- Compute · database$19.24Standard VM · 2 vCPU · 4 GiB · PostgreSQL 16
- CDN$0.753.5M requests: 500k free, then 3M × $0.25 per million
- Storage$1.50105 GB of files: 5 GB free, then 100 GB × $0.015
- DNS$0.00API subdomain
- Egress$0.00
FAQ
Directus on Edge, answered
Self-hosted or Directus Cloud?
Can I point Directus at an existing database?
Where do flows and webhooks run?
How do I deploy custom extensions?
Drop-in services
Add these without touching the stack
- Edge ShieldBot protection
POST /siteverify → score: 94Guard public form endpoints with a humanity-score check before anything is written to the database.
Free for most sites. No puzzles, no widget to style.Explore - Edge AssistAI answers
<script src="…/assist.js">Whatever site your Directus data powers, Assist answers visitors from it.
Free tier: 250 answered questions a monthExplore
Ship Directus on Edge
Start free. Bring an existing database or scaffold a fresh project.
Free tiers hard-cap. Nothing bills until you add a card.