Skip to main content

Setting Up and Deploying

This page explains how to set up a project on Mastra Cloud with automatic deployments using our GitHub integration.

Mastra Cloud

Deploy and monitor your Mastra applications with Mastra Cloud. Get automated deployments, detailed observability, and built-in playground for testing agents and workflows.

Prerequisites​

  • A Mastra Cloud account
  • A GitHub account / repository containing a Mastra application

See our Getting started guide to scaffold out a new Mastra project with sensible defaults.

Setup and Deploy process​

  1. Head over to https://cloud.mastra.ai/ and sign in with either:

    • GitHub
    • Google
  2. When prompted, install the Mastra GitHub app.

    Install GitHub

  3. Click the Create new project button to create a new project.

    Create new project

  4. Search for a repository, then click Import.

    Import Git repository

  5. Mastra Cloud automatically detects the right build settings, but you can customize them using the options described below.

    Deployment details

    • Importing from GitHub: The GitHub repository name
    • Project name: Customize the project name
    • Branch: The branch to deploy from
    • Project root: The root directory of your project
    • Mastra directory: Where Mastra files are located
    • Environment variables: Add environment variables used by the application
    • Build and Store settings:
      • Install command: Runs pre-build to install project dependencies
      • Project setup command: Runs pre-build to prepare any external dependencies
      • Port: The network port the server will use
      • Store settings: Use Mastra Cloud's built-in LibSQLStore storage
    • Deploy Project: Starts the deployment process
  6. Click Deploy Project to create and deploy your application using the configuration you've set.

Successful deployment​

After a successful deployment you'll be shown the Overview screen where you can view your project's status, domains, latest deployments and connected agents and workflows.

Successful deployment

Continuous integration​

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

Testing your application​

After a successful deployment you can test your agents and workflows from the Playground in Mastra Cloud, or interact with them using our Client SDK.

Next steps​