#I can't deploy to self-hosted because I always get redirected to localhost instead of my custom URL

1 messages · Page 1 of 1 (latest)

worthy magnetBOT
#

Hi @arctic shell. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

This sounds like a mismatch between where your self‑hosted webapp is actually running and the URL you’re telling the CLI to use.

From the self‑hosting + CLI docs:

  • When self‑hosting, you must log in with the API URL of your self‑hosted instance using --api-url / -a, e.g.:

    npx trigger.dev@latest login -a <http://trigger.example.com>
    

    After that, you shouldn’t need to pass -a again for other commands. [Docker CLI usage]

  • The default local Docker setup exposes the webapp at <http://localhost:8030.> [Docker setup]

If the login flow is still sending you to <http://localhost:8030/...,> it means the CLI thinks your API URL is <http://localhost:8030> (or that’s what the instance is configured with), not <https://trigger.example.com.>

Based on the docs, here’s what you can do:

  1. Confirm which instance/profile you’re logged into

    npx trigger.dev@latest whoami
    # or, if using a profile:
    npx trigger.dev@latest whoami --profile self-hosted
    

    This will show the API URL the CLI is using. [Docker CLI usage]

  2. Relogin with the correct API URL and profile

    If whoami shows <http://localhost:8030,> log out and log back in with your real domain:

    npx trigger.dev@latest logout --profile self-hosted
    
    npx trigger.dev@latest login \
      --api-url <https://trigger.example.com> \
      --profile self-hosted
    

    [Docker CLI usage; CLI login options]

  3. Ensure your self‑hosted webapp is actually reachable at that URL

#

The docs assume the webapp is reachable at the URL you pass as --api-url. If your Docker setup is still only bound to localhost:8030, you’ll need to expose it (e.g. via reverse proxy / DNS) so <https://trigger.example.com> points to that webapp. The docs don’t give the exact reverse‑proxy steps, only that self‑hosting gives you control over “the URLs you expose the service on.” [Self-hosting overview]

If after doing this the browser still opens <http://localhost:8030/...,> the knowledge sources don’t provide more detailed troubleshooting steps; they only state that using --api-url (or TRIGGER_API_URL) is how you direct the CLI to your self‑hosted instance. [Docker CLI usage; Manual setup env vars]

If you can share what whoami shows for API URL, that’s the key next data point.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: