Skip to main content

Installing Connhex Edge

The quickest way to install Connhex Edge is the install script. It detects the architecture, verifies the download against its published checksum, installs the agent as a systemd service and starts it:

curl -fsSL https://dl.connhex.com/edge-agent/install.sh | sh

If you already have an enrollment token, you can install and configure the device in a single step:

curl -fsSL https://dl.connhex.com/edge-agent/install.sh | CHX_TOKEN=<token> sh

The installer escalates with sudo only for the steps that require it, so the command itself does not need to be prefixed. On systems without sudo, run it as root.

Updating

Re-run the same command to update an existing installation. The agent's configuration is left untouched.

Options

To pass options to the installer, download it and run it directly:

curl -fsSLO https://dl.connhex.com/edge-agent/install.sh
sh install.sh --channel beta
FlagDescription
--token <token>enroll the device during the installation
--channel <name>release channel to track (default: stable)
--version <version>install a specific version instead of the channel's latest
--no-startinstall without starting the agent
--no-enabledo not enable the service at boot
--uninstallremove the agent, keeping its configuration
--purgeremove the agent and its configuration

Uninstalling

sh install.sh --uninstall

This stops the agent and removes the service and the binaries, keeping the device configuration so it can be reinstalled without enrolling again. Use --purge instead to remove the configuration as well.

Installing from a .deb package

Connhex Edge is also distributed as a .deb package, for fleets managed through apt:

VERSION=$(curl -fsSL https://dl.connhex.com/edge-agent/stable)
ARCH=$(dpkg --print-architecture); [ "$ARCH" = armhf ] && ARCH=armv7

curl -fsSLO "https://dl.connhex.com/edge-agent/releases/$VERSION/connhex-edge-agent_${VERSION}_linux_${ARCH}.deb"
sudo apt install -y "./connhex-edge-agent_${VERSION}_linux_${ARCH}.deb"

The package installs the same files, enables the service and starts it. Remove it with sudo apt remove connhex-edge-agent, which preserves the device configuration, or sudo apt purge to remove everything.

Choose one installation method

Do not mix the two. A device installed from the package is managed by apt, and re-running the install script over it would leave dpkg's database inconsistent. The script detects this and refuses.

Configuring the agent

Installing the agent is not enough to connect it to Connhex: the device also needs credentials. There are multiple ways1 of providing them, and the final result is the same.

Enrollment token

Pass the token during the installation as shown above. If the agent is already installed, enroll the device with:

sudo /opt/connhex/bin/agent enroll --token <token>
sudo systemctl restart connhex-edge-agent
Default

Available on Connhex Enterprise instances. This is the recommended way of configuring Connhex Edge in all cases except for high-throughput production processes, where you should consider interfacing through Connhex Provisioning APIs.

With no credentials configured, the agent announces itself to your instance and waits to be approved from Connhex Control. You can read more about it here.

Manual configuration

You can also drop a pre-generated configuration file on the device: the main advantage with respect to using SnapLink is you won't need to approve each association request through Connhex Control. You can read more about it here.

Footnotes

  1. By configuring Connhex Edge we mean enabling its connection to Connhex Cloud.