Skip to content

How to update domain name after deployment on server? #1780

@qpding

Description

@qpding

Request / Question
This is not exactly a problem but a question: How do I update the domain name after successful deployment on a VPS?

Background
I have successfully got Netbird running on my server on Hetzner using getting-started-with-zitadel.sh with a free domain name. Everything seems to be working fine. Now I want to change to another lasting domain name of my own. What should I do to achieve this change?

Attempted solution
I took a look at all the files in the folder, including dashboard.env, docker-compose.yml, management.json etc, then took a wild guess to change all the old domain names that appear in these files to the new one. However this leads to a message when I tried to visit my site:
The requested redirect_uri is missing in the client configuration. If you have any questions, you may contact the administrator of the application.

Activity

yunylz

yunylz commented on Apr 21, 2024

@yunylz

this issue happens for me on compose ubuntu 22.04

shauryagoel

shauryagoel commented on Jul 15, 2024

@shauryagoel

Hi, I am also facing the same issue. Were you able to use the old domain again? I tried it and start getting this error-

Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://<domain>/.well-known/openid-configuration Get "https://<domain>/.well-known/openid-configuration": remote error: tls: internal error

@mlsmaycon please help here.

cannonfodda

cannonfodda commented on Sep 9, 2024

@cannonfodda

Hi @qpding @shauryagoel did you ever get a resolution to this one ? I'm currently stuck with the same issue and have no path to resolution. I though that it might be my zitadel set up that was causing the issue but I have switched over to using the hosted service from zitadel.com and still have the same problem with trying to connect an authenticated peer.

Djpd66

Djpd66 commented on Nov 9, 2024

@Djpd66

im to have this problem. how to change zitadel+netbird domain after installed.

calum-mcfarlane

calum-mcfarlane commented on Feb 28, 2025

@calum-mcfarlane

I'd also like to be able to change the name. It's a bit of a shame that even though you provide the domain name to the install script, you still get .netbird.selfhosted as the domain? I wonder if there is a technical or business reason why it works that way...

ws23xt

ws23xt commented on Mar 27, 2025

@ws23xt

I noticed that even after updating the old domain name in the database and configuration files, I was still encountering the same issue. Luckily, I hadnโ€™t deleted the old domain name, so I could switch back and forth between the two domains by modifying the browser URI. Eventually, I discovered that I needed to add the new domain as a redirect in Zitadel -> Projects -> Netbird -> General -> Dashboard -> Redirect Settings. Once I did that, the "redirect_uri is missing" error was resolved.

graphixillusion

graphixillusion commented on Apr 10, 2025

@graphixillusion

I need to change the domain too: is there any way to reconfigure it without reinstalling or not?

virzen

virzen commented on Jul 6, 2025

@virzen

If you've already migrated to the new domain, try going to <your-domain>/ui/login directly, perform login and then go to Zitadel -> Projects -> Netbird -> General -> Dashboard -> Redirect Settings to change the redirects, this worked for me. The /ui/login endpoint doesn't seem to have the redirect login.

If that that doesn't work for you, you might try your luck with API. It didn't work for me in the end, but might for someone. In management.json you will find credentials of Netbird service account. Use that to get PAT, then look into the API how to access an application withing a project. I had no luck with that.

Example script to get project info from the machine you're hosting netbird on, from catalog when docker-compose.yml and management.json files are.

export CUSTOM_DOMAIN="<your-domain>"
export CLIENT_ID=$(jq -r '.IdpManagerConfig.ClientConfig.ClientID' management.json)
export CLIENT_SECRET=$(jq -r '.IdpManagerConfig.ClientConfig.ClientSecret' management.json)
export TOKEN=$(
  curl --request POST \
    --url https://$CUSTOM_DOMAIN/oauth/v2/token \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data grant_type=client_credentials \
    --data 'scope=urn:zitadel:iam:org:project:id:zitadel:aud' \
    --user "$CLIENT_ID:$CLIENT_SECRET" | jq -r '.access_token'
  )


curl --http2 -X POST \
  https://$CUSTOM_DOMAIN/management/v1/projects/_search \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "offset": 0,
      "limit": 100,
      "asc": true
    }
  }'

Discovered after copious number of attempts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cannonfodda@shauryagoel@virzen@ws23xt@yunylz

        Issue actions