You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The self-hosting guide comes in two parts. The first part is a simple setup where you run everything on one server. In the second part, the webapp and worker components are split on two separate machines.
14
+
The self-hosting guide covers two alternative setups. The first option uses a simple setup where you run everything on one server. With the second option, the webapp and worker components are split on two separate machines.
13
15
14
16
You're going to need at least one Debian (or derivative) machine with Docker and Docker Compose installed. We'll also use Ngrok to expose the webapp to the internet.
15
17
18
+
## Support
19
+
20
+
It's dangerous to go alone! Join the self-hosting channel on our [Discord server](https://discord.gg/NQTxt5NA7s).
21
+
16
22
## Caveats
17
23
18
24
<Note>The v3 worker components don't have ARM support yet.</Note>
@@ -49,7 +55,7 @@ Should the burden ever get too much, we'd be happy to see you on [Trigger.dev cl
49
55
50
56
You will also need a way to expose the webapp to the internet. This can be done with a reverse proxy, or with a service like Ngrok. We will be using the latter in this guide.
51
57
52
-
## Part 1: Single server
58
+
## Option 1: Single server
53
59
54
60
This is the simplest setup. You run everything on one server. It's a good option if you have spare capacity on an existing machine, and have no need to independently scale worker capacity.
3. Log in to Docker Hub both locally and your server. For the split setup, this will be the worker machine. You may want to create an [access token](https://hub.docker.com/settings/security) for this.
2. Run the start script with the `worker` argument
218
+
2.**Startup.**Run the start script with the `worker` argument
205
219
206
220
```bash
207
221
./start.sh worker
208
222
```
209
223
210
-
2. Tunnelling is _not_ required for the worker components.
224
+
3.**Tunnelling.** This is _not_ required for the worker components.
225
+
226
+
4.**Registry setup.** Follow the [registry setup](/open-source-self-hosting#registry-setup) section but run the last command on the worker machine - note the container name is different:
By default, payloads over 512KB will be offloaded to S3-compatible storage. If you don't provide the required env vars, runs with payloads larger than this will fail.
OBJECT_STORE_ACCESS_KEY_ID="<r2 access key with read/write access to bucket>"
245
+
OBJECT_STORE_SECRET_ACCESS_KEY="<r2 secret key>"
246
+
```
247
+
248
+
Alternatively, you can increase the threshold:
249
+
250
+
```bash
251
+
# size in bytes, example with 5MB threshold
252
+
TASK_PAYLOAD_OFFLOAD_THRESHOLD=5242880
253
+
```
254
+
255
+
### Version locking
256
+
257
+
There are several reasons to lock the version of your Docker images:
258
+
-**Backwards compatibility.** We try our best to maintain compatibility with older CLI versions, but it's not always possible. If you don't want to update your CLI, you can lock your Docker images to that specific version.
259
+
-**Ensuring full feature support.** Sometimes, new CLI releases will also require new or updated platform features. Running unlocked images can make any issues difficult to debug. Using a specific tag can help here as well.
260
+
261
+
By default, the images will point at the latest versioned release via the `v3` tag. You can override this by specifying a different tag in your `.env` file. For example:
262
+
263
+
```bash
264
+
TRIGGER_IMAGE_TAG=v3.0.4
265
+
```
266
+
267
+
### Auth options
268
+
269
+
By default, magic link auth is the only login option. If the `RESEND_API_KEY` env var is not set, the magic links will be logged by the webapp container and not sent via email.
270
+
271
+
All email addresses can sign up and log in this way. If you would like to restrict this, you can use the `WHITELISTED_EMAILS` env var. For example:
272
+
273
+
```bash
274
+
# every email that does not match this regex will be rejected
It's currently impossible to restrict GitHub OAuth logins by account name or email like above, so this method is _not recommended_ for self-hosted instances. It's also very easy to lock yourself out of your own instance.
279
+
280
+
<Warning>Only enable GitHub auth if you understand the risks! We strongly advise you against this.</Warning>
211
281
212
-
## Checkpoint support
282
+
Your GitHub OAuth app needs a callback URL `https://<your_domain>/auth/github/callback` and you will have to set the following env vars:
283
+
284
+
```bash
285
+
AUTH_GITHUB_CLIENT_ID=<your_client_id>
286
+
AUTH_GITHUB_CLIENT_SECRET=<your_client_secret>
287
+
```
288
+
289
+
### Checkpoint support
213
290
214
291
<Warning>
215
292
This requires an _experimental Docker feature_. Successfully checkpointing a task today, does not
Checkpointing allows you to save the state of a running container to disk and restore it later. This can be useful for
220
297
long-running tasks that need to be paused and resumed without losing state. Think fan-out and fan-in, or long waits in email campaigns.
221
298
222
-
The checkpoints will be pushed to the same registry as the deployed images. Please see the [Registry setup](#registry-setup) section for more information.
299
+
The checkpoints will be pushed to the same registry as the deployed images. Please see the [registry setup](#registry-setup) section for more information.
223
300
224
-
### Requirements
301
+
####Requirements
225
302
226
303
- Debian, **NOT** a derivative like Ubuntu
227
304
- Additional storage space for the checkpointed containers
228
305
229
-
### Setup
306
+
####Setup
230
307
231
308
Underneath the hood this uses Checkpoint and Restore in Userspace, or [CRIU](https://github.com/checkpoint-restore/criu) in short. We'll have to do a few things to get this working:
232
309
@@ -329,16 +406,28 @@ git stash pop
329
406
./stop.sh && ./start.sh
330
407
```
331
408
332
-
## Version locking
409
+
## Troubleshooting
333
410
334
-
There are several reasons to lock the version of your Docker images:
335
-
-**Backwards compatibility.** We try our best to maintain compatibility with older CLI versions, but it's not always possible. If you don't want to update your CLI, you can lock your Docker images to that specific version.
336
-
-**Ensuring full feature support.** Sometimes, new CLI releases will also require new or updated platform features. Running unlocked images can make any issues difficult to debug. Using a specific tag can help here as well.
411
+
-**Deployment fails at the push step.** The machine running `deploy` needs registry access:
337
412
338
-
By default, the images will point at the latest versioned release via the `v3` tag. You can override this by specifying a different tag in your `.env` file. For example:
0 commit comments