---
title: "First deployment with while: your app over HTTPS, via MCP"
url: https://while.sh/en/docs/get-started/first-deployment/
updated: 2026-11-03
---

# Your first deployment

Your agent handles the deployment from start to finish. It connects while, writes while.yaml, sends your code, and gives you your app's address.

## Prerequisites

- An app in Node.js, Python or Go, or with its Dockerfile.
- An AI agent: Claude Code, Codex, Cursor or Gemini CLI in a terminal, or a conversation with Claude, ChatGPT or Mistral Vibe.

## Step 1: Give your agent these instructions

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

```text titre="Instructions"
Read while.sh/agents, then deploy my app with while.
```

Without an account, your agent deploys your app [as a trial](/en/docs/get-started/try-without-an-account/). With your account, it connects while's MCP server, `https://app.while.sh/mcp`. On the first call, a page opens in your browser: there you authorize while, and you choose the app your agent works on.

## Step 2: Your agent prepares the deployment

Your agent reads while's catalog: what your app must follow, and the building blocks it can declare. It then writes while.yaml at the root of your app:

```yaml titre="while.yaml"
apiVersion: while/v1
project: mon-appli
services:
  - name: web
    port: 3000
    health: { path: /health }
```

Your app listens on the port given by the `PORT` variable, and answers on its health path as soon as it can serve. The other rules are in [What your app must follow](/en/docs/get-started/the-while-contract/).

## Step 3: Your agent sends the code

With a terminal, your agent sends the archive of your sources with a curl command, or pushes to the project's git repository at while. In a conversation, it writes the files with while's tools.

while then builds your app's image and runs your tests. The new version gets its first visitors once it answers on its health path.

## Step 4: Open your app

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

## When something breaks

A failing test stops the deployment, and your agent reads the error. A version that doesn't answer on its health path never gets traffic, and the previous one stays live. Your agent reads the logs, fixes the problem and deploys again.

## Next steps

- [Add a PostgreSQL database](/en/docs/building-blocks/postgres/)
- [Limit the app to your colleagues](/en/docs/building-blocks/internal-access/)
- [Put the app on your domain](/en/docs/building-blocks/custom-domains/)
