Convex

Deploy and Host Convex with Railway

Deploy Convex

convex-backend

get-convex/convex-backend:latest

Just deployed

convex-dashboard

get-convex/convex-dashboard:latest

Just deployed

Postgres

postgres:17

Just deployed

/var/lib/postgresql/data

Deploy and Host Convex on Railway

Convex is the open-source reactive database designed to make life easy for web app developers, whether human or LLM. Fetch data and perform business logic with strong consistency by writing pure TypeScript.


About Hosting Convex

Hosting Convex yourself gives you full control over deployment, scaling, and security. This guide covers running a self-hosted Convex instance on Railway, including configuration for public/private access and admin key management. Railway automates provisioning, networking, and updates, letting you focus on your application logic rather than infrastructure.

Deploy and Host

Configure CONVEX_SELF_HOSTED_ADMIN_KEY:

  1. On the first run of convex-backend, you will find an auto-generated Admin Key: XXX|XXXX in the Deploy Logs. Copy this key and paste it into the CONVEX_SELF_HOSTED_ADMIN_KEY variable, then restart convex-backend.
  2. If you need to modify the INSTANCE_SECRET, set CONVEX_SELF_HOSTED_ADMIN_KEY to invalid after making the change, then repeat Step 1 to generate a new admin key.

To set as Public:

  • Set CONVEX_CLOUD_ORIGIN to ${{PUBLIC_CONVEX_CLOUD_ORIGIN}}
  • Set CONVEX_SITE_ORIGIN to ${{PUBLIC_CONVEX_SITE_ORIGIN}}
  • Add HTTP networking to convex-backend, pointing to port 3210, and add TCP networking pointing to port 3211
  • Add HTTP networking to convex-dashboard, pointing to port 8080

To set as Private:

  • Set CONVEX_CLOUD_ORIGIN to ${{PRIVATE_CONVEX_CLOUD_ORIGIN}}
  • Set CONVEX_SITE_ORIGIN to ${{PRIVATE_CONVEX_SITE_ORIGIN}}

Common Use Cases

  • Real-time applications: Chat apps, live dashboards, or collaborative tools.
  • Serverless backends: APIs with automatic scaling and zero cold starts.
  • Full-stack projects: Unified backend for Next.js, React, or other frontend frameworks.

Deployment Dependencies


Dependencies for Convex Hosting

NA

Why Deploy Convex 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 Convex 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
ReadySet
A lightweight caching engine for Postgres

View Template
Flare
A modern, lightning-fast file sharing platform built for self-hosting

View Template
EdgeDB
EdgeDB template based on their Docker deployment guide