Skip to main content

Cloud Providers

Standalone Mastra applications can be deployed to popular cloud providers, see one of the following guides for more information:

For self-hosted Node.js server deployment, see the Creating A Mastra Server guide.

Prerequisites
Direct link to Prerequisites

Before deploying to a cloud provider, ensure you have:

  • A Mastra application
  • Node.js v22.13.0 or later
  • A GitHub repository for your application (required for most CI/CD setups)
  • Domain name management access (for SSL and HTTPS)
  • Basic familiarity with server setup (e.g. Nginx, environment variables)

LibSQLStore
Direct link to LibSQLStore

LibSQLStore writes to the local filesystem, which is not supported in cloud environments that use ephemeral file systems. If you're deploying to platforms like AWS Lambda, Netlify, Azure App Services, or Digital Ocean App Platform, you must remove all usage of LibSQLStore.

Specifically, ensure you've removed it from all Mastra files, including configuration on the main Mastra instance and any agents using it, e.g. for memory storage.

src/mastra/index.ts
 export const mastra = new Mastra({
- storage: new LibSQLStore({
- id: 'mastra-storage',
- url: ":memory:",
- }),
});
 export const weatherAgent = new Agent({
id: "weather-agent",
memory: new Memory({
- storage: new LibSQLStore({
- id: 'mastra-storage',
- url: "file:../mastra.db",
- }),
}),
});

On this page