Skip to content

Installing DNClient Server

This guide describes how to install the dnclient binary and use it to enroll a computer into your Managed Nebula network.

On Debian-, RPM-, and Arch-based distributions, install dnclient from a package. The package puts the binary at /usr/bin/dnclient, registers a systemd service, and lets you pick up new versions through your normal system updates. On other distributions, use the standalone binary.

For Debian, Ubuntu, Linux Mint, Pop!_OS, and other APT-based distributions.

  1. Install curl and CA certificates. Minimal and desktop installs, including Ubuntu Desktop, may not include curl.
Terminal window
sudo apt-get update
sudo apt-get install -y ca-certificates curl
  1. Add the Defined Networking signing key. The install command creates the keyring directory if your distribution doesn’t already have one.
Terminal window
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://dl.defined.net/gpg.asc -o /etc/apt/keyrings/defined-net.asc
  1. Add the repository:
Terminal window
echo "deb [signed-by=/etc/apt/keyrings/defined-net.asc] https://dl.defined.net/stable/apt stable main" \
| sudo tee /etc/apt/sources.list.d/defined-net.list > /dev/null
  1. Install dnclient and enable the service so it starts on boot:
Terminal window
sudo apt-get update
sudo apt-get install dnclient
sudo systemctl enable --now dnclient

With the service running, enroll the host, replacing <ENROLL_CODE> with the enrollment code you receive from the admin panel after creating or re-enrolling the host.

Terminal window
sudo dnclient enroll -code <ENROLL_CODE>

Confirm the service is running and the host has a certificate:

Terminal window
systemctl status dnclient
sudo dnclient info

Your computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.

The packaged service takes its settings from environment variables, which it reads from a file whose location depends on the distribution:

DistributionEnvironment file
Debian, Ubuntu, and other APT-based/etc/default/dnclient
RHEL, Fedora, and other RPM-based/etc/sysconfig/dnclient
Arch-based/etc/conf.d/dnclient

The package ships this file with every setting commented out, so the defaults below apply until you edit it. A named instance reads its own file with the instance name appended, such as /etc/default/dnclient.production for dnclient@production.service. That file is optional and the package doesn’t create it.

VariableDefaultDescription
DNCLIENT_STATE_DIR/var/lib/definedDirectory holding enrollment state. A named instance stores its state in a subdirectory, such as /var/lib/defined/production/.
DNCLIENT_LOGunsetFile to write logs to. When unset, logs go to stdout, where journald captures them.
DNCLIENT_SERVERhttps://api.defined.netAPI server used for enrollment, certificate rotation, and configuration updates.
DNCLIENT_NAMEunsetInstance name. The template unit sets this per instance, so enable dnclient@<name>.service rather than setting it here.

Restart the service to apply a change:

Terminal window
sudo systemctl restart dnclient

Only the service reads this file. dnclient commands you run yourself use the defaults unless you set the variable in your own shell or pass the matching flag (-config, -log, -server, -name).

Use this method on distributions the package repository doesn’t cover, or where you don’t want a system package. You’ll need to repeat these steps by hand for each upgrade.

  1. Obtain the URL for the latest version of the dnclient binary for your architecture from https://admin.defined.net/downloads.
  2. From a directory where you wish to download dnclient, run the following curl command, replacing <DL_URL> with the link you obtained from the downloads page.
Terminal window
curl -O <DL_URL>
  1. Make dnclient executable:
Terminal window
sudo chmod +x dnclient
  1. Install dnclient as a service. This will use the dnclient binary in its current directory, so move it first if you’d like it somewhere else.
Terminal window
sudo ./dnclient install
  1. Start dnclient. As a service, it will be started automatically on future reboots.
Terminal window
sudo ./dnclient start
  1. Enroll the host, replacing <ENROLL_CODE> with the enrollment code you receive from the Managed Nebula admin panel after creating or re-enrolling the host.
Terminal window
sudo ./dnclient enroll -code <ENROLL_CODE>

Your computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.

  1. Install the dnclient-server cask:
