Skip to content

Cannot get a client/server to register with my self-hosted NetBird instance #5542

Description

@reddwarf666

Describe the problem

I am trying to self-host NetBird but I face issues when I try to register servers

To Reproduce

netbird up --management-url https://netbird.example.com --setup-key 9ACAFB14-redacted

Expected behavior

A successful registration which shows in the Dashboard and have the server be part of the VPN network.

Are you using NetBird Cloud?

No, I use the Self-Hosted variant

NetBird version

netbird version : 0.66.2
Management : v0.66.2
Dashboard : v2.33.0

Is any other VPN software installed?

Yes, tailscale client is running on the servers.
I have to use that VPN because I cannot yet use NetBird to SSH into servers

Debug output

To help us resolve the problem, please attach the following anonymized status output

netbird status -dA

Daemon status: LoginFailed

Run UP command to log in with SSO (interactive login):

 netbird up 

If you are running a self-hosted version and no SSO provider has been configured in your Management Server,
you can use a setup-key:

 netbird up --management-url <YOUR_MANAGEMENT_URL> --setup-key <YOUR_SETUP_KEY>

More info: https://docs.netbird.io/how-to/register-machines-using-setup-keys

Create and upload a debug bundle, and share the returned file key:

netbird debug for 1m -AS -U

Results:
Error: failed to up: context deadline exceeded

Uploaded files are automatically deleted after 30 days.

Alternatively, create the file only and attach it here manually:

netbird debug for 1m -AS

Tried this one as well and got this message:

Error: failed to get status: failed while getting Management Service public key: failed while getting Management Service public key

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

I used the setup script as provided on the NetBird installation page
I'm running this on a VPS at Hetzner, the DNS is in CloudFlare.
I created an A record netbird.example.com and made sure the proxy setting is off on that record.
I previously used the cloud version of NetBird and I could connect that same server just fine with a setup key.
The proxy server (called Godoxy) and NetBird run on the same server in Docker and are both part of the same Docker network I created.
I also tried to use the same netbird up command on another server and I get the same results and error messages.
I also had to change the exposed ports in my compose file from 8080 and 8081 as it conflicted and so I used ports 9080 and 9081
I also disabled Tailscale on the server to see if that would help. To do this I temporarily allowed port 22 into my Hetzner server, this is now closed again of course. The results were the same

When I try and register a server with with the netbird up command:
netbird up --management-url https://netbird.example.com --setup-key 9ACAFB14-redacted

That command waits for a long time and finally stops with an error, a timeout it seems:
Error: daemon up failed: login backoff cycle failed: rpc error: code = Unknown desc = failed while getting Management Service public key

And the common theme in errors seems to be:
failed while getting Management Service public key

I can see in the proxy server log:

03-08 13:48 WRN not found: netbird.example.com:443 method=POST remote=<my public ip>:37046 url=/management.ManagementService/GetServerKey
03-08 13:48 WRN not found: netbird.example.com:443 method=POST remote=<my public ip>:52204 url=/management.ManagementService/GetServerKey
03-08 13:48 WRN not found: netbird.example.com:443 method=POST remote=<my public ip>:34010 url=/management.ManagementService/GetServerKey

This is my docker-compose file content:

networks:
  default:
    name: proxy
    external: true

services:

  netbird-dashboard:
    image: netbirdio/dashboard:latest
    container_name: netbird-dashboard
    restart: unless-stopped
    ports:
      - '127.0.0.1:9080:80'
    env_file:
      - ./dashboard.env
    labels:
      proxy.aliases: netbird
      proxy.netbird.port: 80
      proxy.netbird.scheme: http
      proxy.netbird.homepage: |
        name: NetBird
        icon: "@selfhst/netbird.svg"
        category: networking
      proxy.netbird.rules: |
        path glob(/signalexchange.SignalExchange/**) | path glob(/management.ManagementService/**) | path glob(/management.ProxyService/**) {
          route netbird-grpc
        }
        path glob(/relay*) | path glob(/ws-proxy/**) | path glob(/api*) | path glob(/oauth2*) {
          route netbird-api
        }
        default {
          pass
        }

  netbird-server:
    image: netbirdio/netbird-server:latest
    container_name: netbird-server
    restart: unless-stopped
    #networks: [netbird]
    ports:
      - '127.0.0.1:9081:80'
      - '3478:3478/udp'
    volumes:
      - ./data/netbird:/var/lib/netbird
      - ./config.yaml:/etc/netbird/config.yaml
    command: ["--config", "/etc/netbird/config.yaml"]
    labels:
      proxy.aliases: netbird-api, netbird-grpc
      proxy.netbird-api.port: 80
      proxy.netbird-api.scheme: http
      proxy.netbird-api.homepage: |
        show: false
        name: NetBird API
        icon: "@selfhst/netbird.svg"
      proxy.netbird-grpc.port: 80
      proxy.netbird-grpc.scheme: h2c
      proxy.netbird-grpc.homepage: |
        show: false
        name: NetBird gRPC
        icon: "@selfhst/netbird.svg"

And this is my config.yml file content:

# Combined NetBird Server Configuration (Simplified)
# Generated by getting-started.sh

server:
  listenAddress: ":80"
  exposedAddress: "https://netbird.example.com:443"
  stunPorts:
    - 3478
  metricsPort: 9090
  healthcheckAddress: ":9000"
  logLevel: "info"
  logFile: "console"

  authSecret: "redacted"
  dataDir: "/var/lib/netbird"

  auth:
    issuer: "https://netbird.example.com/oauth2"
    signKeyRefreshEnabled: true
    dashboardRedirectURIs:
      - "https://netbird.example.com/nb-auth"
      - "https://netbird.example.com/nb-silent-auth"
    cliRedirectURIs:
      - "http://localhost:53000/"

  reverseProxy:
    trustedHTTPProxies:
      - "172.30.0.10/32"
        
  store:
    engine: "sqlite"
    encryptionKey: "redacted"

And my dashboard.env file content:

# Endpoints
NETBIRD_MGMT_API_ENDPOINT=https://netbird.example.com
NETBIRD_MGMT_GRPC_API_ENDPOINT=https://netbird.example.com
# OIDC - using embedded IdP
AUTH_AUDIENCE=netbird-dashboard
AUTH_CLIENT_ID=netbird-dashboard
AUTH_CLIENT_SECRET=
AUTH_AUTHORITY=https://netbird.example.com/oauth2
USE_AUTH0=false
AUTH_SUPPORTED_SCOPES=openid profile email groups
AUTH_REDIRECT_URI=/nb-auth
AUTH_SILENT_REDIRECT_URI=/nb-silent-auth
# SSL
NGINX_SSL_PORT=443
# Letsencrypt
LETSENCRYPT_DOMAIN=none

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions