Available deployers
Mastra supports deployment to the following platforms:Vercel
Deploy to Vercel with zero-config serverless functions
Cloudflare Workers
Deploy to Cloudflare’s edge network for global performance
Netlify
Deploy to Netlify Functions with automatic configuration
How deployers work
Mastra deployers extend the baseDeployer class from @mastra/deployer and provide platform-specific functionality:
- Bundling - Creates optimized bundles for the target platform
- Configuration - Generates platform-specific config files
- Environment handling - Manages environment variables
- Dependency management - Installs and optimizes dependencies
- Deployment output - Structures files for deployment
Basic usage
All deployers follow a similar pattern:Storage compatibility
Different platforms have different runtime constraints. Here’s a compatibility matrix for storage options:| Storage | Vercel | Cloudflare | Netlify |
|---|---|---|---|
@mastra/pg (PostgreSQL) | ✅ | ✅ | ✅ |
@mastra/libsql | ❌ | ❌ | ❌ |
@mastra/cloudflare-d1 | ❌ | ✅ | ❌ |
@mastra/mongodb | ✅ | ✅ | ✅ |
@mastra/dynamodb | ✅ | ✅ | ✅ |
Environment variables
All deployers automatically handle environment variables:- Reads from
.envfiles in your project - Merges with user-provided configuration
- Platform-specific env var UI (Vercel, Cloudflare, Netlify dashboards)
Build output
Each deployer creates a platform-specific build directory:- Vercel:
.vercel/output/functions/ - Cloudflare: Creates
wrangler.jsoncin project root - Netlify:
.netlify/v1/functions/
The build artifacts are automatically generated when you run your deployment command. You don’t need to commit these directories to version control.
Next steps
Choose your deployment platform and follow the step-by-step guide:Deploy to Vercel
Step-by-step Vercel deployment
Deploy to Cloudflare
Step-by-step Cloudflare deployment
Deploy to Netlify
Step-by-step Netlify deployment