Skip to main content
If you’re interested in self-hosting Convex on your own infrastructure or a managed hosting provider, this guide will help you get started. Support is available on the Convex Discord in the #self-hosted channel.
If you don’t specifically need to self-host, consider using cloud-hosted Convex. Cloud-hosted Convex includes a generous free tier and provides a seamless, reliable, cost-effective platform that allows you to focus on building your application without worrying about infrastructure.

Self-hosting architecture

Self-hosting Convex requires deploying three services:
  1. The Convex backend - Handles all database operations and compute functions
  2. The Convex dashboard - Provides a web interface for managing your deployment
  3. Your frontend app - Can be hosted yourself or on a managed service like Netlify or Vercel

Default configuration

By default, the Convex backend stores all state in a local SQLite database. We recommend starting with this basic configuration and then moving the container to a hosting provider or pointing the backend to a separate SQL database for a production-ready configuration as needed.

Deployment options

Quick start with Docker

The easiest way to get started is using Docker Compose. This setup includes:
  • Convex backend running on port 3210
  • HTTP actions exposed on port 3211
  • Dashboard running on port 6791
  • Data stored in a Docker-managed volume
See the Docker deployment guide for detailed instructions.

Advanced deployment options

For production workloads, you have several options:
  • Managed hosting providers: Deploy to Fly.io, Railway, or similar platforms
  • Your own infrastructure: Run on your own servers with custom routing and domains
  • Binary deployment: Run the Convex binary directly without Docker

External database support

For production deployments requiring guaranteed uptime, you can connect to managed database services:
  • PostgreSQL: Version 17 and compatible versions (e.g., Neon)
  • MySQL: Version 8 and compatible versions (e.g., PlanetScale with Vitess)
It’s very important your backend is hosted in the same region and as close as possible to your database. Any additional latency between backend and database will negatively impact query performance.
See Database setup for detailed instructions.

S3 storage support

By default, the backend stores files on the local filesystem. For production deployments, you can configure S3-compatible storage for:
  • Snapshot exports and imports
  • Function modules
  • User files
  • Search indexes
Supported providers include AWS S3, Cloudflare R2, and other S3-compatible services. See Storage configuration for detailed instructions.

Convex Auth

If you’re using Convex Auth, follow the manual instructions to set up. The CLI does not support self-hosted deployments yet.

Deploying your frontend app

The Convex backend runs all database and compute functions but doesn’t host your web app. When hosting your website on providers like Netlify or Vercel, use these environment variables:
  • CONVEX_SELF_HOSTED_URL - The URL where your Convex backend is hosted
  • CONVEX_SELF_HOSTED_ADMIN_KEY - The admin key generated for your deployment
These replace the standard CONVEX_DEPLOY_KEY used in cloud-hosted deployments.

Limitations

Self-hosted Convex supports all the free-tier features of the cloud-hosted product. The cloud-hosted product is optimized for scale beyond the self-hosted version.

Support and contributions

Next steps

Docker deployment

Get started quickly with Docker Compose

Configuration

Configure runtime options and environment variables

Database setup

Connect to PostgreSQL or MySQL

Storage

Set up S3-compatible storage

Build docs developers (and LLMs) love