Custom domains and the Instance not found error in Zitadel

How to set ExternalDomain, ExternalPort and ExternalSecure, rerun setup safely, pass Host headers through proxies and add extra domains, so a self-hosted Zitadel stops returning Instance not found.

On this page

Why Zitadel returns Instance not found after a domain change

A self-hosted Zitadel that works on localhost but returns Instance not found once it sits behind a public hostname usually has a domain mismatch, not a broken installation. Zitadel resolves the instance from the domain a request arrives on, and it compares that domain with the external domain settings it was configured with. When the public URL, the configured external values and the Host header the server receives do not agree, the lookup fails and the request never reaches a working instance. Localhost succeeds because the requested host and the configured values happen to match there.

Teams meet this work in a few predictable situations: the first install, a move to a new public domain, placing Zitadel behind a reverse proxy or CDN that rewrites hostnames, and adding customer-facing domains for multi-tenant use. Each of these changes at least one of the inputs Zitadel compares. Before changing anything, confirm which external domain, port and TLS mode your deployed version expects, and check the current configuration reference for that release, since setting names and the way the setup phase reads them can change between versions. Confirm too whether your proxy forwards the original Host header unchanged to Zitadel.

Run the check in order. Compare the public URL users type with the values Zitadel was started with, confirm that the proxy passes the expected host through, and then test a request with the same host header that the proxy sends. If you change the external settings, plan to rerun setup so stored configuration matches the new values, and record which domain is primary and which are extra. The sections that follow cover each setting and the steps to add domains.

Domain settings and when each one fits

This table compares the external address settings Zitadel uses to build its URLs and match incoming requests, along with proxy and additional domain options. Read each row as a question: which setting controls it, when it is the right choice, and which mistake usually produces the Instance not found error. Confirm every default and key name against the configuration reference for your exact Zitadel version before you set them.

SettingWhat it controlsUse it whenCommon mistake
ExternalDomainThe public host name Zitadel uses for its issuer, endpoints and generated linksSet once to the exact name users type in the browser, such as the name on your TLS certificateLeaving the internal service name or a localhost value, so tokens and redirects point somewhere users cannot reach
ExternalPortThe public port included in generated URLsYour public entry point uses a non-standard port, or a proxy exposes Zitadel on a port other than the defaultSetting it to the container or pod port instead of the port clients actually connect to
ExternalSecureWhether generated URLs use httpsUsers reach Zitadel over TLS, which is the normal production case, including when TLS terminates at a proxyLeaving it false behind an HTTPS proxy, so discovery documents and redirects use http and login fails in the browser
Proxy and forwarded headersHow the Host, X-Forwarded-Host and related headers from your reverse proxy are read when routing requests to an instanceA reverse proxy, WAF or CDN sits in front of Zitadel and rewrites or forwards the host nameThe proxy passes the upstream service name as Host, so Zitadel cannot match the request to the instance and returns Instance not found
Setup rerun after changesWhether the stored instance configuration reflects the new external valuesYou change ExternalDomain, ExternalPort or ExternalSecure after the first setup has already runEditing the configuration file only, then restarting, and expecting the stored instance to pick up the new values
Additional domains via the system APIExtra host names registered against an existing instance so that more than one address is acceptedUsers reach the same instance through a second name, such as a staging alias or a customer-facing custom domainAdding a domain for DNS that does not yet resolve or without a matching certificate and proxy route, then debugging the wrong layer
Instance selection by hostWhich instance a request is routed to, based on the host name it carriesYou run more than one instance or virtual tenant and each needs its own host nameTwo instances or domains sharing one host name, so requests go to an unexpected instance
Reverse proxy TLS modeWhether TLS ends at the proxy and what protocol the proxy uses toward ZitadelTLS terminates at a proxy and gRPC or HTTP/2 traffic reaches Zitadel over an upstream connectionMixing ExternalSecure, proxy TLS and upstream protocol settings so each layer disagrees about the scheme

How to set the external domain and rerun setup

This sequence aligns the public hostname, scheme and port that Zitadel advertises with what the reverse proxy delivers, so the instance resolves, issues correct tokens and serves its login and Console pages from one consistent address.

  1. Fix the public hostname and scheme

    Before changing anything, decide the exact public address users and applications will use, such as the hostname, whether it is served over HTTPS, and which port is public. Write these three values down and get the owner of DNS and certificates to confirm them. Do not change the hostname later without repeating every step below, because issuer URLs and redirect URIs are derived from it. Done when the team agrees on one hostname, one scheme and one port in writing.

  2. Set the external domain settings

    In the configuration used by your deployment method, set ExternalDomain to the public hostname, ExternalPort to the public port, and ExternalSecure to true when users reach Zitadel over HTTPS. In Kubernetes these values sit in the Helm values, in Docker Compose they are environment variables on the Zitadel service, and in a binary install they are keys in the YAML configuration file. Keep the three values identical across the init, setup and start phases. Done when a diff of the configuration shows the same three values everywhere they appear.

  3. Forward the correct Host header at the proxy

    Configure the reverse proxy, ingress or gateway in front of Zitadel so it forwards the public Host header unchanged to the Zitadel API and login services, and passes the original scheme so Zitadel knows the request arrived over HTTPS. Route HTTP/2 traffic as your proxy guide describes. Confirm that the proxy does not rewrite the Host value to an internal service name. Done when a request sent to the public hostname reaches Zitadel with the same Host value in the logs.

  4. Rerun the setup phase after the change

    Changes to the external domain are applied during setup, so run the setup phase again after updating the configuration. In Kubernetes, upgrade the Helm release so the setup job runs with the new values. In Docker Compose, rerun the setup service. For a binary install, run the setup command with the updated configuration file. Review the setup output for errors about the instance or domain. Done when setup finishes without errors and the log names the new external domain.

  5. Restart the running services

    Restart the Zitadel API and Login services so they load the new configuration and stop serving the old domain. In Kubernetes, confirm the rollout completes for every replica. In Compose, recreate the containers. For systemd, restart the units in the start phase. Keep the masterkey and database settings unchanged during this restart. Done when all replicas report ready and none still serve requests under the previous hostname.

  6. Verify the discovery endpoint issuer

    Request the OpenID Connect discovery document at the public hostname, under the well-known configuration path defined by the OpenID Connect specification. Check that the issuer value matches the public scheme, hostname and port exactly, with no internal service name and no unexpected port. Check that the authorization and token endpoints also use the public address. Done when the issuer in the response matches the value agreed in the first step.

  7. Verify the login and Console URLs

    Open the hosted login page and the Console in a browser using the public hostname. Sign in as an administrator, confirm the Console loads its assets, and confirm the login redirect returns to the same host. Then test one OIDC sign-in from a test application registered against the public address. If the instance returns an Instance not found message, compare the Host header seen by Zitadel with the configured external domain and return to the proxy step. Done when sign-in completes and the Console opens without redirects to another host.

How a request reaches the right instance

The request starts in the browser and reaches the reverse proxy, which sits on the trust boundary and forwards the public Host header to Zitadel. Zitadel resolves the instance from that Host header and compares it with the configured ExternalDomain, ExternalPort and ExternalSecure values. When the values do not match, the request is answered with Instance not found, so check that the proxy forwards the original Host and that these settings match the public address exactly.

Host header matching decides which instance serves each request.

Host header handling behind proxies and CDNs

Zitadel resolves each request to an instance and organization largely by the hostname the client used, so the proxy, load balancer or CDN must pass the public Host header through unchanged to Zitadel. If the edge rewrites Host to an internal service name such as zitadel.zitadel.svc or a container name, Zitadel looks up an instance that does not match that name and returns the Instance not found error. This is the most common cause of the error once ExternalDomain is correct, because the setting and the request then disagree. Check the rewrite rules in every layer, including ingress controllers, Gateway API routes, WAF and CDN origin settings, since a default upstream host rewrite in any one of them is enough to break lookups.

Treat the edge as part of the domain design. Decide which layer terminates TLS, then set ExternalSecure to match what clients see, not what the internal hop uses. If the CDN or load balancer terminates TLS and talks plain HTTP or h2c to Zitadel, Zitadel must still generate https URLs for its discovery document, redirects and login pages, so ExternalSecure is usually true while the internal connection is unencrypted. Forwarded headers such as X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-For are how the proxy reports the original request, and you should confirm with the Zitadel proxy guides which of them your chosen proxy sets and which of them Zitadel reads in your version.

Test with the exact hostname clients use, not an IP address, a port-forwarded address or a name from inside the cluster. Send a request with curl using the public hostname and inspect the response headers and the OIDC discovery document at /.well-known/openid-configuration for the issuer URL. Then repeat the test through each hop, including the CDN edge, so you can see where the Host value changes. Record the header behavior of the proxy version you run, because a proxy upgrade or a new CDN rule can silently change it. Ask your proxy vendor and the Zitadel proxy guides to confirm the header handling before you rely on it in production.

