Cal.com Self-Hosted Redirects to localhost

Share
Workaround available Self-hosted (Cal.diy) Updated November 13, 2026Based on 3 user reportsHow we research

Quick answer

Set NEXT_PUBLIC_WEBAPP_URL and NEXTAUTH_URL to your public HTTPS domain with no trailing slash, then rebuild the Docker image because the URL is inlined at build time.

Most likely fix: Set the URLs and rebuild

How to fix it

Try these in order — the most common fix is first.

  1. 1. Set the URLs and rebuild

    1. Set NEXT_PUBLIC_WEBAPP_URL=https://cal.yourdomain.com (no trailing slash)
    2. NEXTAUTH_URL is optional if the above is set
    3. Rebuild the Docker image and restart
    Did this fix it?
  2. 2. Fix domain resolution in the container

    1. Add extra_hosts to the calcom service mapping your domain to 127.0.0.1
    2. This works for HTTP NEXTAUTH_URL; with HTTPS the reverse proxy must be inside the Docker network
    3. Do not point NEXTAUTH_URL at localhost; OAuth providers will redirect there
    Did this fix it?
  3. 3. Forward proxy headers

    1. Forward Host, X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-For from the proxy
    Did this fix it?

Symptoms

Login redirects to localhost:3000, or logs show next-auth CLIENT_FETCH_ERROR with getaddrinfo ENOTFOUND.

Why it happens

  • URLs still point to localhost
  • NEXT_PUBLIC_WEBAPP_URL baked in at build time
  • Container cannot resolve its own public domain
  • Reverse proxy not forwarding Host and X-Forwarded headers

This guide also covers

  • cal.com self hosted localhost
  • cal.com CLIENT_FETCH_ERROR
  • cal.com docker login redirect

Still not working?

If Cal.com keeps failing, you're not alone. See every Cal.com problem users report or the alternatives people switch to.

Done fighting Cal.com? Our small team builds your own Cal.com alternative, made for how you work. On your domain or hosted by us. Price agreed together.

Get a quote
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Cal.com errors

All 11 Cal.com errors and fixes →