Skip to content

Self-host Directus in France, with its PostgreSQL database, with your AI (2026)

A back office and an API for your content, with no server to maintain. Connected to while over MCP, your AI deploys Directus in France, with its content in a PostgreSQL database backed up every day.

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

View as Markdown

Self-host Directus in France, with its PostgreSQL database, with your AI: Directus hosting in France, self-hosted with no server to manage, put in production by Claude Code, Cursor or Codex

The short version. Over MCP, your AI deploys Directus with while, in France, with your content in a PostgreSQL database backed up every day. What matters, like deleting a database, waits for a person’s approval.

Prerequisites

  • A new Directus instance, or your exported schema.
  • Your AI: Claude Code, Codex, Cursor or Gemini CLI.

Step 1: Ask your AI for Directus

You, to your AI: Connect to while with my account (while.sh/agents), then deploy Directus with its PostgreSQL database.

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 back office

Your AI gives you your Directus address, for example https://directus.while.cloud, with the admin account’s email address and password. Sign in, change that password, then create your collections.

What your AI does

Directus reads its database from DB_CONNECTION_STRING1, and while provides it in DATABASE_URL. So your AI writes a Dockerfile, on the official Directus image, that copies one into the other at startup:

Dockerfile
FROM directus/directus:11
ENV PORT=8080 HOST=0.0.0.0
CMD ["sh", "-c", "export DB_CONNECTION_STRING=\"$DATABASE_URL\"; node cli.js bootstrap && pm2-runtime start ecosystem.config.cjs"]

Then while.yaml:

while.yaml
apiVersion: while/v1
project: directus
services:
  - name: web
    port: 8080
    health: { path: /server/health }
databases:
  - name: main

At startup, node cli.js bootstrap creates the Directus tables and the admin account, then Directus answers on /server/health. Your AI sets Directus’s KEY and SECRET keys and the admin password in while as secrets3, and sets ADMIN_EMAIL, DB_CLIENT: pg and TELEMETRY: false in plain text.

Self-host Directus in France with no server to manage: the open-source tool and its PostgreSQL database backed up every day, served over HTTPS on while, put in production by your AI
The open-source tool and its PostgreSQL database, backed up every day, in France, with no server to look after.

Move to your own domain

You, to your AI: Put Directus on cms.acme.com.

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

Upgrade to the latest version of Directus

You, to your AI: Upgrade Directus to the latest version.

Your AI deploys the latest Directus image. If the new version disappoints, it rolls back to the previous one.

Put Directus back the way it was yesterday

You, to your AI: Restore Directus’s database to yesterday at 6 pm.

Your AI prepares the restore, and you approve it: a safety backup is taken first, then the database goes back to the requested moment.

Read your content from your AI

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

Your AI reads the Directus database in SQL over MCP, with your permissions, and it can’t write to it.

In the docs: PostgreSQL databases and Variables and secrets.

Next steps

Sources

  1. Directus, database configuration, accessed November 2, 2026
  2. Directus, file storage, accessed November 2, 2026
  3. Directus, security (SECRET), accessed November 2, 2026

Questions

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 do my images and files go?

Directus keeps them on its disk2, which starts from scratch on every deployment: keep your media elsewhere, or import them again after an update.

Can my site read the Directus API?

Yes, Directus stays public, and its own sign-in protects the back office.

Where is my Directus 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.

Give your AI the message, and it takes care of the rest

Give this to your AI

Read while.sh/agents and help me get started with while.

Copy the message

In 3 minutes, with no sign-up, the tool has its own address. To keep it, create your account.

For a company project, write to the while team: hello@while.sh