---
title: "Deploy Convex | (Just Updated) Firebase Alternative, HTTP Actions on HTTPS, Admin Key in Logs"
description: "Convex backend and dashboard. HTTPS HTTP actions, data kept on a volume"
category: "Storage"
url: https://railway.com/deploy/convex-or-just-updated-firebase-alternat
---

# Deploy Convex | (Just Updated) Firebase Alternative, HTTP Actions on HTTPS, Admin Key in Logs

Convex backend and dashboard. HTTPS HTTP actions, data kept on a volume

**[Deploy Convex | (Just Updated) Firebase Alternative, HTTP Actions on HTTPS, Admin Key in Logs on Railway](https://railway.com/template/convex-or-just-updated-firebase-alternat)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/convex-or-just-updated-firebase-alternat/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### site

- **Image:** caddy@sha256:d8542f48d34a9cf4e4c11a478865229840e87e4c96ea3f439101f31a5d35f75f
- **Start command:** `/bin/sh -c 'printf ":%s {\n\thandle /railway_health {\n\t\trespond \"ok\" 200\n\t}\n\thandle {\n\t\treverse_proxy %s:3211\n\t}\n}\n" "$PORT" "$BACKEND_HOST" > /etc/caddy/Caddyfile && echo "[railway] port=$PORT upstream=$BACKEND_HOST:3211" && exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile'`
- **Health check:** /railway_health
- **Public domain:** Yes

### convex

- **Image:** ghcr.io/get-convex/convex-backend@sha256:d715e9ec088784407ca4ba2d3db592702cd328d02c76cdca3852c0018f2a76b4
- **Start command:** `/bin/sh -c 'cd /convex && export DISABLE_BEACON=true DO_NOT_REQUIRE_SSL=true; sed "s/--port 3210/--port $PORT/" ./run_backend.sh > ./railway_run.sh && chmod +x ./railway_run.sh; echo "[railway] port=$PORT cloud=$CONVEX_CLOUD_ORIGIN site=$CONVEX_SITE_ORIGIN"; echo "[railway] data dir owner=$(stat -c %u:%g /convex/data) writable=$(test -w /convex/data && echo yes || echo NO)"; echo "[railway] DASHBOARD ADMIN KEY: $(./generate_admin_key.sh 2>/dev/null)"; exec ./railway_run.sh'`
- **Health check:** /version
- **Public domain:** Yes

### dashboard

- **Image:** ghcr.io/get-convex/convex-dashboard@sha256:f85cf0d0448b9c835ae3df5c7c1c6f0145dd4c8f0f92eb0245daf304efdd9f1a
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host Convex on Railway

Convex is an open-source reactive backend: a database, server functions written in TypeScript, file storage,
scheduled jobs and live queries that push updates to every connected client. This template runs the official
self-hosted Convex backend and dashboard images (pinned by digest) as three Railway services, with the
database on a Railway volume.

## About Hosting Convex

- **Three services, one deploy.** `convex` is the backend (API and WebSocket sync), `site` is a small HTTPS
  proxy for HTTP actions, and `dashboard` is the admin UI. Nothing has to be typed into the deploy form.
- **HTTP actions get a real HTTPS URL.** Convex serves HTTP actions, webhooks and auth callbacks (Convex Auth,
  OAuth redirects) from a second port. The `site` service puts that port on its own public Railway domain and
  `CONVEX_SITE_ORIGIN` points at it, so callbacks work without any extra setup.
- **Data survives redeploys.** SQLite and file storage live on a Railway volume mounted at `/convex/data`.
  The instance secret is generated per deploy and stored on the volume with the instance credentials.
- **Admin key in the deploy log.** Every boot, the `convex` service prints a line starting with
  `[railway] DASHBOARD ADMIN KEY:`. Open the service's Deploy Logs, copy the key and paste it into the
  dashboard login.
- **Healthchecks.** The backend is checked on `/version`, the proxy on `/railway_health`, the dashboard on `/`.

## Getting started

1. Deploy the template and wait for all three services to go green.
2. Open the `dashboard` service domain. Enter the `convex` service domain as the deployment URL if asked, and
   the admin key from the `convex` deploy logs.
3. In your project, set these two values (for example in `.env.local`) and run `npx convex dev` or
   `npx convex deploy`:

```
CONVEX_SELF_HOSTED_URL=https://
CONVEX_SELF_HOSTED_ADMIN_KEY=
```

4. Point your client at the same URL: `new ConvexReactClient("https://")`.
   HTTP actions are served at `https://`.

## Common Use Cases

- A self-hosted backend for a React, Next.js or mobile app that needs live, reactive queries
- Backend for AI and vibe-coding projects that already target the Convex API
- Webhook receivers and OAuth callbacks through Convex HTTP actions
- Keeping app data on infrastructure you control instead of the Convex cloud

## Dependencies for Convex Hosting

- One Railway volume on the `convex` service (created by the template)

### Deployment Dependencies

- Self-hosting guide: https://github.com/get-convex/convex-backend/tree/main/self-hosted
- Convex documentation: https://docs.convex.dev/
- Backend image: https://github.com/get-convex/convex-backend/pkgs/container/convex-backend
- Dashboard image: https://github.com/get-convex/convex-backend/pkgs/container/convex-dashboard

### Implementation Details

| Variable | Service | Purpose |
| --- | --- | --- |
| `INSTANCE_SECRET` | convex | 64 hex characters, generated per deploy. The admin key is derived from it, so do not change it after first boot. |
| `CONVEX_CLOUD_ORIGIN` | convex | Public HTTPS URL of the backend, used in storage URLs and callbacks. |
| `CONVEX_SITE_ORIGIN` | convex | Public HTTPS URL of the `site` service, used for HTTP actions. |
| `BACKEND_HOST` | site | Private address of the backend that the proxy forwards to. |
| `NEXT_PUBLIC_DEPLOYMENT_URL` | dashboard | Backend URL the dashboard connects to. |

## 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.


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/convex-or-just-updated-firebase-alternat
