Skip to content

For Directus

Directus on Edge: any database, instant API

Wrap a SQL database in a polished admin app and a REST and GraphQL API. Run it on a real VM, keep files in S3-compatible storage and serve assets from 988 locations.

Free to sign up. No egress fees on any product.

Why Directus on Edge

Real database, real storage, real network

Everything Directus needs to run in production, without paying SaaS multiples for any of it.
  • 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

Directus on one VM, Postgres on another over a private network, files in object storage and the CDN out front.
  • 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

Two VMs on a private network, one bucket and the CDN. Attach both VMs to the same private network from the Networking tab.
  1. 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
  2. 02

    Configure the database and storage

    Directus reads everything from the environment. The s3 driver takes a custom endpoint and path-style addressing.

    .env
    PUBLIC_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"
  3. 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
  4. 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
  5. 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.ts
    import { 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

An app VM, a database VM, a CDN deployment and a bucket. No per-seat, per-item or per-request pricing on the Directus side.
  • 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
See compute pricing

Estimated monthly bill on Edge

Directus + Postgres on separate VMs · ~3.5M requests/mo · 105 GB of files

USD
  • 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
Total$40.73

FAQ

Directus on Edge, answered

Something else? Ask an engineer.
Self-hosted or Directus Cloud?
Directus Cloud is the official managed service. Self-hosting on Edge gives you root, custom extensions and full control of your database, in exchange for running a VM yourself.
Can I point Directus at an existing database?
Yes, and it's arguably the best feature. Directus introspects your existing schema and puts an admin app and an API on top, without forcing a migration.
Where do flows and webhooks run?
On the Directus VM for everyday volumes. For heavy automation, run a second Directus instance as a worker on the same private network, connected to the same database.
How do I deploy custom extensions?
Ship the extensions folder with git and restart the systemd service. If you prefer containers, build a Docker image and follow the Docker stack pattern instead.

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.