@@ -22,24 +22,56 @@ Development of the Convex backend is led by the Convex team. We
22
22
[ love receiving feedback] ( https://discord.gg/convex ) . We keep this repository
23
23
synced with any internal development work within a handful of days.
24
24
25
- # Self Hosting Guide
26
-
27
- First, you'll want to be get the
28
- [ convex-local-backend binary] ( ../crates/local_backend/README.md#running-the-convex-backend ) .
29
-
30
- You can either build from source or use the precompiled binaries. Note that in
31
- order to self host properly, you will need to clone the ` convex-backend `
32
- repository and get set up with rust, in order to use some of the administrative
33
- executables.
34
-
35
- ## Select an instance name
25
+ # Self Hosting Via Docker [ recommended]
36
26
37
27
Select a name for your instance. In the cloud product, this takes the form of
38
28
something like "flying-fox-123". You can select whatever you want here. A good
39
29
practice would be to pick something that matches the domain you host from,
40
30
though it is not critical.
41
31
42
- ## Generate a new instance secret
32
+ You'll need to have [ Docker] ( https://docs.docker.com/desktop/ ) installed to run
33
+ convex in Docker.
34
+
35
+ ``` sh
36
+ cd self-hosted
37
+ # Pull the latest docker images
38
+ docker compose pull
39
+ # Run the containers
40
+ docker compose up
41
+ ```
42
+
43
+ Once your Convex backend is running in Docker, you can ask it to generate admin
44
+ keys for use from the dashboard/CLI.
45
+
46
+ ``` sh
47
+ docker exec convex-local-backend ./generate_admin_key.sh
48
+ ```
49
+
50
+ Visit the dashboard at ` http://localhost:6791 ` . Using your admin key, push code
51
+ to your backend. Admin key should be kept secure to just the developers who are
52
+ administering the application on your backend.
53
+
54
+ ``` 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
+ ```
59
+
60
+ # Self Hosting Via Running Binary Directly
61
+
62
+ ### Get convex-local-backend Binary
63
+
64
+ You can either [ build from source] ( ../README.md ) or use the precompiled
65
+ binaries. You can download the latest precompiled binary release from
66
+ [ Releases] ( https://github.com/get-convex/convex-backend/releases ) . If your
67
+ platform is not supported, leave us a github issue. In the meantime, you can
68
+ build from source.
69
+
70
+ _ Note: On MacOS you might need to hold the ` option ` key and double click the
71
+ binary file in Finder once, to circumvent the
72
+ [ Gatekeeper] ( https://support.apple.com/en-us/102445 ) warning._
73
+
74
+ ### Generate a new instance secret
43
75
44
76
Instance secret is the secret to the backend. Keep very safe and only accessible
45
77
from the backend itself. Generate a new random instance secret with
@@ -51,7 +83,7 @@ cargo run -p keybroker --bin generate_secret
51
83
It will look like this:
52
84
` 4361726e697461732c206c69746572616c6c79206d65616e696e6720226c6974 `
53
85
54
- ## Generate a new admin key
86
+ ### Generate a new admin key
55
87
56
88
With the instance name and instance secret, generate an admin key. Admin key is
57
89
required to push code to the backend and take other administrator operations.
@@ -63,7 +95,11 @@ cargo run -p keybroker --bin generate_key -- flying-fox-123 4361726e697461732c20
63
95
It will look like
64
96
` flying-fox-123|01c046ab1512d9306a6abda3eedec5dfe862f1fe0f66a5aee774fb9ae3fda87706facaf682b9d4f9209a05e038cbd6e9b8 `
65
97
66
- ## Run your backend instance
98
+ ### Run your backend instance
99
+
100
+ Adjust the path based on where you downloaded the binary to or add it to your
101
+ ` PATH ` . The backend will store its database in the current-working-directory
102
+ (not where the binary file lives).
67
103
68
104
Use the instance name and instance secret to start your backend.
69
105
@@ -75,30 +111,12 @@ You can run `./convex-local-backend --help` to see other options for things like
75
111
changing ports, convex origin url, convex site url, local storage directories
76
112
and other configuration.
77
113
78
- ## Run your backend instance in Docker
79
-
80
- You'll need to have [ Docker] ( https://docs.docker.com/desktop/ ) installed to run
81
- convex in Docker.
82
-
83
- ``` sh
84
- cd self-hosted
85
- # Pull the latest docker images
86
- docker compose pull
87
- # Run the containers
88
- docker compose up
89
- ```
90
-
91
- Once your Convex backend is running in Docker, you can ask it to generate admin
92
- keys.
93
-
94
- ``` sh
95
- docker exec convex-local-backend ./generate_admin_key.sh
96
- ```
114
+ ### Run the dashboard
97
115
98
- Visit the dashboard at ` http://localhost:6791 ` and use the CLI to push functions
99
- with the ` --admin-key $ADMIN_KEY ` and ` --url http://127.0.0.1:3210 ` flags .
116
+ You can run the dashboard locally with ` just rush install ` and ` npm run dev `
117
+ from ` npm-packages/dashboard-common ` .
100
118
101
- ## Push code to your backend
119
+ ### Use your backend.
102
120
103
121
Using your admin key, push code to your backend. Admin key should be kept secure
104
122
to just the developers who are administering the application on your backend.
0 commit comments