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.
Install from the package repository
Section titled “Install from the package repository”For Debian, Ubuntu, Linux Mint, Pop!_OS, and other APT-based distributions.
- Install
curland CA certificates. Minimal and desktop installs, including Ubuntu Desktop, may not includecurl.
sudo apt-get updatesudo apt-get install -y ca-certificates curl- Add the Defined Networking signing key. The
installcommand creates the keyring directory if your distribution doesn’t already have one.
sudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://dl.defined.net/gpg.asc -o /etc/apt/keyrings/defined-net.asc- Add the repository:
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- Install
dnclientand enable the service so it starts on boot:
sudo apt-get updatesudo apt-get install dnclientsudo systemctl enable --now dnclientFor RHEL, Fedora, Rocky Linux, Alma Linux, CentOS Stream, Amazon Linux, and other dnf-based distributions.
- Add the repository:
sudo curl -fsSL https://dl.defined.net/stable/rpm/defined-net.repo -o /etc/yum.repos.d/defined-net.repo- Install
dnclientand enable the service so it starts on boot:
sudo dnf install dnclientsudo systemctl enable --now dnclientFor Arch Linux, Manjaro, EndeavourOS, and other Arch-based distributions, Defined Networking maintains the dnclient package in the Arch User Repository.
- Install the package with your AUR helper, or build it manually with
makepkg:
# with an AUR helperyay -S dnclient
# or manuallygit clone https://aur.archlinux.org/dnclient.gitcd dnclientmakepkg -si- Enable the service so it starts on boot:
sudo systemctl enable --now dnclientWith 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.
sudo dnclient enroll -code <ENROLL_CODE>Confirm the service is running and the host has a certificate:
systemctl status dnclientsudo dnclient infoYour computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.
Service configuration
Section titled “Service configuration”The packaged service takes its settings from environment variables, which it reads from a file whose location depends on the distribution:
| Distribution | Environment 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.
| Variable | Default | Description |
|---|---|---|
DNCLIENT_STATE_DIR | /var/lib/defined | Directory holding enrollment state. A named instance stores its state in a subdirectory, such as /var/lib/defined/production/. |
DNCLIENT_LOG | unset | File to write logs to. When unset, logs go to stdout, where journald captures them. |
DNCLIENT_SERVER | https://api.defined.net | API server used for enrollment, certificate rotation, and configuration updates. |
DNCLIENT_NAME | unset | Instance 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:
sudo systemctl restart dnclientOnly 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).
Install the standalone binary
Section titled “Install the standalone binary”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.
- Obtain the URL for the latest version of the
dnclientbinary for your architecture from https://admin.defined.net/downloads. - From a directory where you wish to download
dnclient, run the followingcurlcommand, replacing<DL_URL>with the link you obtained from the downloads page.
curl -O <DL_URL>- Make
dnclientexecutable:
sudo chmod +x dnclient- Install
dnclientas a service. This will use thednclientbinary in its current directory, so move it first if you’d like it somewhere else.
sudo ./dnclient install- Start
dnclient. As a service, it will be started automatically on future reboots.
sudo ./dnclient start- 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.
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.
Install with Homebrew
Section titled “Install with Homebrew”- Install the
dnclient-servercask:
brew install --cask dnclient-server- Install
dnclientas 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’sbindirectory, sobrew upgrade --cask dnclient-serverupdates it in place.
sudo "$(brew --prefix)/bin/dnclient" installsudo "$(brew --prefix)/bin/dnclient" startsudo "$(brew --prefix)/bin/dnclient" enroll -code <ENROLL_CODE>Install the standalone binary
Section titled “Install the standalone binary”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.
- Obtain the URL for the latest version of the
dnclientbinary or .dmg from https://admin.defined.net/downloads. - From a directory where you wish to download
dnclient, run the followingcurlcommand, replacing<DL_URL>with the link you obtained from the downloads page.
curl -O <DL_URL>- 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:
sudo chmod +x dnclient- Install
dnclientas a service. This will use thednclientbinary in its current directory, so move it first if you’d like it somewhere else.
sudo ./dnclient install- Start
dnclient. As a service, it will be started automatically on future reboots.
sudo ./dnclient start- 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.
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.
Windows
Section titled “Windows”Install with winget
Section titled “Install with winget”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.
winget install DefinedNet.DNClient.Server& 'C:\Program Files\Defined Networking\DNClient\dnclient.exe' enroll -code <ENROLL_CODE>Install the MSI
Section titled “Install the MSI”-
Find the latest version of the
DNClient-Server.msiinstaller for your architecture from https://admin.defined.net/downloads. -
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.
curl.exe -O <DL_URL>-
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. -
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.
& '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.
Docker
Section titled “Docker”Run the container
Section titled “Run the container”The definednet/dnclient image runs dnclient in a container on Linux hosts. It carries the same release as the packages on dl.defined.net.
-
Install cosign v3 or newer.
-
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.
cosign verify --key https://dl.defined.net/docker-cosign.pub definednet/dnclient:latest- 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_ADMINlets the container create the tun device, and thedefinedvolume keeps the host’s enrollment across restarts, soDN_ENROLLMENT_CODEis only needed on the first run.
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:latestYour computer is now running dnclient and will be able to communicate with other machines on your Managed Nebula network.