Deployment Overview
Mastra offers multiple deployment options to suit your application’s needs, from fully-managed solutions to self-hosted options. This guide will help you understand the available deployment paths and choose the right one for your project.
Deployment Options
Mastra Cloud
Mastra Cloud is a deployment platform that connects to your GitHub repository, automatically deploys on code changes, and provides monitoring tools. It includes:
- GitHub repository integration
- Deployment on git push
- Agent testing interface
- Comprehensive logs and traces
- Custom domains for each project
View Mastra Cloud documentation →
With a Server
You can deploy Mastra as a standard Node.js HTTP server, which gives you full control over your infrastructure and deployment environment.
- Custom API routes and middleware
- Configurable CORS and authentication
- Deploy to VMs, containers, or PaaS platforms
- Ideal for integrating with existing Node.js applications
Serverless Platforms
Mastra provides platform-specific deployers for popular serverless platforms, enabling you to deploy your application with minimal configuration.
- Deploy to Cloudflare Workers, Vercel, or Netlify
- Platform-specific optimizations
- Simplified deployment process
- Automatic scaling through the platform
Client Configuration
Once your Mastra application is deployed, you’ll need to configure your client to communicate with it. The Mastra Client SDK provides a simple and type-safe interface for interacting with your Mastra server.
- Type-safe API interactions
- Authentication and request handling
- Retries and error handling
- Support for streaming responses
Choosing a Deployment Option
Option | Best For | Key Benefits |
---|---|---|
Mastra Cloud | Teams wanting to ship quickly without infrastructure concerns | Fully-managed, automatic scaling, built-in observability |
Server Deployment | Teams needing maximum control and customization | Full control, custom middleware, integrate with existing apps |
Serverless Platforms | Teams already using Vercel, Netlify, or Cloudflare | Platform integration, simplified deployment, automatic scaling |