# NetlifyDeployer
[EN] Source: https://mastra.ai/docs/deployment/cloud-providers/netlify-deployer

The `NetlifyDeployer` class handles deployment of standalone Mastra applications to Netlify. It manages configuration, deployment, and extends the base [Deployer](/reference/deployer/) class with Netlify specific functionality.

## Installation

```bash copy
npm install @mastra/deployer-netlify@latest
```

## Usage example

```typescript title="src/mastra/index.ts" showLineNumbers copy
import { Mastra } from "@mastra/core/mastra";
import { NetlifyDeployer } from "@mastra/deployer-netlify";

export const mastra = new Mastra({
  // ...
  deployer: new NetlifyDeployer(),
});
```

> See the [NetlifyDeployer](/reference/deployer/netlify) API reference for all available configuration options.

## Continuous integration

After connecting your Mastra project’s Git repository to Netlify, update the project settings. In the Netlify dashboard, go to **Project configuration** > **Build & deploy** > **Continuous deployment**, and under **Build settings**, set the following:

- **Build command**: `npm run build` (optional)

### Environment variables

Before your first deployment, make sure to add any environment variables used by your application. For example, if you're using OpenAI as the LLM, you'll need to set `OPENAI_API_KEY` in your Netlify project settings.

> See [Environment variables overview](https://docs.netlify.com/environment-variables/overview/) for more details.

Your project is now configured with automatic deployments which occur whenever you push to the configured branch of your GitHub repository.

## Manual deployment

Manual deployments are also possible using the [Netlify CLI](https://docs.netlify.com/cli/get-started/). With the Netlify CLI installed run the following from your project root to deploy your application.

```bash copy
netlify deploy --prod
```

> You can also run `netlify dev` from your project root to test your Mastra application locally.

## Build output

The build output for Mastra applications using the `NetlifyDeployer` includes all agents, tools, and workflows in your project, along with Mastra specific files required to run your application on Netlify.

```
.netlify/
└── v1/
    ├── functions/
    │   └── api/
    │       └── index.mjs
    └── config.json
package.json
```

The `NetlifyDeployer` automatically generates a `config.json` configuration file in `.netlify/v1` with the following settings:

```json
{
  "redirects": [
    {
      "force": true,
      "from": "/*",
      "to": "/.netlify/functions/api/:splat",
      "status": 200
    }
  ]
}
```

## Next steps

- [Mastra Client SDK](/reference/client-js/mastra-client)


---
title: "VercelDeployer | Deployment"
description: "Learn how to deploy a Mastra application to Vercel using the Mastra VercelDeployer"
---