All writing
5 min

What is NextDeploy? Architecture, Runtime Models, and Complete Installation Guide

The foundational guide to NextDeploy: what it is, its dual-binary Go architecture, zero-downtime execution models across Linux VPS and Edge, and step-by-step installation instructions for Linux, macOS, and Windows.


NextDeploy is an open-source, compiled Go deployment toolkit and runtime designed specifically for Next.js 15+ App Router applications. It bridges the gap between the zero-friction developer experience of proprietary PaaS platforms and the cost efficiency, sovereignty, and control of deploying to your own infrastructure.

The velocity and polish of modern cloud platforms, with the pricing and independence of your own servers. Zero Docker overhead, zero Kubernetes complexity, and zero vendor lock-in.

What is NextDeploy?

For years, fullstack Next.js teams have been forced to choose between two painful extremes: accept steep vendor markup for bandwidth and serverless executions, or wrestle with sprawling Dockerfiles, brittle Docker daemon sockets, reverse proxies, and manual SSL certificate management on raw Linux servers.

NextDeploy eliminates this trade-off with a single, statically compiled Go binary (nextdeploy) paired with a lightweight host daemon (nextdeployd). It treats your Next.js application as a first-class production workload with native understanding of App Router streaming, Server Actions, React Server Component (.rsc) Flight payloads, Incremental Static Regeneration (ISR), and static chunk caching.

🚀
NextDeploy is not an npm package or a wrapper around Node.js scripts. It is a self-contained Go binary with built-in SSH clients, SFTP streaming, atomic Linux inode management, and edge adapters for Cloudflare Workers and AWS Lambda.

How NextDeploy Works: The Dual-Binary Architecture

