---
title: "Deploy a13n"
description: "Deploy a13n on Railway. Run and manage AI agents. Always latest."
category: "AI/ML"
url: https://railway.com/deploy/a13n
---

# Deploy a13n

Deploy a13n on Railway. Run and manage AI agents. Always latest.

**[Deploy a13n on Railway](https://railway.com/template/a13n)**

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

- **Creator:** RBR Digital
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### a13n https://a13n.dev/assets/a13n-logo-27XPwOKb.svg

- **Image:** ghcr.io/converge-ai-labs/a13n-service:latest
- **Start command:** `sh -c "chown -R app:app /app/var && exec a13n-entrypoint a13n-service --config /app/service.toml run"`
- **Health check:** /readyz
- **Public domain:** Yes

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

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

## Documentation

# Deploy and Host a13n on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/a13n?referralCode=9uHSFr&utm_medium=integration&utm_source=template&utm_campaign=generic)

a13n Service is an open-source runtime for managing and running AI agents on your own infrastructure. Use Console to configure an agent, try it in a conversation, and debug its tool calls, then call that same agent from your application through the HTTP API or a Python, TypeScript, Go, or Rust SDK. Service handles execution and recovery for those requests.

## About Hosting a13n

Hosting a13n takes the official image (`ghcr.io/converge-ai-labs/a13n-service:latest`), PostgreSQL, Redis, and one volume at `/app/var`. A new deploy or rebuild pulls the newest release. The process listens on port 8000 and serves Console and the API from one origin: open the public domain for Console; the API is under `/api/v1`. The schema migrates automatically on startup, and on first start the service generates an encryption key at `/app/var/encryption.key`. Railway mounts volumes as root, so this template starts the container as root and hands `/app/var` to the image's `app` user before the service starts. No Docker socket is mounted, so a Docker sandbox is not provisioned automatically; model-only conversations still work, and you can add a cloud sandbox provider later in Console.

## Common Use Cases

- Configure agents in Console, try them in a conversation, and inspect tool calls
- Call the same agents from an app through the HTTP API or the Python, TypeScript, Go, or Rust SDKs
- Keep long-running tasks going after a client disconnects, and resume interrupted runs from checkpoints
- Connect your own model providers (OpenAI, Anthropic, Gemini, or an OpenAI-compatible server)
- Invite a team into a workspace, then inspect usage and cost in Console

## Dependencies for a13n Hosting

- Official image `ghcr.io/converge-ai-labs/a13n-service:latest` (linux/amd64 and linux/arm64)
- PostgreSQL (durable state). The connection URL must use the `postgresql+psycopg://` scheme
- Redis (live streams, wakeups, rate limits, and monitoring coordination)
- One persistent volume at `/app/var` (encryption key plus local object storage)
- Your own model-provider API keys, added in Console after deploy
- Optional: a sandbox provider configured in Console (E2B, Daytona, Modal, and others) if agents need files or a shell
- Optional: SMTP (`A13N_AUTH__MAIL` as a JSON object) for invitations, password resets, and email-change links

### Deployment Dependencies

- [a13n documentation](https://a13n.dev/docs/)
- [Quickstart](https://a13n.dev/docs/a13n-service/get-started/)
- [Configuration](https://a13n.dev/docs/a13n-service/configuration/)
- [Settings reference](https://a13n.dev/docs/a13n-service/configuration-reference/)
- [GitHub](https://github.com/converge-ai-labs/agent-foundation)
- [Railway Documentation](https://docs.railway.app)

### Implementation Details

**Environment variables:**

| Variable | Value | Notes |
|----------|-------|-------|
| `PORT` | `8000` | Port the service listens on. Railway uses it for routing and the health check. |
| `RAILWAY_RUN_UID` | `0` | Runs the container as root so the start command can hand the `/app/var` volume to the `app` user. |
| `A13N_SERVER__PUBLIC_URL` | `https://${{RAILWAY_PUBLIC_DOMAIN}}` | External HTTPS origin. Browser auth uses this origin. |
| `A13N_DATABASE__URL` | `postgresql+psycopg://${{Postgres.PGUSER}}:${{Postgres.PGPASSWORD}}@${{Postgres.PGHOST}}:${{Postgres.PGPORT}}/${{Postgres.PGDATABASE}}` | Must use the `postgresql+psycopg://` scheme. |
| `A13N_REDIS__URL` | `${{Redis.REDIS_URL}}` | Redis connection URL. |
| `A13N_ENCRYPTION__KEY_FILE` | `/app/var/encryption.key` | Generated on first start if missing. Back it up with the database: stored credentials cannot be read without it. |
| `A13N_PROVIDERS__RETURN_URLS` | `["https://${{RAILWAY_PUBLIC_DOMAIN}}/connections/callback"]` | JSON array, so app-connection OAuth callbacks return to this origin. |

Optional mail goes in `A13N_AUTH__MAIL` as one JSON object (`smtp_host`, `smtp_port`, `smtp_security`, `smtp_username`, `smtp_password`, `sender`).

**Start command:**

```sh
sh -c "chown -R app:app /app/var && exec a13n-entrypoint a13n-service --config /app/service.toml run"
```

It fixes the volume owner as root, then runs the image's own entrypoint, which drops to the `app` user.

**Volume:** `/app/var` on the a13n service.

**Health check:** `GET /readyz` on port 8000. The first boot runs migrations, so it can take a moment.

**First run:**

1. Wait until the service is healthy (the first boot may take a moment while migrations run).
2. Open the public domain right away and register with your email and a password of at least 8 characters. There is no default administrator: the first person to register becomes the administrator.
3. Open **Models → Add model**, connect a provider with your API key, and add a model.
4. Open **Agents → Create manually**, attach that model, then **Try agent** to send a message.
5. On the same agent, choose **Connect to app** for the Service URL, agent ID, and an API key.

## Why Deploy a13n 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 a13n 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.

This template uses the official `latest` tag, PostgreSQL, Redis, and a single `/app/var` volume.

---

## Template Author

Created and maintained by **Douglas Rubim**.

GitHub: https://github.com/douglasrubims

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/a13n
