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

Open
opened 2025-11-20 05:17:03 -05:00 by saavagebueno · 8 comments
Owner

Originally created by @qpding on GitHub (Apr 1, 2024).

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.

Originally created by @qpding on GitHub (Apr 1, 2024). **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.`
saavagebueno added the feature-request label 2025-11-20 05:17:03 -05:00
Author
Owner

@yunylz commented on GitHub (Apr 21, 2024):

this issue happens for me on compose ubuntu 22.04

@yunylz commented on GitHub (Apr 21, 2024): this issue happens for me on compose ubuntu 22.04
Author
Owner

@shauryagoel commented on GitHub (Jul 15, 2024):

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.

@shauryagoel commented on GitHub (Jul 15, 2024): 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.
Author
Owner

@cannonfodda commented on GitHub (Sep 9, 2024):

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.

@cannonfodda commented on GitHub (Sep 9, 2024): 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.
Author
Owner

@Djpd66 commented on GitHub (Nov 9, 2024):

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

@Djpd66 commented on GitHub (Nov 9, 2024): im to have this problem. how to change zitadel+netbird domain after installed.
Author
Owner

@calum-mcfarlane commented on GitHub (Feb 27, 2025):

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...

@calum-mcfarlane commented on GitHub (Feb 27, 2025): 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...
Author
Owner

@ws23xt commented on GitHub (Mar 27, 2025):

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.

@ws23xt commented on GitHub (Mar 27, 2025): 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.
Author
Owner

@graphixillusion commented on GitHub (Apr 9, 2025):

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

@graphixillusion commented on GitHub (Apr 9, 2025): I need to change the domain too: is there any way to reconfigure it without reinstalling or not?
Author
Owner

@virzen commented on GitHub (Jul 5, 2025):

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.

@virzen commented on GitHub (Jul 5, 2025): 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. ```sh 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#757