#Local Deployment Dev - Offline

1 messages · Page 1 of 1 (latest)

winged zodiac
#

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?

viral roverBOT
#

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:

  1. 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.

  2. Local deployments feature: The npx convex dev --local command 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:

  1. Download the Convex backend binary from the releases page when you have internet access.

  2. Run the binary locally:

./convex-local-backend
  1. 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:

#
  1. Download the docker-compose.yml file when you have internet access
  2. Run docker compose up to start the containers
  3. 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.

The knowledge sources don't specifically address offline usage of the --local flag, but they do indicate that self-hosting is the most reliable way to develop completely offline.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: