Skip to main content

Installing dependencies

You will need to first install the following dependencies if you don’t already have them on your machine.

Required tools

Just

Just is used to execute scripts set up in the Justfile.
cargo install just

Node.js

Make sure you have Node.js version 20.19.5 (specified in .nvmrc). We recommend installing Node.js via nvm.
nvm use

Rust toolchain

The Convex local backend is written in Rust. Install Cargo and the Rust toolchain via rustup. The Rust nightly version specified in rust-toolchain will install automatically when you use rustup.

JavaScript dependencies

The project uses Rush to manage packages in a monorepo.
1

Install Rush

npm clean-install --prefix scripts
2

Install Convex JavaScript dependencies

just rush install

Building the backend

Build and run the local backend from the source in this repo:
just run-local-backend
The backend will start on port 3210.
If this fails with an error “persisted db metadata …”, you might need to erase the local database:
rm convex_local_backend.sqlite3

Provisioning a demo app

This example demonstrates running the backend with the included demo project.
1

Start the backend

Run the local backend:
just run-local-backend
2

Set up the demo project

Navigate to the demo project and install dependencies:
cd npm-packages/demos/tutorial
npm i
3

Run Convex dev

The Convex CLI watches for changes in the application source code and pushes the code to the backend.
just convex dev
The convex script in Justfile automatically adds appropriate --url and --admin-key flags to point the CLI to the local backend.
4

Run the frontend

Start the demo Vite server:
npm run dev:frontend
Unlike the hosted Convex workflow, don’t run the dev:backend command since convex dev is already running.

Useful CLI commands

When interacting with your backend, these CLI commands may be helpful:
  • just convex data - Lists tables in your Convex deployment
  • just convex env - Allows you to list/set/update/delete environment variables
  • just convex logs - Streams out log lines to the terminal (includes all successful executions if --success is passed in)
  • just convex import - Allows you to import tables
  • just convex export - Allows you to export tables
If you’re using both the local backend and the hosted cloud platform, make sure to run npx convex dev or just convex dev before you start testing your client. The dev command will take care of updating your .env.local file with the correct CONVEX_URL.

Build docs developers (and LLMs) love