How to Self Host V2 the Right Way


2 min read

If you're looking to use, and want to use V2 you're going to want to self host since they aren't offering new customers to the V2 cloud platform.

First create an account at and create a new project called trigger-v2.

Then follow the guide on the trigger docs for how to deploy to with a few adjustments.

  1. Go to and get two UUIDs. In the name field paste the UUId twice. We do this because the deployed instance is publicly assessible to anyone on the web. So we are going to use security by obsucation to fudge the URL as much as possible to prevent people from landing our page.

  2. Instead of pasting the environment variables manually in, add them to your doppler project and then use the integrations feature to synchronize it with your project.

  3. Go to to get a serverless postgres database. Use this as the database environment variable.

  4. Create a github app and link it to your project.

Once its deployed, you can just go the deployed URL and login in with your github.

Extras: Next.js Integration

For next.js, you will probably want to integrate status hooks in your project. However the default settings won't work anymore because we are now self hosting.

Logically we will want to change the API url parameter in our TriggerProvider. However if we just use the same url as our deployed instance, we are going to immediately lose our security by obfuscation, since anybody who lands on our web page can open the next console and see that URL.

Instead what we need is some kind of reverse proxy. We can leverage Next.js rewrites to do this.

First change your apiUrl to /trigger-v2

Then in your next.config.js, add a rewrites parameter with source: /trigger-v2/:api* and destination: ${env.TRIGGER_API_URL}/:api* respectively.

Now your trigger react hooks will get reverse proxied to your deployed instance.

If you liked this article feel free to drop me a DM or email!