Skip to content

Installing the ConHive Agent

This guide provides detailed steps for installing the ConHive Agent on your system. Choose the method that best suits your environment and requirements.

Method 1: Quick Download Script (Linux/macOS)

Section titled “Method 1: Quick Download Script (Linux/macOS)”

This script downloads the latest agent binary and extracts it into a conhive subdirectory in your current working directory.

  1. Open your terminal.

  2. Run one of the following commands:

    Terminal window
    # Using curl:
    curl -sSL [https://conhive.ai/download](https://conhive.ai/download) | bash -s agent
    curl -sSL https://conhive.ai/download | bash -s agent
    # Using wget:
    wget -qO- [https://conhive.ai/download](https://conhive.ai/download) | bash -s agent
  3. The script will output instructions on how to start the agent from the conhive directory.


Method 2: Installer Script (Linux Systemd)

Section titled “Method 2: Installer Script (Linux Systemd)”

This script provides a more integrated installation on Linux systems using systemd. It installs the agent, sets it up as a background service, and performs initial checks. Ideal for servers.

  1. Open your terminal.

  2. Run one of the following commands:

    Terminal window
    # Using curl:
    curl -sSL [https://conhive.ai/installer.sh](https://conhive.ai/installer.sh) | bash -s agent
    # Using wget:
    wget -qO- [https://conhive.ai/installer.sh](https://conhive.ai/installer.sh) | bash -s agent
  3. The installer script performs the following actions:

    • Backs up any existing agent binary found in the target location.
    • Downloads the latest agent binary and installs it (typically to /usr/local/bin/conhive-agent).
    • Creates a systemd service file (/etc/systemd/system/conhive-agent.service).
    • Creates helper scripts (e.g., conhive-agent-killall, conhive-agent-uninstall) in the binary location.
    • Starts the conhive-agent service.
    • Performs a health check to ensure the service started correctly.
    • Reverts to the backup if the health check fails.
  4. You can manage the service using standard systemctl commands (see Usage or Quick Start).


Method 3: Manual Installation (Linux/Windows)

Section titled “Method 3: Manual Installation (Linux/Windows)”

This method involves downloading the agent archive directly and placing the binary manually.

  1. Download: Navigate to the ConHive Release Hub. Download the correct archive (.tar.gz for Linux, .zip for Windows) for your Operating System and CPU architecture.
  2. Extract:
    • Linux: Open a terminal and use the tar command:
      Terminal window
      # Replace <archive_name> with the actual downloaded filename
      tar -xzf <archive_name.tar.gz>
      # Example: tar -xzf conhive-agent_linux_x86_64.tar.gz
    • Windows: Use Windows Explorer or a tool like 7-Zip to extract the contents of the downloaded .zip file.
  3. Copy Binary: Move the extracted binary (conhive-agent on Linux, conhive-agent.exe on Windows) to a suitable location.
    • Linux: A common location is /usr/local/bin/. Ensure this location is in your system’s $PATH.
      Terminal window
      # Example: Moving the binary after extraction
      sudo mv ./conhive-agent /usr/local/bin/conhive-agent
    • Windows: You can place it in a folder like C:\Program Files\ConHiveAgent\ or any other preferred location. Consider adding this location to your system’s PATH environment variable for easier access.
  4. Set Permissions (Linux Only): Make the binary executable.
    Terminal window
    # Example: If you copied it to /usr/local/bin/
    sudo chmod +x /usr/local/bin/conhive-agent
    # Or if it's still in the current directory:
    chmod +x ./conhive-agent

Run the ConHive Agent within a Docker container for isolation and easy deployment.

  1. Ensure you have Docker installed and running.

  2. Open your terminal or command prompt.

  3. Run the following command:

    Terminal window
    docker run -d --name conhive-agent -p 5050:5050 --restart always ai2hive/conhive-agent:latest
    • -d: Runs the container in detached mode (in the background).
    • --name conhive-agent: Assigns a recognizable name to the container.
    • -p 5050:5050: Maps port 5050 on your host machine to port 5050 inside the container, allowing access to the agent’s web interface/API.
    • --restart always: Configures the container to restart automatically if it stops or if the Docker daemon restarts.
    • ai2hive/conhive-agent:latest: Specifies the official ConHive Agent image from Docker Hub.
  4. The agent is now running inside the container. You can access its web interface (if enabled) via http://<your-docker-host-ip>:5050. If running Docker locally, this is often http://localhost:5050.