Requirements
- docker
- time
Set up your project
- Create a project dir and grab the latest
.env
template
- Generate secrets with
openssl rand -hex 16
for the following variables:
Do NOT just copy and paste this. Generate your own secrets instead!
.env (excerpt)
- Set
NODE_ENV
to production:
.env (excerpt)
Create a Supabase DB
Alternative: Self-host Supabase
- No account yet? Click here to complete onboarding
- Create a new project

- Make a note of your password, we’ll need it in a moment

- Wait until your project has finished setting up

- Navigate to
Project Settings -> Database
and copy your database connection string

- Paste it into your
.env
file, and append?schema=triggerdotdev
Don’t forget to replace
<PASSWORD>
with the project password you set in Step 3..env (excerpt)
- The complete file should look something like this now:
.env
Self-host Trigger.dev with docker compose
- Create a docker compose file in your project dir
docker-compose.yml
- Start your docker container
- Wait for the database setup to finish - this might take a while
- You should now be able to visit http://localhost:3030 and see this screen:

- Click “Continue with Email”, enter your email address and hit submit
- Grab the magic link from your terminal and proceed with account creation

- If everything went well, the
triggerdotdev
andgraphile_worker
schemas should now be populated. Check your Supabase DB dashboard to be sure:

- Congratulations, you’re all set up and ready to go with Supabase and Docker! 🚀
Bonus: Connection pooling
What is connection pooling?

Connection Pool - © 2023 Supabase, Apache License 2.0
PostgreSQL has a default connection limit of 100.
Enable connection pooling
- Copy and paste the connection string from earlier to
DIRECT_URL
.env (excerpt)
- Navigate to
Project Settings -> Database
and copy your connection pool URL

-
Paste it into your
.env
file next toDATABASE_URL
-
Append
?schema=triggerdotdev&pgbouncer=true
and insert your password
.env (excerpt)
- All done! You can now enjoy the benefits of connection pooling ⚡️