Skip to content

Commit c1b682e

Browse files
ldanilekConvex, Inc.
authored and
Convex, Inc.
committed
update self-hosting instructions to use .env.local (#34053)
suggest writing to a .env.local file so you don't need to pass flags. note `npx convex dev` and friends already work. we'll switch to `npx convex self-host dev` and friends after that lands, but they're not different in behavior -- they just have nicer `--help` output. GitOrigin-RevId: 9b65ba4f923eee93b7bc904972bb852bb1587567
1 parent f31ed78 commit c1b682e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

self-hosted/SELFHOSTING.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,21 @@ Visit the dashboard at `http://localhost:6791`. Using your admin key, push code
5151
to your backend. Admin key should be kept secure to just the developers who are
5252
administering the application on your backend.
5353

54+
In your Convex project, add your url and admin key to a `.env.local` file (which
55+
should not be committed to source control):
56+
5457
```sh
55-
cd your_project
56-
npm install
57-
npx convex dev --admin-key 'flying-fox-123|01c046ab1512d9306a6abda3eedec5dfe862f1fe0f66a5aee774fb9ae3fda87706facaf682b9d4f9209a05e038cbd6e9b8' --url "http://127.0.0.1:3210"
58+
CONVEX_SELF_HOST_DEPLOYMENT_URL='http://127.0.0.1:3210'
59+
CONVEX_DEPLOY_KEY='<your deploy key>'
60+
```
61+
62+
Now you can run commands in your Convex project, to push code, run queries,
63+
import data, etc.
64+
65+
```sh
66+
npx convex dev
67+
npx convex run <run args>
68+
npx convex import <import args>
5869
```
5970

6071
# Self Hosting Via Running Binary Directly
@@ -114,7 +125,7 @@ and other configuration.
114125
### Run the dashboard
115126

116127
You can run the dashboard locally with `just rush install` and `npm run dev`
117-
from `npm-packages/dashboard-common`.
128+
from `npm-packages/dashboard-self-hosted`.
118129

119130
### Use your backend.
120131

0 commit comments

Comments
 (0)