Hello, I am looking for ways to be able to develop my app locally without internet connection. I was looking into the Local Deployment for Dev (npx convex dev --local), but when I turn to offline it gives an error. Is there a flag or a way to use local deployment offline, or is the only way to use convex offline is by self-hosting?
#Local Deployment Dev - Offline
1 messages · Page 1 of 1 (latest)
Hi @winged zodiac. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources, there are a few options for developing with Convex offline, but there are some limitations to be aware of.
Local Development Options
The primary way to develop Convex applications offline is through self-hosting. Convex provides an open-source version of the backend that you can run locally. Here are your options:
-
Self-hosted backend: You can run the Convex backend locally using Docker or by downloading the binary directly. This allows you to develop without an internet connection once set up.
-
Local deployments feature: The
npx convex dev --localcommand is designed to run a local deployment, but based on the knowledge sources, it appears this feature may still require some internet connectivity during initialization.
Setting Up Self-Hosted Backend
For fully offline development, setting up the self-hosted backend is your best option:
-
Download the Convex backend binary from the releases page when you have internet access.
-
Run the binary locally:
./convex-local-backend
- In a new terminal, run your Convex development commands with the appropriate URL and admin key:
npx convex dev --admin-key 0135d8598650f8f5cb0f30c34ec2e2bb62793bc28717c8eb6fb577996d50be5f4281b59181095065c5d0f86a2c31ddbe9b597ec62b47ded69782cd --url "<http://127.0.0.1:3210">
For convenience, you can also use a Justfile as mentioned in Developing with the Open-Source backend.
Docker Option
Alternatively, you can use Docker Compose to run both the backend and dashboard locally:
- Download the docker-compose.yml file when you have internet access
- Run
docker compose upto start the containers - Generate an admin key with
docker compose exec backend ./generate_admin_key.sh
This approach is detailed in Self-Hosting with Convex.
Note on Node Version
If you're using the local deployments feature, note that there appears to be a requirement to use Node 18 specifically. Several users have reported issues with other Node versions that were resolved by switching to Node 18.