Railway

Deploy AgentRQ

Real-time human-in-the-loop task manager for AI agents.

Deploy AgentRQ

/var/lib/postgresql/data

Just deployed

/_storage

Deploy and Host AgentRQ on Railway

About Hosting AgentRQ

AgentRQ is an agent infrastructure platform designed to provide a centralized environment for running and managing AI agents, tools, and related workflows. It can be deployed as a self-hosted Docker application and provides web access through its HTTP server.

Railway hosts AgentRQ using the published agentrq/agentrq:latest Docker image. The application listens internally on port 2026 and binds to 0.0.0.0, allowing Railway to route incoming traffic to the service.

This template uses SQLite for persistent application data. A Railway Volume is mounted at /_storage, where AgentRQ stores its SQLite database, file attachments, and other persistent data. Railway handles the public TLS layer, so AgentRQ's built-in TLS is disabled.

The deployment uses Railway environment variables for the public URL, authentication secrets, SQLite configuration, and production settings.

Common Use Cases

  • AI Agent Infrastructure: Deploy a self-hosted AgentRQ instance for running and managing agent-based workflows.
  • Agent Workspaces: Provide a persistent environment for agent data, attachments, authentication, and workspace configuration.
  • Self-Hosted Agent Platform: Run AgentRQ on Railway with persistent storage and a publicly accessible HTTPS endpoint.

Dependencies for AgentRQ Hosting

  • AgentRQ Docker Imageagentrq/agentrq:latest.
  • Railway Volume — Required for the SQLite database, file attachments, and persistent application data.
  • Authentication Secrets — Required for JWT signing, MCP token encryption, and root access.
  • Railway Public Domain — Used to construct AgentRQ's public URL and domain configuration.

Deployment Dependencies

Implementation Details

Docker

Deploy the published Docker image:

agentrq/agentrq:latest

Railway uses the Docker image directly, so no Dockerfile or custom build command is required.

Set the Railway service builder/runtime to use the Docker image:

Builder: Docker Image
Runtime: Docker

The application listens on port 2026 and binds to 0.0.0.0.

Public Networking

SettingValue
Proxy TypeHTTP Proxy
Target Port2026
Application Port2026
Public Port80
Private Port2026
HTTPSRailway-managed

Railway terminates TLS before forwarding requests to AgentRQ. Therefore, AgentRQ's internal SSL should remain disabled:

AGENTRQ_SSL_ENABLED=false

Generate a Railway domain from Settings → Networking → Generate Domain.

The generated domain is used by the AgentRQ URL variables.

Environment Variables

VariableRequiredDescription
ENVYesProduction environment mode.
PORTYesInternal HTTP server port. Set to 2026.
AGENTRQ_BASE_URLYesFull public AgentRQ URL.
AGENTRQ_DOMAINYesRailway public domain without protocol.
AGENTRQ_PROXY_DOMAINYesPublic domain used by the reverse-proxy configuration.
AGENTRQ_COOKIE_SECUREYesEnables secure cookies when using HTTPS.
AGENTRQ_SSL_ENABLEDYesKeeps AgentRQ's built-in TLS disabled because Railway handles TLS.
AGENTRQ_SQLITE_ENABLEDYesEnables SQLite.
AGENTRQ_SQLITE_DSNYesSQLite database path on the persistent volume.
AGENTRQ_POSTGRES_ENABLEDYesDisables PostgreSQL for this deployment.
AGENTRQ_AUTH_JWT_SECRETYesSecret used for signing session JWTs.
AGENTRQ_AUTH_WORKSPACE_TOKEN_KEYYes32-byte AES-256-GCM key used for MCP token encryption.
AGENTRQ_AUTH_ROOT_LOGIN_ENABLEDYesEnables root login.
AGENTRQ_AUTH_ROOT_ACCESS_TOKENYesRoot access token.

Configure the variables in Railway:

ENV=production
PORT=2026
AGENTRQ_BASE_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
AGENTRQ_DOMAIN=${{RAILWAY_PUBLIC_DOMAIN}}
AGENTRQ_PROXY_DOMAIN=${{RAILWAY_PUBLIC_DOMAIN}}
AGENTRQ_COOKIE_SECURE=true
AGENTRQ_SSL_ENABLED=false
AGENTRQ_SQLITE_ENABLED=true
AGENTRQ_SQLITE_DSN=/_storage/agentrq.db
AGENTRQ_POSTGRES_ENABLED=false
AGENTRQ_AUTH_JWT_SECRET=${{secret(32)}}
AGENTRQ_AUTH_WORKSPACE_TOKEN_KEY=${{secret(32)}}
AGENTRQ_AUTH_ROOT_LOGIN_ENABLED=true
AGENTRQ_AUTH_ROOT_ACCESS_TOKEN=${{secret(32)}}

Railway generates the secret values used by the secret(32) references. Keep authentication secrets private and do not commit them to source control.

Persistent Storage

A Railway Volume is required.

Open:

AgentRQ Service → Settings → Volumes → Add Volume

Configure:

Volume Name: storage
Mount Path: /_storage

The volume is required because AgentRQ stores its SQLite database and persistent files at this location.

The SQLite database is:

/_storage/agentrq.db

Without the volume, data stored inside the container filesystem can be lost when the service is redeployed or recreated.

The volume also stores file attachments and other persistent application data documented by the deployment configuration.

Database

This template uses SQLite rather than PostgreSQL.

Enable SQLite:

AGENTRQ_SQLITE_ENABLED=true
AGENTRQ_SQLITE_DSN=/_storage/agentrq.db

PostgreSQL is explicitly disabled:

AGENTRQ_POSTGRES_ENABLED=false

No separate Railway PostgreSQL service is required for this configuration.

The SQLite database resides on the Railway Volume mounted at:

/_storage

Build & Start

No custom build or start commands are required.

Railway should deploy:

agentrq/agentrq:latest

and use the Docker image's default startup configuration.

The application is configured to listen on:

0.0.0.0:2026

Do not add a custom docker run or Docker Compose command as the Railway start command.

Accessing the Application

After deployment:

  1. Open the AgentRQ service in Railway.
  2. Go to Settings → Networking.
  3. Select Generate Domain.
  4. Wait for the deployment to become healthy.
  5. Open the generated HTTPS URL.

The Railway domain is automatically injected into:

AGENTRQ_BASE_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
AGENTRQ_DOMAIN=${{RAILWAY_PUBLIC_DOMAIN}}
AGENTRQ_PROXY_DOMAIN=${{RAILWAY_PUBLIC_DOMAIN}}

AgentRQ is configured for secure cookies:

AGENTRQ_COOKIE_SECURE=true

while built-in TLS remains disabled:

AGENTRQ_SSL_ENABLED=false

This allows Railway to terminate HTTPS at the public edge while AgentRQ communicates internally over HTTP.

The root login is enabled:

AGENTRQ_AUTH_ROOT_LOGIN_ENABLED=true

The root access token is supplied through:

AGENTRQ_AUTH_ROOT_ACCESS_TOKEN=${{secret(32)}}

Keep this credential secure and use the application's documented authentication flow to access the administrative interface.

Why Deploy AgentRQ 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 AgentRQ 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.


Template Content

More templates in this category

View Template
NEW
Pyroscope profiling
Protected continuous profiling with durable Pyroscope storage.

Anton Orel
1
View Template
SigOnly
Deploy SigNoz with a working demo app & config in one click

zoeyjones
22
View Template
Unwrapped Spotify Music Stats
Unwrapped Spotify Music Stats, Estatísticas de músicas disponíveis

Jorge Henrique
1