Terminal window
brew install --cask dnclient-server
  1. Install dnclient as a service, start it, and enroll the host, replacing <ENROLL_CODE> with the enrollment code you receive from the Managed Nebula admin panel after creating or re-enrolling the host. The service runs the binary from Homebrew’s bin directory, so brew upgrade --cask dnclient-server updates it in place.
Terminal window
sudo "$(brew --prefix)/bin/dnclient" install
sudo "$(brew --prefix)/bin/dnclient" start
sudo "$(brew --prefix)/bin/dnclient" enroll -code <ENROLL_CODE>

For macOS, we offer DNClient Server in two formats—a standalone binary and packaged into a .dmg. The version in the .dmg is suitable for use in offline installations, since the signing information does not need to be retrieved from Apple servers. Otherwise, they are identical in functionality.

  1. Obtain the URL for the latest version of the dnclient binary or .dmg from https://admin.defined.net/downloads.
  2. From a directory where you wish to download dnclient, run the following curl command, replacing <DL_URL> with the link you obtained from the downloads page.
Terminal window
curl -O <DL_URL>
  1. If you downloaded DNClient-Server.dmg, mount the image and copy the binary to your filesystem. Otherwise if you downloaded the binary directly, make it executable:
Terminal window
sudo chmod +x dnclient
  1. Install dnclient as a service. This will use the dnclient binary in its current directory, so move it first if you’d like it somewhere else.
Terminal window
sudo ./dnclient install
  1. Start dnclient. As a service, it will be started automatically on future reboots.
Terminal window
sudo ./dnclient start
  1. Enroll the host, replacing <ENROLL_CODE> with the enrollment code you receive from the Managed Nebula admin panel after creating or re-enrolling the host.
Terminal window
sudo ./dnclient enroll -code <ENROLL_CODE>

Your computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.

If you use winget, run the following in a PowerShell terminal started as Administrator, replacing <ENROLL_CODE> with the enrollment code you receive from the Managed Nebula admin panel after creating or re-enrolling the host. The package installs dnclient as a service and starts it, and winget upgrade DefinedNet.DNClient.Server updates it.

Terminal window
winget install DefinedNet.DNClient.Server
& 'C:\Program Files\Defined Networking\DNClient\dnclient.exe' enroll -code <ENROLL_CODE>
  1. Find the latest version of the DNClient-Server.msi installer for your architecture from https://admin.defined.net/downloads.

  2. Download the installer directly from the downloads page, or in a PowerShell terminal started as Administrator on the host, run the provided curl command, replacing <DL_URL> with the link from the downloads page.

Terminal window
curl.exe -O <DL_URL>
  1. The MSI you downloaded can be double-clicked to be run and will install DNClient as a service. This will install dnclient, set it up as a service, and start it.

  2. In a PowerShell terminal run as administrator, run the following command to enroll the host, replacing <ENROLL_CODE> with the enrollment code you receive from the Managed Nebula admin panel after creating or re-enrolling the host.

Terminal window
& 'C:\Program Files\Defined Networking\DNClient\dnclient.exe' enroll -code <ENROLL_CODE>

Your computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.

The definednet/dnclient image runs dnclient in a container on Linux hosts. It carries the same release as the packages on dl.defined.net.

  1. Install cosign v3 or newer.

  2. Verify the image with the Defined Networking Docker signing key. Images for DNClient 1.0.0 and later are signed. To use a specific version, verify and run that tag instead of latest.

Terminal window
cosign verify --key https://dl.defined.net/docker-cosign.pub definednet/dnclient:latest
  1. Run the container, replacing <ENROLL_CODE> with the enrollment code you receive from the Managed Nebula admin panel after creating or re-enrolling the host. NET_ADMIN lets the container create the tun device, and the defined volume keeps the host’s enrollment across restarts, so DN_ENROLLMENT_CODE is only needed on the first run.
Terminal window
docker run -d \
--name dnclient \
--network host \
--cap-add NET_ADMIN \
--volume defined:/etc/defined \
--env DN_ENROLLMENT_CODE="<ENROLL_CODE>" \
--restart unless-stopped \
definednet/dnclient:latest

Your computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.