Security and operational risks of domain changes

Domain values feed into token issuers, redirect targets, certificate names and the routing that decides which Zitadel instance answers a request. A change that looks small can break sign-in for every user or expose administrative paths that were never meant to be public, so the risks below should be reviewed before any hostname is changed.

Token issuer mismatch after a change

Zitadel places its configured external domain into the issuer claim of the tokens it signs. If the domain changes but relying applications still hold the old issuer URL in their discovery or validation settings, they reject tokens that were valid a minute earlier. Before the change, list every application and API that validates Zitadel tokens, and confirm each one can accept the new issuer value at the same time the domain changes.

Redirect loops from mismatched settings

When ExternalDomain, ExternalPort or ExternalSecure disagree with the address users actually type, login pages can redirect back to themselves or to an unreachable host. The loop often appears only in one browser or behind one proxy path. Test the full login flow from a clean session for each public hostname after the change, including the logout and callback steps.

Console and admin paths on unintended hostnames

A proxy that routes a new hostname to the Zitadel instance may also expose the Console and administrative API paths on that name. Anyone who can reach the name can then attempt administrator sign-in. Keep admin surfaces on a hostname restricted to administrators' networks, and check the proxy rules for every host that now resolves to Zitadel.

Certificate names that no longer match

TLS certificates bind to specific hostnames. After a domain change, the certificate served by the proxy or ingress may not cover the new name, and clients that validate strictly will fail before any Zitadel code runs. Confirm that every new hostname is on a certificate that is issued, installed and renewing, and that the certificate chain is valid for the scheme and port Zitadel advertises.

Changing domains without rerunning setup

Some instance and domain settings are applied during setup, so editing the configuration file alone may leave the running instance with values that do not match. Treat a domain change as a change that needs a planned setup rerun, with the exact steps written down. Confirm with the Zitadel self-hosting documentation which settings require setup to run again before you schedule the change.

Self-hosting docs

Change control and staging tests

Domain values should live in version-controlled configuration with a named approver, a rollback value and a record of who changed what. Rehearse the change in a staging environment that uses the same proxy, certificates and hostnames pattern as production. Staging catches issuer and redirect problems that a unit test or a local login will never show.

Monitoring login errors after a change

Watch authentication failures, token validation errors and HTTP 4xx or 5xx responses on the login and Console hosts for at least the first hours after the change. Compare error rates with the pre-change baseline. A rise in the Instance not found error or in issuer validation failures usually points to a missed domain value or a proxy that still forwards an old Host header.

Questions teams ask about custom domains in Zitadel

How long does a domain change in Zitadel take?

The duration depends on how many systems point at the old domain, not on Zitadel itself. The Zitadel configuration change and setup rerun are usually the short part. The longer work is updating DNS records, certificates, reverse proxy routes, OIDC redirect URIs in every client application, and any saved issuer URLs in downstream services. Each of these has its own change window and approval path in most organizations. Ask any partner to list every dependency and its owner before agreeing on a timeline, and confirm the expected duration against the Zitadel self-hosting documentation for your version.

Can our own team change the Zitadel domain settings without a partner?

Often yes, if your team already runs Zitadel and has access to the configuration, the database and the proxy. The steps are a configuration change to ExternalDomain, ExternalPort and ExternalSecure, a setup rerun and a proxy check. The risk is in the details: an incorrect Host header rule, a missed client redirect URI or a certificate that does not match the new name can lock users out of login. A partner can review the plan, run it in staging first and document the rollback, which is useful when your team has not done this before.

What do we need from our DNS, certificate and proxy teams?

Each team owns a part of the change, and the plan should name them before work starts. The DNS team creates the new records and confirms propagation. The certificate team issues a certificate that covers every hostname Zitadel will answer on, including the console and login hosts if they differ. The proxy or gateway team updates routes and forwards the correct Host and forwarded headers. Your application owners then update redirect URIs and post-logout URIs. Ask for a single change record that lists each host, certificate, route and client affected.

What does a partner scope and quote for a domain change?

A quote follows from a written scope, so expect the partner to ask questions before pricing. Typical scope items include an inventory of domains and clients, a review of your current proxy and TLS setup, a staging rehearsal, the production change window, a rollback plan, verification of login and token flows, and handover documentation. The effort rises with the number of client applications, the number of environments, and whether you run Zitadel on Kubernetes, Docker Compose or a binary. Ask for each item to be listed separately so you can see what is one-time work and what is recurring support.

Is it safe to rerun Zitadel setup on existing data?

Rerunning setup is generally a supported step after configuration changes, but it must be checked against the version you run and against your own environment before production. Take a verified database backup first, record the current configuration, and confirm in the self-hosting documentation what the setup phase changes. Test the rerun on a copy of production data. After the run, verify that existing users can sign in, that issued tokens validate and that the admin console loads. Treat any unexpected change in the logs as a stop condition.

How do extra customer domains affect cost and support?

Extra domains add work in three places: proxy routing and certificates for each hostname, a Zitadel configuration entry in the system API for the additional domain, and testing of each login path. Cost rises with the number of domains, how often they change, and how many organizations depend on them. Support effort grows when customers bring their own domains, because each change needs DNS validation, certificate handling and client updates. Ask a partner to describe a repeatable onboarding procedure and who performs it, and confirm which steps your own team will need to run after handover.

Why does Zitadel return Instance not found after a proxy change?

This error usually means the hostname or Host header reaching Zitadel does not match a domain the instance knows about. Check that the proxy forwards the original Host header, that the ExternalDomain, ExternalPort and ExternalSecure values match the public address users type, and that any extra domain was added through the system API. A mismatch in the port or scheme can produce the same symptom. Compare the request headers at the proxy with the configured values, and confirm the exact behavior against the documentation for your Zitadel version.

Adding extra domains through the system API

Add a second domain only when a specific requirement justifies it, such as a vanity login domain that a customer or partner expects to see in the browser, or a separate domain for a product brand that shares one Zitadel deployment. Every extra domain adds a DNS record, a TLS certificate, a proxy route and a verification step, so each one needs an owner and a reason. The primary ExternalDomain set during setup remains the default for the instance, and extra domains are registered alongside it rather than replacing it. Confirm with your Zitadel version's documentation how the system API is enabled and which administrator credentials it accepts before you plan the change.

Extra domains are registered through the system API with administrator credentials that have permission to manage instance domains. Call the API from a controlled host, record the request and response, and keep the credentials out of shell history and CI logs. Each domain maps to the instance that receives requests for it, and the instance then resolves organizations and their projects and users. A domain therefore selects a tenant boundary, so a vanity domain should point to the instance and organization your customer is meant to reach, and nowhere else. Check that the organization served through each domain has the identity provider and branding you intend, because an organization reached through the wrong domain is a common source of confusion.

Verify each domain end to end before a customer uses it. Resolve the DNS name from outside your network, confirm the certificate chain and expiry, load the login page, complete a sign-in and check that the token issuer and redirect URIs match the domain. Repeat the test for every proxy path that serves the domain, including the console. Record in a register who owns each DNS zone, who renews each certificate and where the system API credentials are stored, along with the date each domain was added and the test evidence. Review the register when staff change, when a certificate renewal is due and before any proxy or ingress change, because a forgotten domain is the most likely cause of a future Instance not found error.

How DeployOpen scopes and delivers custom domain work

DeployOpen treats the domain configuration of a self-hosted Zitadel as part of the platform design, not a last step. We agree the external domain, port and TLS model with your team, apply and verify the settings in your environment, and document what each proxy and client must send so the Instance not found error does not come back after a change.

How we scope

  • Written scope lists every public hostname Zitadel must answer on, including the console, login and any extra customer domains.
  • Scope records how TLS terminates, whether a reverse proxy or load balancer sits in front, and which Host headers it forwards.
  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we build

  • We set ExternalDomain, ExternalPort and ExternalSecure to match the public URL users actually reach, then rerun setup against that configuration.
  • We test proxy Host header handling with direct requests and with requests routed through the proxy, comparing the instance each one resolves to.
  • We configure extra domains through the system API and verify each domain resolves to the intended instance before go-live.

How we hand over

  • Handover includes a record of the final domain settings, the proxy configuration and the steps used to rerun setup safely.
  • Runbooks describe how to add or change a domain, what to check afterwards and which changes require rerunning setup.
  • Your team receives test requests and expected responses so future changes can be verified without DeployOpen involved.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, including reviews of domain changes before they reach production.
  • Support can cover proxy changes, new customer domains and Zitadel version upgrades that touch external URL settings.
  • Ask your DeployOpen contact to confirm response scope and change handling in the written agreement before work starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.