Deployment
Deploy your Mastra application to production and expose your agents, tools, and workflows as REST API endpoints.
Mastra Cloud is currently in beta, but many teams are already using it to deploy their agents. It's the easiest way to run Mastra agents in a managed environment.
Enable deploymentsDirect link to Enable deployments
After setting up your project, click Deployment in the sidebar and select Enable Deployments.
Once enabled, your project automatically builds and deploys. Future pushes to your main branch trigger automatic redeployments.
DashboardDirect link to Dashboard
The Overview page shows your project's domain URL, status, latest deployment, and connected agents and workflows.

Click the Deployments menu item to view build logs. Open Settings to configure environment variables, branch, storage, and endpoint URLs.
Changes to settings require a new deployment to take effect
Storage configurationDirect link to Storage configuration
Mastra Cloud offers two storage options:
- Mastra Cloud Store: Managed storage provided by Mastra Cloud
- Bring your own database: Connect to your own external database
Using Mastra Cloud StoreDirect link to Using Mastra Cloud Store
When using the managed Mastra Cloud Store (enabled in your project settings), storage must be configured on the Mastra instance, not on individual agent Memory instances.
Configure storage on your Mastra instance:
import { Mastra } from "@mastra/core";
import { LibSQLStore } from "@mastra/libsql";
export const mastra = new Mastra({
storage: new LibSQLStore({
id: "mastra-store",
url: "file:./mastra.db",
}),
agents: { myAgent },
});
Agents can use Memory without specifying storage as they inherit from the Mastra instance:
import { Agent } from "@mastra/core/agent";
import { Memory } from "@mastra/memory";
export const myAgent = new Agent({
id: "my-agent",
memory: new Memory({
// No storage here - uses instance-level storage from Mastra Cloud Store
options: {
lastMessages: 20,
},
}),
});
Bring your own databaseDirect link to Bring your own database
If you don't use Mastra Cloud Store, you can use any storage provider with any configuration. Set your database connection strings as environment variables in your project's Settings page.
Using your deploymentDirect link to Using your deployment
After deployment, interact with your agents using the Mastra Client or call the REST API endpoints directly.
Next stepsDirect link to Next steps
- Studio - Test your agents in the cloud
- Observability - Monitor traces and logs