Install the Direct Agent Runner
The runner is a single self-contained program. It needs no .NET installation. Install it with Homebrew on macOS or Linux, or download the file for your system.
Prerequisites
Section titled “Prerequisites”- Docker, running. On macOS and Windows install Docker Desktop. On Linux
install Docker Engine and make sure your user can run
dockerwithoutsudo. - Outbound HTTPS access to your Direct address.
Downloads
Section titled “Downloads”Every release is published at github.com/Cratis/DirectPublic/releases
with one file per system and a checksums.txt file with the SHA-256 of each.
| System | Processor | File |
|---|---|---|
| macOS | Apple silicon | direct-runner-<version>-osx-arm64.tar.gz |
| macOS | Intel | direct-runner-<version>-osx-x64.tar.gz |
| Linux | x64 | direct-runner-<version>-linux-x64.tar.gz |
| Linux | arm64 | direct-runner-<version>-linux-arm64.tar.gz |
| Windows | x64 | direct-runner-<version>-win-x64.zip |
| Windows | arm64 | direct-runner-<version>-win-arm64.zip |
The archive holds one file: direct-runner (direct-runner.exe on Windows).
With Homebrew
Section titled “With Homebrew”brew tap cratis/cratisbrew install direct-runnerUpdate later with brew upgrade direct-runner.
From the download
Section titled “From the download”VERSION=1.0.0curl -fLO "https://github.com/Cratis/DirectPublic/releases/download/v$VERSION/direct-runner-$VERSION-osx-arm64.tar.gz"tar -xzf "direct-runner-$VERSION-osx-arm64.tar.gz"sudo install -m 755 direct-runner /usr/local/bin/direct-runnerUse osx-x64 on an Intel Mac. If you downloaded the file with a browser and macOS refuses to open it, remove
the quarantine flag: xattr -d com.apple.quarantine /usr/local/bin/direct-runner.
Start the runner at login
Section titled “Start the runner at login”With Homebrew, let it manage the runner as a background service:
brew services start direct-runnerThe service restarts the runner if it stops and writes its log to $(brew --prefix)/var/log/direct-runner.log.
Stop it with brew services stop direct-runner.
With Homebrew
Section titled “With Homebrew”Homebrew on Linux installs the same formula:
brew tap cratis/cratisbrew install direct-runnerFrom the download
Section titled “From the download”VERSION=1.0.0ARCH=x64 # or arm64curl -fLO "https://github.com/Cratis/DirectPublic/releases/download/v$VERSION/direct-runner-$VERSION-linux-$ARCH.tar.gz"curl -fLO "https://github.com/Cratis/DirectPublic/releases/download/v$VERSION/checksums.txt"sha256sum --check --ignore-missing checksums.txttar -xzf "direct-runner-$VERSION-linux-$ARCH.tar.gz"sudo install -m 755 direct-runner /usr/local/bin/direct-runnerThe sha256sum line prints OK for the file you downloaded.
Start the runner at login
Section titled “Start the runner at login”Run the runner as a systemd user service. Create ~/.config/systemd/user/direct-runner.service:
[Unit]Description=Direct Agent RunnerAfter=network-online.target docker.service
[Service]ExecStart=/usr/local/bin/direct-runnerRestart=alwaysRestartSec=5
[Install]WantedBy=default.targetThen enable it:
systemctl --user daemon-reloadsystemctl --user enable --now direct-runnerloginctl enable-linger "$USER" # keep it running when you are not logged inFollow its log with journalctl --user -u direct-runner -f.
Windows
Section titled “Windows”From the download
Section titled “From the download”In PowerShell:
$version = "1.0.0"$arch = "x64" # or arm64Invoke-WebRequest "https://github.com/Cratis/DirectPublic/releases/download/v$version/direct-runner-$version-win-$arch.zip" -OutFile direct-runner.zipExpand-Archive direct-runner.zip -DestinationPath "$env:LOCALAPPDATA\direct-runner"Start it with & "$env:LOCALAPPDATA\direct-runner\direct-runner.exe". If Windows SmartScreen warns about the
file, check its checksum against checksums.txt (Get-FileHash direct-runner.zip) before choosing to run it.
Start the runner at login
Section titled “Start the runner at login”Create a scheduled task that starts the runner when you sign in:
$action = New-ScheduledTaskAction -Execute "$env:LOCALAPPDATA\direct-runner\direct-runner.exe"$trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit 0 -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)Register-ScheduledTask -TaskName "Direct Agent Runner" -Action $action -Trigger $trigger -Settings $settingsStart it now with Start-ScheduledTask -TaskName "Direct Agent Runner". Docker Desktop must also start at login.
Verify the installation
Section titled “Verify the installation”Start the runner and open http://127.0.0.1:7190. The runner’s page opens. Continue with
Get started to connect it.
Update the runner
Section titled “Update the runner”Install the new version over the old one and restart the runner. The runner keeps its identity in its state folder, so it stays connected as the same runner. See Where the runner keeps its identity.
Uninstall the runner
Section titled “Uninstall the runner”- In Direct, open Settings → Runners and remove the runner. Its token stops working at once. Selecting Disconnect this machine on the runner’s page only makes this machine forget its identity. Direct still lists the runner until you remove it.
- Stop the service or scheduled task, and remove the program (
brew uninstall direct-runner, or delete the file). - Delete the runner’s state folder.