---
title: "Deploy Switch Console"
description: "Humans and AI agents together in the tools where your team already works"
category: "AI/ML"
url: https://railway.com/deploy/switch-console
---

# Deploy Switch Console

Humans and AI agents together in the tools where your team already works

**[Deploy Switch Console on Railway](https://railway.com/template/switch-console)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/switch-console/manifest.json

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

## Template content

### flint-switch https://raw.githubusercontent.com/sandbox-quantum/switch/main/assets/agent-switch-wordmark-dark.svg

- **Image:** ghcr.io/sandbox-quantum/standalone-compose:latest

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# Deploy and Host Flint AI Switch

Deploy a production-ready instance of **Flint AI Switch** (`v0.25.0`) on Railway, fully equipped with a managed PostgreSQL database, persistent volume storage, and pre-enabled **Gateway** and **Collab (Mattermost)** profiles.

---

## About Hosting

Hosting Flint AI Switch on Railway provides an isolated, self-hosted environment for managing and orchestrating AI agents. By utilizing Railway's container orchestration and private networking, this deployment couples the `ghcr.io/sandbox-quantum/standalone-compose:0.25.0` image with a dedicated PostgreSQL database (`mattermost`). Railway automatically handles container lifecycle management, automatic domain assignment, SSL termination, and internal networking.

---

## Why Deploy

* **Centralized AI Orchestration**: Unify external AI agents, team communication channels, and administrative controls within a single self-hosted switch.
* **Turnkey Setup**: Provisions the database, volume mounts, network bridges, and automatic secret generation (`AGENT_REGISTRATION_TOKEN`) out of the box.
* **Persistent Cryptographic Identity**: Guarantees that server signing keys and Matrix state are preserved across redeployments using Railway persistent volumes.
* **Integrated Collaboration**: Pre-configured support for Mattermost (`COMPOSE_PROFILES=collab`) enables direct interaction between AI agents and team chat channels.

---

## Common Use Cases

* **Multi-Agent Management**: Securely route, register, and manage autonomous AI agents connecting via API on port 8000.
* **Self-Hosted AI Chat Hubs**: Run team collaboration workflows powered by background AI services integrated into Mattermost.
* **Enterprise AI Gateways**: Maintain an internal administrative control plane on port 3000 to monitor agent connections and system health.

---

## Dependencies for Deployment

* **PostgreSQL Database**: Required for storing application state and Mattermost collaboration data.
* **Persistent Volume (`tuwuneldata`)**: Storage volume mounted at `/var/lib/tuwunel` to retain cryptographic signing keys and state.
* **Network Ports**:
* `3000`: Web Gateway UI.
* `8000`: Agent API endpoint.



---

## ⚙️ Environment Variables

| Variable | Description | Default / Railway Value |
| --- | --- | --- |
| `AGENT_REGISTRATION_TOKEN` | Security token for registering new AI agents | Auto-generated via `${{ secret(32) }}` |
| `DATABASE_URL` | PostgreSQL connection string | Linked internally to the `mattermost` database |
| `TUWUNEL_SERVER_NAME` | Public identity name of the server | `${{ RAILWAY_PUBLIC_DOMAIN }}` |
| `MATRIX_SERVER_NAME` | Server name for routing and federation | `${{ RAILWAY_PUBLIC_DOMAIN }}` |
| `SWITCH_BIND_ADDR` | Network listen address | `0.0.0.0` |
| `COMPOSE_PROFILES` | Active feature profiles | `gateway,collab` |

---

## ⚠️ Critical Security & Persistence Notes

* **Data Persistence**: The `tuwuneldata` volume **must never be deleted or unmounted**. It holds the private signing key. Losing this volume will irrecoverably orphan all server accounts and stored data.
* **Domain Stability**: Do not modify `TUWUNEL_SERVER_NAME` or `MATRIX_SERVER_NAME` after the initial boot to avoid breaking the cryptographic identity of the deployment.

---

## 🛠️ Post-Deployment Setup

1. **Access the Gateway**: Navigate to the public URL generated for **port 3000** in your browser to view the Gateway dashboard.
2. **Connect Agents**: Copy the auto-generated `AGENT_REGISTRATION_TOKEN` from your Railway Variables tab to authenticate external AI agents connecting on **port 8000** (API).

## 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/switch-console
