# Your first deploy

Deploy a Next.js app from the dashboard or through your AI agent, then open its public URL to check the result. Choose **UI** or **MCP** on any step; the choice applies to the whole page.

> **NOTE**
> A Lessly workspace is required. If you skipped it, [sign up at lessly.com](https://app.lessly.com/signup) and come back.

## Prerequisites

- A Next.js app in a git repo. Any GitHub repo works; a fresh `create-next-app` is fine.
- For the agent path: the Lessly MCP installed in your agent — see [Install](/get-started/install) — and your agent open and connected to your Lessly workspace.

## Step 1 — Connect your repo

### UI

In `app.lessly.com`, create a new app and connect the GitHub repo you want to deploy.

### MCP

Open your repo in your agent. In Claude Code, that means `cd` into the project and start a session. In Claude Desktop or Cursor, open the project folder.

## Step 2 — Deploy

### UI

Choose the branch to ship (`main`) and click **Deploy**. Lessly detects Next.js, picks the build command, and streams the build log as it runs.

### MCP

Paste this into your agent:

```text
Deploy my main branch to production.
```

The agent calls `deployment_service_create` — it reads your repo, detects Next.js, picks the right build command, and starts the deploy, streaming status as the build runs. The agent needs a token with deploy access to the app.

## Step 3 — Verify the site is live

### UI

When the build finishes, the app's page shows the live production URL. Open it in your browser — your app is live.

### MCP

When the agent reports success, ask:

```text
What's the URL of my latest deployment?
```

The agent checks the deployment with `deployment_deployment_get` and looks up the service's public URL. Open that URL in your browser and check that the app loads.

## What you just did

You deployed your app to production and opened its public URL to check that it works.

## What to do next

- *"Promote this deploy to the apex domain."*
- *"Set the `DATABASE_URL` environment variable on production."*
- *"Show me the build logs for the last failed deploy."*
