Prerequisites
- Docker and Docker Compose installed
- Latest version of the Convex npm package (
convex@latest)
Quick start
1
Download docker-compose.yml
Download the official
docker-compose.yml file:2
Start the services
Start the backend and dashboard:This will:
- Start the Convex backend on
http://127.0.0.1:3210 - Expose HTTP actions on
http://127.0.0.1:3211 - Start the dashboard on
http://localhost:6791 - Create a Docker volume for persistent data storage
3
Generate an admin key
Once the backend is running, generate an admin key for the dashboard and CLI:
4
Configure your Convex project
In your Convex project directory, create a
.env.local file with your deployment URL and admin key:.env.local
5
Install the latest Convex package
Update to the latest version of Convex:
6
Deploy your code
Push code, run queries, import data, and more:
Docker Compose configuration
Thedocker-compose.yml file includes two services:
Backend service
Dashboard service
Customizing ports
You can customize the default ports by creating a.env file next to docker-compose.yml:
.env
Persistent storage
By default, data is stored in a Docker-managed volume nameddata. This volume persists even when containers are stopped or removed.
Pinning to a specific version
For production deployments, pin to a specific version instead of usinglatest:
.env file:
.env
Health checks
The backend includes a built-in health check endpoint:Accessing the dashboard
Visithttp://localhost:6791 in your browser. You’ll need to authenticate using the admin key generated in step 3.
Hosting on your own infrastructure
To run Convex on your own servers with custom domains:1
Download docker-compose.yml to your server
2
Set up routing
Configure your reverse proxy (nginx, Caddy, etc.) to forward requests:
https://api.my-domain.com→http://localhost:3210https://my-domain.com→http://localhost:3211https://dashboard.my-domain.com→http://localhost:6791
3
Configure environment variables
Create a
.env file with your domain configuration:.env
4
Start the services
5
Generate and use admin key
.env.local:.env.local
Next steps
Configuration
Configure environment variables and runtime options
Database setup
Connect to PostgreSQL or MySQL for production
Storage
Configure S3-compatible storage
Upgrading
Learn how to upgrade your self-hosted deployment