Install a Local Delegate on macOS
Learn how to install and configure the Harness Delegate on a macOS machine
CLOSED BETA
Delegate 3.x is currently in closed beta and available only to select users. Access is determined by the product team. See Feature Parity for current supported use cases.
This guide walks you through installing the Harness Delegate on a macOS machine. For other platforms, see the Linux and Windows installation guides. For supported connectors, CI steps, secret managers, and module support by deployment type, see the Feature Parity page — that's the single source of truth, kept up to date as support expands.
Quick Reference
./delegate install
Install and register the service
./delegate start
Start the delegate service
./delegate stop
Stop the service gracefully
./delegate status
Show delegate status and details
./delegate uninstall
Uninstall service (preserves config/logs)
Important file locations:
LaunchAgent
~/.harness-delegate/config.env
~/.harness-delegate/logs/
~/Library/LaunchAgents/harness-delegate.plist
LaunchDaemon
/opt/harness-delegate/config.env
/opt/harness-delegate/logs/
/Library/LaunchDaemons/harness-delegate.plist
Get Harness Credentials
Before installation, obtain your Account ID, Delegate Token, and Harness URL.
Open Delegate settings: In the left navigation, go to Resources and select Delegates.
Create a new delegate: Click + New Delegate and choose Docker as your delegate type.
Copy the credentials from the
docker runcommand:ACCOUNT_ID→ Your Account IDDELEGATE_TOKEN→ Your Delegate TokenMANAGER_HOST_AND_PORT→ Your Harness URL
Download and Install the Delegate
Step 1: Download the Binary
Replace <VERSION> with the latest version (e.g., 3.5.0).
For arm64 (Apple Silicon):
For amd64 (Intel):
Example using version 3.5.0:
Step 2: Install with Credentials
Run the install command with the credentials you obtained from the previous step. Choose the service mode that matches your environment.
Option A: LaunchAgent (User Service) — Default
The delegate runs as a user-level service. It starts when you log in and stops when you log out.
Option B: LaunchDaemon (System Service) — Version 1.34.0+
The delegate runs as a system-level service that starts at boot without requiring a GUI session. This mode is recommended for EC2 macOS instances and environments where security policies prohibit auto-login.
All LaunchDaemon operations require sudo because the delegate interacts with the system domain (/Library/LaunchDaemons/) instead of the user domain. The --user flag specifies the macOS user account the delegate process runs as.
Optional: Add tags for delegate selection
Tags are useful for routing specific pipelines to this delegate:
For LaunchDaemon mode, add sudo, --mode=system, and --user:
What this command creates:
LaunchAgent mode:
Workspace directory:
~/.harness-delegateConfiguration file:
~/.harness-delegate/config.envService definition:
~/Library/LaunchAgents/harness-delegate.plist
LaunchDaemon mode:
Workspace directory:
/opt/harness-delegateConfiguration file:
/opt/harness-delegate/config.envService definition:
/Library/LaunchDaemons/harness-delegate.plist
Step 3: Start the Service
For LaunchAgent mode:
For LaunchDaemon mode:
You should see a success message with the config location and log file path.
Step 4: Verify Installation
Check the delegate status:
View logs in real time:
For LaunchDaemon mode:
Navigate to Resources > Delegates in the Harness UI. You should see your delegate with a Connected status.
Step 5: Enable Auto-Login (LaunchAgent Only)
Since the LaunchAgent delegate runs as a user service, enable auto-login to ensure it starts after system reboots:
Open System Settings (or System Preferences on older macOS).
Navigate to Users & Groups.
Click the lock icon and authenticate.
Select Login Options.
Set Automatic login to your user account.
Additional Configuration
Update Delegate Settings
For LaunchAgent mode:
Stop the service:
./delegate stopEdit the config:
nano ~/.harness-delegate/config.envStart the service:
./delegate start
For LaunchDaemon mode:
Stop the service:
sudo ./delegate stopEdit the config:
sudo nano /opt/harness-delegate/config.envStart the service:
sudo ./delegate start
Docker Configuration for Container-Based Steps
If you plan to use Docker with container-based CI steps on macOS, configure your Docker runtime settings to avoid permission-related issues. The delegate requires proper filesystem access between your local machine and the Docker VM.
Docker / Rancher Desktop
For optimal compatibility, configure the following settings in your Docker/Rancher Desktop preferences:
Filesystem Mount Type: Select reverse-sshfs as your mount type. Go to Preferences > Virtual Machine > Volumes tab and choose reverse-sshfs instead of 9p or virtiofs.
Virtual Machine Type: Select QEMU as your emulation type. Go to Preferences > Virtual Machine > Emulation tab and choose QEMU instead of VZ (Apple Virtualization framework).
These settings ensure proper permission mapping between your local filesystem and the Docker VM. Without them, you may encounter "Permission denied" errors when running containerized steps.
Colima
If you are using Colima as your Docker runtime on macOS, start it with the following recommended settings:
This ensures the VM uses QEMU emulation and sshfs mounts, which provide the correct filesystem permission mapping needed by the delegate. The --mount ~:w flag grants write access to your home directory, and --mount /private/tmp:/private/tmp:w mounts the engine's temporary directory so the delegate can read output files written by containerized steps.
MOUNTING /PRIVATE/TMP IS REQUIRED
Unlike Rancher Desktop, which automatically maps system directories into the VM, Colima only mounts your home directory by default. The delegate uses /tmp/ (which resolves to /private/tmp/ on macOS) to exchange output files between containerized steps and the host. Without this mount, pipelines that export output variables from container-based steps will fail with an error like:
If you still encounter this error after adding the mount flag, SSH into the Colima VM and create the directory manually:
Proxy Configuration
The delegate inherits system-level proxies by default, but you can set a custom proxy through the delegate config. Edit the delegate's config.env file (see file locations for the path based on your service mode) and add:
Alternatively, set environment variables:
Manual Plugin Installation
Some CI steps can run directly on the host. Harness automatically downloads required plugins, but manual installation is needed when your infrastructure lacks internet connectivity (e.g., behind a proxy or firewall).
Download the plugin from its source (e.g., drone-git v1.7.6).
Decompress:
zstd -d plugin-darwin-arm64.zst(orplugin-darwin-amd64.zstfor Intel).Move to the plugins directory:
Manage the Delegate
Stop:
./delegate stop— Gracefully shuts down (waits up to 5 minutes for tasks to complete). Usesudo ./delegate stopfor LaunchDaemon mode.Uninstall:
./delegate uninstall— Removes service registration (preserves config, logs, and binary).Upgrade:
Download the new binary: Replace the existing
delegatefile.Stop the delegate:
./delegate stopStart the delegate:
./delegate start
Configure Pipeline Delegate
For the CI stages that you want to use Delegate 3.x with, define the stage variable HARNESS_CI_INTERNAL_ROUTE_TO_RUNNER and set it to true.
Then, set your pipeline's build infrastructure as usual. Ensure that you have set Local as the Infrastructure and that the Operating System and Architecture match the delegate you installed.
Delegate Configuration
The config.env file location depends on your service mode:
LaunchAgent (default):
~/.harness-delegate/config.envLaunchDaemon:
/opt/harness-delegate/config.envCustom workdir:
{workdir}/config.env
For configuration options that apply across all platforms — including stage capacity limits, graceful shutdown, containerless steps, init scripts, log rotation, metrics, and token management — see the Delegate Configuration Reference.
Configure Custom Working Directory
By default, the delegate stores its configuration files, logs, and cache in a standard location.
Default locations:
LaunchAgent:
~/.harness-delegateLaunchDaemon:
/opt/harness-delegate
How to configure:
Use the --workdir flag during installation:
Or set the HARNESS_WORKDIR environment variable before running the binary directly:
The delegate automatically creates the directory and subdirectories. Ensure the delegate process has read/write permissions for this directory.
Debugging
Logs
You can find the delegate logs in the following locations:
LaunchAgent (default):
~/.harness-delegate/logs/delegate.logLaunchDaemon:
/opt/harness-delegate/logs/delegate.logCustom workdir:
{workdir}/logs/delegate.log
View logs in real time:
LaunchAgent:
LaunchDaemon:
Upgrading the Delegate
There is currently no automated upgrade mechanism for Delegate 3.x. The upgrade process involves stopping the delegate, downloading the latest binary, and starting it again.
Stop the running delegate.
Download the latest binary from the installation step, replacing the existing
delegatefile.Start the delegate.
Troubleshooting
Docker Client Not Initialized
If your Local (Docker) infrastructure stages fail with a "docker client is not initialized" error, the delegate is likely using the wrong Docker socket path. This commonly occurs when using Rancher Desktop as your Docker runtime, where the Docker socket symlink must be recreated after every restart.
Identify the correct Docker socket path for your runtime:
This outputs a table showing each configured Docker context and its socket endpoint:
Find the context that matches your active Docker runtime (marked with *), and copy its DOCKER ENDPOINT value. Then add it to config.env:
Replace the path with the correct socket endpoint for your setup. Restart the delegate for the change to take effect.
Output Variable Errors with Colima
If a pipeline step running inside a container exports an output variable and you see an error like:
The delegate writes output .env files to /tmp/engine/ on the host, which resolves to /private/tmp/engine on macOS. Colima only mounts your home directory into the underlying Lima VM by default, so the host cannot read files written by the container to this path.
Restart Colima with an explicit mount for the engine directory:
If the error persists, the /private directory may not exist inside the Linux VM. Create it manually:
For full Colima configuration details, see the Colima section under Additional Configuration.
Bind mount error: hcli-linux not found
A container-based step fails at startup with:
The delegate downloads a helper binary (hcli-linux) and bind-mounts it into the step container. This error means the binary is on a host path the Docker VM cannot see.
Fix: Start Colima with the recommended mounts so the binary's location is visible:
If the file is on a mounted path but the container still cannot see it, your VM's file sharing (virtiofs with the vz VM type) may be failing. Switch to QEMU and sshfs as shown above.
Cannot change the VM config? First set HOME (go to Configure Pipeline Delegate to find the EnvironmentVariables plist snippet), then place the binary directly inside the VM at that same home path. Repeat this only if you delete and recreate the VM (colima delete):
Use <arch> = amd64 (Intel) or arm64 (Apple Silicon), matching your VM (check with colima status).
Last updated
Was this helpful?