NextDeploy divides responsibilities cleanly between your local development environment (or CI/CD runner) and the target production infrastructure:

  • 1. Local Client (nextdeploy): The local CLI executable. It evaluates your nextdeploy.yml manifest, builds the lean Next.js standalone artifact locally, handles Doppler secret injection, connects over SSH/SFTP or cloud APIs, and orchestrates zero-downtime cutovers.
  • 2. Host Daemon (nextdeployd): The target host daemon running as a sandboxed systemd service on Linux VPS. It exposes an HMAC-authenticated Unix domain socket, manages release directory trees, executes atomic symlink flips, performs staging health checks, and configures the Caddy edge proxy.
  • 3. Edge Engine (nextcompile): The edge compilation pipeline. Adapts .next/standalone into V8 isolate workers, uploads public assets and chunks to Cloudflare R2 or AWS S3, links D1/Hyperdrive database pools, and coordinates atomic edge script activation.
  • Diagram · System Flow
    Rendering diagram...

    Key Architectural Invariants & Guarantees

    NextDeploy is built around rigorous production guarantees that ensure your site never experiences downtime, broken asset requests, or memory exhaustion:

  • Zero Build Load on Production Servers: Next.js compilation happens entirely on your developer laptop or CI runner. A $4/month VPS with 1GB RAM never runs out of memory compiling heavy Webpack/Turbopack bundles.
  • Atomic Zero-Downtime Cutover: Releases live in timestamped folders (/opt/nextdeploy/apps/<app>/releases/<timestamp>). Switching releases is an atomic filesystem inode pointer update (ln -sfn), taking under 5 milliseconds.
  • Persistent Static Chunk Retention: When users browse your site during a deployment, their browsers still request JavaScript chunks from the previous release. NextDeploy automatically pools historical chunks in a shared directory, preventing 404 ChunkLoadErrors.
  • Pre-Flight Health Probing: The newly deployed process must pass TCP socket readiness and HTTP 200 health probes on an isolated staging port before traffic is cut over. If a bad release fails health checks, production remains completely untouched.
  • Zero-Leak Secret Orchestration: Environment secrets are injected in-memory using Doppler (doppler run -- nextdeploy ship) and passed through Unix 0600 file descriptors, ensuring sensitive tokens never sit in plaintext .env files on disk.

  • Installation Guide: Installing NextDeploy

    Because NextDeploy is a single Go binary, installation requires no Node.js package managers, global npm permissions, or complex system dependencies.

    Method 1: One-Line Install Script (Linux & macOS — Recommended)

    The fastest way to install or update NextDeploy:

    bash
    curl -fsSL https://hersi.dev/install.sh | bash

    This script detects your operating system and CPU architecture (x86_64 or ARM64 / Apple Silicon), downloads the latest binary into ~/.local/bin/nextdeploy, and ensures it is accessible on your system PATH.

    Method 2: Windows PowerShell Installation

    On Windows, execute the installer in PowerShell:

    powershell
    irm https://hersi.dev/install.ps1 | iex
    🪟
    On Windows, you can also run NextDeploy seamlessly inside WSL2 (Windows Subsystem for Linux) using the Linux installation script.

    Method 3: Direct Manual Binary Download

    To inspect and download the release binary manually from GitHub:

    bash· 14 lines
    1# Query latest GitHub tag and detect architecture
    2TAG=$(curl -s https://api.github.com/repos/aynaash/NextDeploy/releases/latest | jq -r .tag_name)
    3VERSION=${TAG#v}
    4ARCH=$(uname -m); [ "$ARCH" = "x86_64" ] && ARCH=amd64; [ "$ARCH" = "aarch64" ] && ARCH=arm64
    5OS=$(uname | tr '[:upper:]' '[:lower:]')
    6
    7# Download and unpack binary to ~/.local/bin
    8mkdir -p ~/.local/bin
    9curl -L "https://github.com/aynaash/NextDeploy/releases/download/${TAG}/nextdeploy_${VERSION}_${OS}_${ARCH}.tar.gz" \
    10  | tar -xz -C ~/.local/bin nextdeploy
    11chmod +x ~/.local/bin/nextdeploy
    12
    13# Add ~/.local/bin to PATH in your shell profile
    14echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

    Method 4: Compile from Source (Go 1.25+)

    If you prefer building from the source repository:

    bash· 4 lines
    1git clone https://github.com/aynaash/NextDeploy.git
    2cd NextDeploy
    3go build -o nextdeploy ./cli
    4sudo mv nextdeploy /usr/local/bin/

    Verifying Your Installation

    Confirm that the CLI is correctly installed and accessible:

    bash
    nextdeploy version

    Quick Start: Deploy Your First Next.js App

    Deploying an application with NextDeploy takes just three simple steps:

    Step 1: Initialize Manifest

    Run nextdeploy init at the root of your Next.js project to generate nextdeploy.yml:

    bash· 2 lines
    1cd my-nextjs-app
    2nextdeploy init

    Step 2: Choose Your Target Configuration

    Open nextdeploy.yml and configure your target:

    yaml· 28 lines
    1# Option A: Linux VPS with Caddy and automatic HTTPS
    2version: "1.0"
    3target_type: vps
    4
    5app:
    6  name: my-app
    7  domain: app.example.com
    8  port: 3000
    9
    10servers:
    11  - name: production
    12    host: 203.0.113.10
    13    username: ubuntu
    14    key_path: ~/.ssh/id_ed25519
    15
    16# Option B: Serverless Cloudflare Edge
    17# target_type: serverless
    18# app:
    19#   name: my-edge-app
    20#   domain: edge.example.com
    21# serverless:
    22#   provider: cloudflare
    23#   cloudflare:
    24#     bindings:
    25#       d1:
    26#         - { name: DB, id: <d1-database-id> }
    27#       r2:
    28#         - { name: ASSETS, bucket: my-app-assets }

    Step 3: Prepare & Ship

    For a new VPS, prepare the server once, then ship anytime with zero downtime:

    bash· 5 lines
    1# One-time host setup (provisions Caddy, Node.js, firewall & nextdeployd)
    2nextdeploy prepare
    3
    4# Ship zero-downtime release with secrets
    5doppler run -- nextdeploy ship
    ✨
    To check live metrics, HTTP response times, and active deployment versions at any time, run: nextdeploy status

    With NextDeploy, your infrastructure is deterministic, cost-effective, and fully automated. The next guide in this series dives deep into VPS zero-downtime Linux releases.