For Strapi
The headless Strapi stack, self-hosted
The setup on this page costs $21.14 a month, with no egress line.
Why Strapi on Edge
Everything a production Strapi needs, in one place
Node and your database
Strapi runs on a small VM with Postgres, MySQL, MariaDB or SQLite. Pick the database you already operate.The official S3 upload provider
@strapi/provider-upload-aws-s3 takes a custom endpoint, so the media library lands in an Edge Storage bucket.Image transforms at the edge
Turn off Strapi's responsive formats and let the CDN produce every size from one original, on request.A global CDN for the API
Cache public REST and GraphQL responses in 988 locations. Authenticated requests go to the VM.Made for your front end
Feed Next.js, Nuxt, SvelteKit, Astro or a mobile app. Host the front end on its own VM or straight from a bucket.Strapi, provisioned by your agent
Ask the Edge agent API for a Strapi instance on a domain. It provisions the VM, DNS, CDN and SSL.
Reference architecture
Strapi as the API origin, media from the bucket
Next.js front end
fetches /api/* at build and runtime
Editors
admin panel at /admin
cms.acme.dev
caches public GET /api/*
strapi :1337
Node 22, PM2, s-2vcpu-4gb
postgres :5432
PostgreSQL on the same VM
acme-media
provider-upload-aws-s3
media.acme.dev
uploads, resized at the edge
- Compute
Runs Strapi (Node.js) and Postgres on one VM.
- Storage
Backs the media library through the S3 upload provider.
- CDN
Caches public REST and GraphQL responses and every uploaded file.
- Image optimisation
Optional: replace Strapi's image processing with edge transforms.
- DNS
Anycast DNS for cms., media. and your app's domain.
- Shield
Scores submissions hitting public Strapi endpoints.
- Assist
AI answers on whichever front end your Strapi content powers.
Deploy
Strapi with its uploads off the VM from day one
- 01
Create the VM, bucket and database
The nodejs script installs Node 22, PM2 and an Nginx reverse proxy. Add Postgres on the same box.
shell$ edge compute create --name cms --size s-2vcpu-4gb \ --image ubuntu-24 --region london --script nodejs $ edge storage create acme-media $ edge compute ssh vm-4c8e21 $ apt install -y postgresql $ sudo -u postgres createuser --pwprompt strapi $ sudo -u postgres createdb --owner strapi strapi - 02
Send uploads to Edge Storage
Install @strapi/provider-upload-aws-s3, then add media.acme.dev to img-src and media-src in config/middlewares.ts so the admin can preview uploads.
config/plugins.tsexport default ({ env }) => ({ upload: { config: { provider: 'aws-s3', providerOptions: { baseUrl: 'https://media.acme.dev', s3Options: { credentials: { accessKeyId: env('EDGE_KEY'), secretAccessKey: env('EDGE_SECRET'), }, endpoint: 'https://storage.edge.network', region: 'us-east-1', forcePathStyle: true, params: { Bucket: 'acme-media' }, }, }, }, }, }); - 03
Build and start Strapi
Set DATABASE_CLIENT=postgres and the connection details in .env, then run it under PM2 and proxy Nginx to port 1337.
shell$ npm ci $ NODE_ENV=production npm run build $ NODE_ENV=production pm2 start npm --name strapi -- run start $ pm2 save - 04
Cache the API and serve media
Short TTLs keep content fresh. Purge the API path from a Strapi webhook after publishing if you want it instant.
shell$ edge cdn create --name acme-cms $ edge cdn domains add cdn-a1b2c3 --domain cms.acme.dev \ --origin https://<vm-ip> --cache-ttl 60 $ edge cdn domains add cdn-a1b2c3 \ --domain media.acme.dev --jit-image \ --origin-type storage --storage-bucket acme-media $ edge cdn purge cdn-a1b2c3 --path /api/* - 05
Fetch from your front end
Strapi 5 returns flat documents. Ask the CDN for the exact image size each layout needs.
app/blog/page.tsxconst res = await fetch( 'https://cms.acme.dev/api/posts?populate=cover', { next: { revalidate: 60 } }, ) const { data: posts } = await res.json() // <img src={`${post.cover.url}?width=1200&format=auto`} />
Prefer to hand it off? Give the job to your AI agent or have our engineers do it.
What it costs
A headless CMS for the price of a VM
- No per-seat, per-entry or per-API-call fees
- Media delivery at $0 egress
- Your database, with full root access
Estimated monthly bill on Edge
API for a Next.js site, ~4.5M API and media requests/mo, 65 GB of media
- Compute$19.24Standard VM, 2 vCPU, 4 GiB, Strapi + Postgres
- CDN$1.004.5M requests: 500k free, then 4M × $0.25 per million
- Storage$0.9065 GB of media: 5 GB free, then 60 GB × $0.015
- DNS$0.00cms., media. and app records
- Egress$0.00
FAQ
Databases, caching and Strapi Cloud
Which database should I use?
Can the CDN cache my Strapi API?
Do I still need Strapi's responsive image formats?
Self-hosted or Strapi Cloud?
Can an AI agent deploy it for me?
Drop-in services
A lifecycle hook and a script tag
- Edge ShieldBot protection
POST /siteverify → score: 94Score submissions to public Strapi endpoints from a middleware or lifecycle hook. One server-side call, no CAPTCHA.
Free forever, with unlimited widgets. No puzzles for visitors.Explore - Edge AssistAI answers
<script src="…/assist.js">Add answers to whichever front end your Strapi content powers, grounded in the published pages.
Free tier: 250 answered questions a monthExplore
Put Strapi behind the CDN
Start free. Bring an existing Strapi project or scaffold a fresh one.
Billed hourly from a prepaid balance. Egress is free on every product.