---
title: "Deploy Mastra Agent Builder"
description: "Hosted Studio agent builder with MastraEditor. Enterprise license needed."
category: "AI/ML"
url: https://railway.com/deploy/mastra-agent-builder
---

# Deploy Mastra Agent Builder

Hosted Studio agent builder with MastraEditor. Enterprise license needed.

**[Deploy Mastra Agent Builder on Railway](https://railway.com/template/mastra-agent-builder)**

- **Creator:** leodev
- **Category:** AI/ML

## Template content

### Mastra Server https://unpkg.com/mastra/dist/studio/mastra.svg

- **Source:** https://github.com/leoisadev1/mastra-template-agent-builder
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Mastra Agent Builder on Railway

[Mastra](https://mastra.ai) is the open-source TypeScript framework for building AI agents and workflows. This template deploys the Mastra Agent Builder: a server with `MastraEditor` that lets you create and edit agents from Studio with a configurable feature matrix — allowed models, tools, sub-agents, workflows, avatars, and observational memory. Optional integrations add Composio tools, Stagehand/Browserbase browsing, and an E2B-backed sandboxed workspace.

## About Hosting Mastra Agent Builder

The public domain serves Mastra Studio, and agent definitions are stored in LibSQL on an attached volume. Every third-party integration is optional and activates when you set its variables: WorkOS for auth and roles, Composio for tenant-scoped tools, Browserbase for web browsing, E2B for sandboxed code workspaces. Start with just an OpenAI API key and add providers as you need them. The deployment has no authentication until you configure WorkOS, so anyone with the URL can use the agents and spend your OpenAI credit. Set `WORKOS_API_KEY` and `WORKOS_CLIENT_ID`, or remove the public domain, before you share the URL.

The Agent Builder and WorkOS role-based access control are Mastra Enterprise features. Set `MASTRA_LICENSE_KEY` to turn them on. Without the license key the server still runs Studio, the agents, the tools, and the workflow, and WorkOS still authenticates users; only the builder UI and the role checks stay off. The deploy form does not ask for the license key: after the deploy finishes, open the Mastra Server service, add `MASTRA_LICENSE_KEY` in Variables, and redeploy.

## Common Use Cases

- Give your team a hosted UI to create and iterate on agents without code deploys
- Evaluate the Mastra agent-builder feature matrix with per-tenant tool scoping
- Prototype internal agent platforms with pluggable auth and sandboxes

## Dependencies for Mastra Agent Builder Hosting

- OpenAI API key (agent models)
- Mastra Enterprise license key, for the Agent Builder and WorkOS roles

### Deployment Dependencies

- [Mastra docs](https://mastra.ai/docs)
- Optional: [WorkOS](https://workos.com/), [Composio](https://composio.dev/), [Browserbase](https://www.browserbase.com/), [E2B](https://e2b.dev/)

## Why Deploy Mastra Agent Builder on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Mastra Agent Builder on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/mastra-agent-builder
