#self-hosted channel.
Self-hosting architecture
Self-hosting Convex requires deploying three services:- The Convex backend - Handles all database operations and compute functions
- The Convex dashboard - Provides a web interface for managing your deployment
- 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
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)
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
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 hostedCONVEX_SELF_HOSTED_ADMIN_KEY- The admin key generated for your deployment
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
- Join the Convex Discord for help and discussions in the
#self-hostedchannel - Report issues through GitHub Issues
- Contributions are welcome
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