# How to Deploy PrimeAgent to Production: A Complete Guide to CI/CD, Manual Installation, and NPM Package Setup

> Deploy PrimeAgent to production using CI/CD, the install.sh script, or npm package setup. Get the complete guide for seamless integration and automated deployment.

- Repository: [Prime Intellect/prime-agent](https://github.com/PrimeIntellect-ai/prime-agent)
- Tags: how-to-guide
- Published: 2026-08-14

---

**PrimeAgent can be deployed to production via automated CI/CD pipelines, the self-contained [`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh) script, or direct npm installation of release tarballs from R2 storage.**

This guide walks through each deployment method for PrimeIntellect's AI coding agent, covering the automated release workflow, environment preparation, and verification steps based on the official PrimeAgent source code.

## Understanding PrimeAgent's Production Architecture

PrimeAgent is distributed as a **Node.js package** with multiple installation pathways. The production deployment system centers on two core components: the GitHub Actions release workflow ([`.github/workflows/build-binaries.yml`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/.github/workflows/build-binaries.yml)) and the self-contained installer script ([`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh)).

The CI pipeline builds all monorepo packages, creates versioned tarballs, uploads artifacts to **Cloudflare R2**, and publishes GitHub releases. This immutable infrastructure ensures reproducible deployments across environments.

## Automated Production Deployment via CI/CD

The **Release** GitHub workflow automates production deployments. When maintainers trigger a release, this workflow executes the full build-and-publish sequence.

### What the CI Workflow Does

In [`.github/workflows/build-binaries.yml`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/.github/workflows/build-binaries.yml), the pipeline:

1. Builds all packages in the monorepo
2. Creates production-channel and beta-channel tarballs
3. Uploads artifacts to the configured R2 bucket
4. Creates a GitHub release with attached binaries
5. Publishes to npm via `scripts/release.mjs`

### Running the Release Script Locally

For testing or hotfix scenarios, invoke the release script directly:

```bash

# Bump patch version, update changelogs, create tag, and publish

node scripts/release.mjs patch

```

Available version bumps: `patch`, `minor`, `major`.

## Manual Production Deployment with the Installer Script

For self-hosted production environments, the [`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh) script provides automated dependency resolution and installation.

### Prerequisites and Host Preparation

Ensure your target host meets these requirements:

- **Node.js ≥ 20.6.0** and npm
- The installer can auto-install Node via Homebrew (macOS), apt (Debian/Ubuntu), apk (Alpine), or standalone binary

### Step-by-Step Manual Installation

1. **Configure the download base URL**

   The `PRIME_AGENT_DOWNLOAD_BASE_URL` environment variable points to your R2 bucket:

   ```bash
   export PRIME_AGENT_DOWNLOAD_BASE_URL="https://<your-bucket>.r2.cloudflarestorage.com"
   ```

2. **Execute the installer**

   ```bash
   curl -fsSL https://prime-agent.dev/install.sh | sh -s -- --no-env
   ```

   The `--no-env` flag prevents automatic shell environment modification.

3. **Verify installation**

   The installer confirms that `prime-agent` is available on `$PATH` and outputs a success message.

### How the Installer Works Internally

The [`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh) script performs these operations:

- Resolves the latest version from `<base-url>/stable` (or `beta` channel)
- Downloads the tarball and SHA-256 checksum file
- Verifies package integrity against `SHA256SUMS`
- Runs `npm install -g` to install globally
- Optionally bootstraps the **IPython kernel** for Python code execution

## Direct NPM Installation from Release Tarballs

For environments where you control artifact distribution, install directly from downloaded tarballs.

### Download and Verify Production Artifacts

```bash

# Resolve the latest production version

VERSION=$(curl -fsSL "$PRIME_AGENT_DOWNLOAD_BASE_URL/stable")

# Download tarball and checksums

curl -fsSL "$PRIME_AGENT_DOWNLOAD_BASE_URL/releases/v${VERSION}/prime-agent-${VERSION}.tgz" \
  -o prime-agent.tgz
curl -fsSL "$PRIME_AGENT_DOWNLOAD_BASE_URL/releases/v${VERSION}/SHA256SUMS" \
  -o SHA256SUMS

# Verify integrity

sha256sum -c <(grep "prime-agent-${VERSION}.tgz" SHA256SUMS)

```

### Global NPM Installation

```bash
npm install -g --no-fund --no-audit --loglevel=error prime-agent.tgz

```

The flags suppress funding messages and reduce output noise for production logs.

## Optional: Bootstrapping the Python Runtime

PrimeAgent's code execution capabilities require Python infrastructure. The installer can prepare this automatically, or you can configure it manually:

- **uv**: Fast Python package manager
- **Python 3.11**: Required runtime version
- **ipykernel**: Jupyter kernel for code execution

Enable automatic bootstrapping by omitting `--no-env` or running the installer with default flags.

## Production Runtime Configuration

After deployment, configure PrimeAgent for your production environment. Key files for runtime settings:

| File | Purpose |
|------|---------|
| [`packages/ai/README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/ai/README.md) | Environment variables for self-hosted model providers (API keys, endpoints, rate limits) |
| [`packages/coding-agent/README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/README.md) | CLI commands, extensions, and runtime configuration |

The [`prime-agent.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/prime-agent.sh) wrapper script handles runtime flags including `--no-env` and `--dist` for distribution-specific behavior.

## Summary

- **Automated deployments** use the [`build-binaries.yml`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/build-binaries.yml) GitHub workflow to build, upload to R2, and release
- **Manual installations** rely on [`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh) to resolve versions, verify checksums, and install globally
- **Direct npm installation** works with downloaded tarballs when you manage artifact distribution
- **Node.js ≥ 20.6.0** is required; the installer can provision this automatically
- **Python runtime** (uv, Python 3.11, ipykernel) enables code execution features

## Frequently Asked Questions

### What is the minimum Node.js version for PrimeAgent production deployment?

Node.js **20.6.0 or higher** is required. The [`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh) script automatically detects missing Node versions and installs them via package managers (Homebrew, apt, apk) or standalone binaries.

### How does PrimeAgent verify package integrity during installation?

The installer downloads a `SHA256SUMS` file alongside each release tarball. It computes the SHA-256 hash of the downloaded package and validates it against the signed checksums before executing `npm install -g`.

### Can I deploy PrimeAgent without using the install script?

Yes. Download the production tarball directly from your R2 bucket, verify checksums manually, then run `npm install -g prime-agent.tgz`. This approach works for air-gapped environments or custom deployment pipelines.

### What does the `PRIME_AGENT_DOWNLOAD_BASE_URL` environment variable control?

This variable specifies the root URL for artifact resolution. The CI workflow populates an R2 bucket URL here. For production, set this to your immutable R2 storage endpoint; the installer appends `/stable` or `/beta` to resolve channel-specific versions.