Skip to content

Deploy Strapi and its PostgreSQL database from your AI agent, over MCP

Your Strapi runs locally. Connected to while over MCP, your AI agent deploys it in France without a Dockerfile, with its PostgreSQL database backed up every day and your media kept safe in a bucket.

By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 2, 2026.

View as Markdown

Prerequisites

  • A Strapi project, with its package.json.
  • An AI agent that works in a terminal: Claude Code, Codex, Cursor or Gemini CLI.

Step 1: Give your agent these instructions

Open your agent in your app’s folder, and paste these instructions into it:

Instructions
Connect to while with my account (while.sh/agents), then deploy my app.

Your agent adds while’s MCP server itself. If it asks you to, restart it. On the first call to while, a page opens in your browser. In Claude Code, if it doesn’t open, type /mcp, choose while, then Authenticate. On that page, choose “A new app”, then click Authorize.

Step 2: Open your app

Your agent gives you your app’s address, for example https://mon-cms.while.cloud, over HTTPS.

What your agent does

It writes while.yaml at the root of your project:

while.yaml
apiVersion: while/v1
project: mon-cms
services:
  - name: web
    port: 1337
    health:
      path: /_health
    resources:
      memory: 1Gi
    env:
      DATABASE_CLIENT: postgres
databases:
  - name: main
buckets:
  - name: medias

Strapi is detected as a Node.js app: it is built with npm run build, then started with npm start. It reads its database from DATABASE_URL, with DATABASE_CLIENT=postgres and the pg package, which your agent adds1. Your media files go into the bucket, through Strapi’s S3 provider2. Your agent generates Strapi’s keys, APP_KEYS, ADMIN_JWT_SECRET and the others, and stores them in while’s vault3.

Move to your own domain

You, to your agent: Put the app on cms.acme.com.

Your agent declares the domain, you add the DNS records it gives you, and the HTTPS certificate follows.

See a new version before you deploy it

You, to your agent: Show me the new version before you deploy it.

Your agent opens a preview, at its own address, with its own data. You look at it, and then your agent puts it into production.

Read your content from your agent

You, to your agent: How many articles were published this month?

Your agent reads Strapi’s database in SQL over MCP, with your permissions, and it can’t write to it.

Fix a vulnerability in your dependencies

You, to your agent: Fix the vulnerabilities in our dependencies.

Your app’s dependencies are checked against known vulnerabilities at every deployment, then every day. Your agent is warned of a serious vulnerability, and it updates the package involved.

Go back to the previous version

You, to your agent: Go back to the previous version.

In the 30 minutes after a deployment, the previous version comes back in a second. After that, it takes a few seconds. Once the previous version is back, your agent reads what broke in while’s logs, fixes it and deploys again.

In the docs: PostgreSQL databases, Object storage (S3), Custom domain, Previews, Versions and rollback and Dependency vulnerabilities.

Next steps

Sources

  1. Strapi, database configuration, accessed November 2, 2026
  2. Strapi, the Amazon S3 provider for media, accessed November 2, 2026
  3. Strapi, environment variables, accessed November 2, 2026

Questions

Do I need to write a Dockerfile?

No. Strapi is a Node.js app: it is detected, built with npm run build, then started with npm start.

Where do my images and files go?

Into an S3-compatible bucket in while, separate from the app. On the disk, they would start from scratch at every restart.

Is my content backed up?

Yes, it lives in the PostgreSQL database, which is backed up every day and can go back to a precise moment.

Where is my Strapi hosted?

In France, by Nextmap, a French company.

Connect your agent, it takes care of the rest

To paste into your agent

Read while.sh/agents, then deploy my app with while.

Copy the instructions

No account needed to try: your app is live right away. To keep it, sign in.

A project for your company? Talk to the team: hello@while.sh