---
title: "Deploy Strapi with your AI in 2026: PostgreSQL and S3 media"
url: https://while.sh/en/guides/deploy-strapi/
author: "Aloïs Oddon, co-founder of Nextmap"
updated: 2026-11-19
---

# Deploy Strapi and its PostgreSQL database with your AI, over MCP (2026)

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

> **The short version.** Over MCP, your AI deploys your Strapi with while, in France, with its PostgreSQL database backed up every day and its media in an S3 bucket. What matters, like deleting a database, waits for a person's approval.

## Prerequisites

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

## Step 1: Give your AI this message

Open your AI in your app's folder, and paste this message into it:

```text titre="The message to give your AI"
Connect to while with my account (while.sh/agents), then put my app on while.
```

Your AI 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 AI gives you your app's address, for example `https://mon-cms.while.cloud`, over HTTPS.

## What your AI does

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

```yaml titre="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 AI adds (source 1). Your media files go into the bucket, through Strapi's S3 provider (source 2). Your AI generates Strapi's keys, `APP_KEYS`, `ADMIN_JWT_SECRET` and the others, and stores them in while's vault (source 3).


<figure class="illus"><img src="/illustrations/guide-cadre-production-1200.webp" srcset="/illustrations/guide-cadre-production-768.webp 768w, /illustrations/guide-cadre-production-1200.webp 1200w" sizes="(min-width: 48rem) 46rem, 100vw" width="1536" height="1024" loading="lazy" decoding="async" alt="What your AI does to put Strapi and its PostgreSQL database in production on while: the while.yaml file, the build and tests, the HTTPS address, the PostgreSQL database backed up every day and a person's approval, in France" /><figcaption>Your AI writes while.yaml, while builds and serves the app over HTTPS, and the previous version stays ready.</figcaption></figure>

## Move to your own domain

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

Your AI 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 AI: Show me the new version before you deploy it.

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

## Read your content from your AI

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

Your AI 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 AI: Fix the vulnerabilities in our dependencies.

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

## Go back to the previous version

> You, to your AI: Go back to the previous version.

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

## Next steps

- [Store your app's files](/en/guides/store-files-s3/)
- [Deploy a Node.js API and its PostgreSQL database](/en/guides/deploy-node-api-postgresql/)
- [Deploy a static site](/en/guides/deploy-static-site/)

## Sources

1. [Strapi, database configuration](https://docs.strapi.io/cms/configurations/database), 2026-11-02
2. [Strapi, the Amazon S3 provider for media](https://docs.strapi.io/cms/configurations/media-library-providers/amazon-s3), 2026-11-02
3. [Strapi, environment variables](https://docs.strapi.io/cms/configurations/environment), 2026-11-02

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

### Does my AI see my credentials?

No. You paste them into while, the app uses them, and your AI never sees them. Every call is logged.
