---
title: "Self-host Strapi on Edge | Open-source headless CMS"
description: "Run Strapi on a real VM with Postgres, S3-compatible media uploads and a global CDN for API responses and images. Zero egress fees on the way to your front end."
url: https://edge.network/solutions/strapi
---

For Strapi

# The headless Strapi stack, self-hosted

Strapi and Postgres on a real VM, the media library in S3-compatible storage and public API responses cached in 988 locations. No egress fees between your content and your front end.

[Deploy a VM](/console/access/new?product=compute)[Read the deploy guide](/docs/compute/getting-started)

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

A real Node host, a media bucket and a global delivery network. Three things every Strapi deployment ends up needing.

-   ### 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

Strapi is the API origin. Your front end and your editors reach it through the CDN, and media is served from the bucket.

-   [Compute](/compute)
    
    Runs Strapi (Node.js) and Postgres on one VM.
    
-   [Storage](/storage)
    
    Backs the media library through the S3 upload provider.
    
-   [CDN](/cdn)
    
    Caches public REST and GraphQL responses and every uploaded file.
    
-   [Image optimisation](/docs/cdn/image-optimization)
    
    Optional: replace Strapi's image processing with edge transforms.
    
-   [DNS](/dns)
    
    Anycast DNS for cms., media. and your app's domain.
    
-   [Shield](/shield)
    
    Scores submissions hitting public Strapi endpoints.
    
-   [Assist](/assist)
    
    AI answers on whichever front end your Strapi content powers.
    

Deploy

## Strapi with its uploads off the VM from day one

Standard Strapi 5 throughout. The Edge parts are one VM, one bucket and one CDN deployment.

1.  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
    ```
    
2.  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.ts
    
    ```
    export 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' },
            },
          },
        },
      },
    });
    ```
    
3.  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
    ```
    
4.  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/*
    ```
    
5.  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.tsx
    
    ```
    const 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](/solutions/agentic-development) or [have our engineers do it](/solutions/expert-services).

What it costs

## A headless CMS for the price of a VM

The API, the database and the media library on one VM and one bucket, with the CDN absorbing the reads.

-   No per-seat, per-entry or per-API-call fees
-   Media delivery at $0 egress
-   Your database, with full root access

[See compute pricing](/compute/pricing)

Estimated monthly bill on Edge

API for a Next.js site, ~4.5M API and media requests/mo, 65 GB of media

USD

-   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

Total$21.14

FAQ

## Databases, caching and Strapi Cloud

Something else? [Ask an engineer](/contact).

Which database should I use?

Postgres is the usual production choice, and it runs happily on the same VM. Strapi also supports MySQL, MariaDB and SQLite, so keep whichever one you already operate.

Can the CDN cache my Strapi API?

Yes, for public GET requests. Set a short cache TTL on the API domain and purge /api/\* from a webhook when editors publish. Authenticated and write requests always reach the VM.

Do I still need Strapi's responsive image formats?

No. Turn off responsive-friendly uploads in the Media Library settings and store only originals. The CDN resizes and converts to AVIF or WebP from the URL and caches each variant.

Self-hosted or Strapi Cloud?

Strapi Cloud is Strapi's own managed service. Self-hosting on Edge gives you root, your own database and a flat VM bill, in exchange for running the server yourself.

Can an AI agent deploy it for me?

Yes. Give your coding agent an Edge access code and ask for Strapi on a domain. The agent API provisions the VM, DNS, CDN and SSL, and reports the cost.

Drop-in services

## A lifecycle hook and a script tag

-   [
    
    Edge ShieldBot protection`POST /siteverify → score: 94`
    
    Score 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
    
    ](/shield)
-   [
    
    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
    
    ](/assist)

Related stacks

## Headless peers, and the front ends that read it

[All 38 stacks](/solutions/stacks)

-   [DirectusInstant API over any SQL database](/solutions/directus)
-   [PayloadTypeScript-first headless CMS, Next.js-ready](/solutions/payload)
-   [Next.jsSelf-host Next.js without the lock-in](/solutions/nextjs)
-   [NuxtVue-powered SSR on global VMs](/solutions/nuxt)

## Put Strapi behind the CDN

Start free. Bring an existing Strapi project or scaffold a fresh one.

[Deploy a VM](/console/access/new?product=compute)[Talk to an engineer](/contact)

Billed hourly from a prepaid balance. Egress is free on every product.
