Skip to main content
Get your self-hosted Convex instance running quickly with Docker.

Prerequisites

Quick start

1

Download docker-compose.yml

Create a new directory and download the Docker Compose configuration:
Or create a docker-compose.yml file with this content:
docker-compose.yml
2

Start the services

Launch the backend and dashboard:
Wait for both services to start. You should see logs indicating the backend is ready.
3

Generate an admin key

In a new terminal, generate an admin key for the CLI:
Save the generated admin key - you’ll need it in the next step.
4

Configure your environment

Create a .env.local file in your Convex project directory:
.env.local
Never commit this file to version control. Add it to your .gitignore.
5

Install the Convex CLI

Install the latest Convex CLI in your project:
6

Deploy your functions

Start the development server to deploy your Convex functions:
This will:
  • Push your schema and functions to the backend
  • Generate TypeScript types
  • Watch for changes and hot-reload
7

Access the dashboard

Open your browser and navigate to:
You can view your tables, run queries, and monitor your deployment.

Verify your setup

Create a simple function to test your setup. In your convex/ directory, create messages.ts:
convex/messages.ts
Run the mutation from your app or the dashboard:

What’s next?

Configure your database

Set up PostgreSQL or MySQL for production

Configure storage

Use S3-compatible storage for files

Explore features

Learn about database operations and queries

Build from source

Compile the backend yourself

Troubleshooting

Check that ports 3210 and 3211 are not already in use:
Stop any conflicting services or change the ports in docker-compose.yml.
Verify the backend is running:
If this fails, check the Docker logs:
Regenerate the admin key:
Update your .env.local file with the new key.

Support

For self-hosting questions: