---
title: "Deploy Mastra Agent on Oracle Database"
description: "Mastra weather agent with all state in Oracle Database Free."
category: "AI/ML"
url: https://railway.com/deploy/mastra-agent-on-oracle-database
---

# Deploy Mastra Agent on Oracle Database

Mastra weather agent with all state in Oracle Database Free.

**[Deploy Mastra Agent on Oracle Database on Railway](https://railway.com/template/mastra-agent-on-oracle-database)**

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

## Template content

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

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

### Oracle https://devicons.railway.com/oracle

- **Source:** https://github.com/leoisadev1/mastra-template-oracledb

## Documentation

# Deploy and Host Mastra Agent on Oracle Database on Railway

[Mastra](https://mastra.ai) is the open-source TypeScript framework for building AI agents and workflows. This template deploys a weather agent and workflow whose entire state — conversation threads, messages, workflow snapshots, and traces — lives in Oracle Database via `@mastra/oracledb`. `OracleStore` holds that state, and `OracleVector` is registered on the same connection pool, ready for semantic recall when you add an embedder.

## About Hosting Mastra Agent on Oracle Database

The template provisions two services: the Mastra server and an Oracle Database Free instance (`gvenzl/oracle-free`) with a persistent volume. Give that volume at least 5 GB; the extracted database uses about 3.2 GB. You supply two values: an OpenAI API key and a password for the Oracle application user. The app reads that password over Railway's private network, so you set it once. Oracle needs about a minute to initialize on first boot, and about ten seconds on every restart after that — the app retries until the database accepts connections. The public domain serves both the Mastra REST API and Mastra Studio, so you can read the Oracle-backed threads and traces in the browser. Set your OpenAI API key and deploy.

## Common Use Cases

- Run Mastra agents inside an Oracle-standardized data stack
- Evaluate `@mastra/oracledb` storage and vector search with a working reference
- Keep agent state and workflow state in one database you already operate

## Dependencies for Mastra Agent on Oracle Database Hosting

- OpenAI API key (agent model)
- A password of your choice for the Oracle application user. Use 12 to 30 letters and digits only. The Oracle image puts this value into a SQL statement, so quotes, `@`, `/`, and spaces can break the user it creates.

### Deployment Dependencies

- [Mastra storage docs](https://mastra.ai/docs)
- [gvenzl/oracle-free image](https://hub.docker.com/r/gvenzl/oracle-free)

## Why Deploy Mastra Agent on Oracle Database 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 on Oracle Database 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-on-oracle-database
