Start
Installation & upgrades
The complete upstream guide to installation & upgrades, synchronized with the product repository.
Product v0.22.0 · Complete source guide
Quickstart Guide
This guide walks you through installing, configuring, upgrading, and running NineDeploy.
⚡ 1. Production Installation (Bare-Metal / Recommended)
Bare-metal Linux is the recommended production deployment mode: NineDeploy runs as a hardened systemd service with direct Docker daemon and PM2 process management.
curl -fsSL https://ninedeploy.com/install.sh | bashPanel on its own domain with HTTPS from the first boot. Point an A record at the server, then run:
curl -fsSL https://ninedeploy.com/install.sh | bash -s -- \
--domain panel.example.com --email you@example.com- With these flags, the installer writes
NINEDEPLOY_DOMAINandNINEDEPLOY_ACME_EMAILinto.envand makeshttps://panel.example.comthe public URL. Traefik then gets its certificate from Let's Encrypt. - Without the flags, a first install on a terminal asks for both. Press Enter to skip.
- The installer warns when the domain does not resolve to the server yet.
- The setup link is printed for the domain and for
http://<server-ip>:3000. The second link works before the certificate is issued. - The domain does not depend on the address port 3000 is published on. In Docker mode the panel container joins the proxy's network once a domain is set, and Traefik reaches it there. To keep the plain-HTTP port off the internet, set
NINEDEPLOY_BIND=127.0.0.1in.envand rundocker compose up -d; the linkhttp://<server-ip>:3000then works through an SSH tunnel only. On bare metal, leave the port reachable from Docker and block it in your cloud provider's firewall instead. - Once the panel is healthy, the installer asks Traefik for the domain and reports whether it answered.
- A domain set later under Settings → Security wins over
NINEDEPLOY_DOMAIN. - Without the email, the first-run form offers to use the admin's email for Let's Encrypt.
What the installer does:
- Detects or installs Node.js (22.23.4+, 24.22.1+ or 26.12.1+ within those supported majors) and pnpm (v11 via Corepack). Existing supported Node majors are retained during patching. It rechecks the security patch level and selected major after installation; stale package mirrors or an unexpected executable on PATH stop setup.
- Verifies Docker daemon connectivity.
- Clones or updates the repository to
~/ninedeploy. - Builds the monorepo packages.
- Generates a secure
.envfile with random 32-byte JWT secrets. - Runs initial SQLite migrations via Drizzle.
- Installs and starts the hardened
ninedeploy.serviceunder systemd.
Hardened Systemd Service Features:
Type=simplewithWatchdogSec=0; long Docker pulls and builds are never terminated by a service watchdog.- Installer-managed migration override and effective-policy verification repair older
Type=notifyinstallations during an in-place upgrade. ProtectSystem=fullwith explicit write access for the install/data directories, temporary files and Docker socket.NoNewPrivileges=trueandPrivateTmp=true.Restart=alwayswith a five-second restart delay;/healthis the authoritative installer readiness gate.
🐳 2. Docker Installation (Containerized)
The installer supports this mode directly — pass --docker (or set
NINEDEPLOY_INSTALL_MODE=docker). It installs only Docker on the host, fetches
the pinned compose file, generates the secrets into a 0600 .env, and runs the
panel container; re-running the same command upgrades it (secrets and data
volume are preserved, and an existing bare-metal install is never clobbered):
curl -fsSL https://ninedeploy.com/install.sh | bash -s -- --dockerWithout the installer, the standalone production compose file is the
one-command path (it refuses to boot without a strong NINEDEPLOY_JWT_SECRET,
adds a restart policy and the health-gated readiness check):
echo "NINEDEPLOY_JWT_SECRET=$(openssl rand -hex 32)" >> .env
echo "DOCKER_GID=$(getent group docker | cut -d: -f3)" >> .env
docker compose -f docker-compose.prod.yml up -dOr run the image directly:
docker run -d --name ninedeploy \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $(getent group docker | cut -d: -f3) \
-v ninedeploy-data:/data \
-p 3000:3000 \
-e NINEDEPLOY_DATA_DIR=/data \
-e NINEDEPLOY_DB_PATH=/data/ninedeploy.db \
-e NINEDEPLOY_JWT_SECRET=$(openssl rand -hex 32) \
-e NINEDEPLOY_PUBLIC_URL=https://your-domain.com \
ghcr.io/ninedeploy/ninedeploy:latestNote on Permissions: The
--group-addargument is required so the non-rootninedeployuser inside the container can interact with the host's/var/run/docker.sock.
What differs from bare-metal: PM2-type services (host processes) and UFW firewall management are only available via the bare-metal installer. Docker and Compose deploys, managed databases, Traefik ingress and encrypted S3 backups work identically — the panel drives them as host sibling containers through the mounted socket.
Your first deploy
After the first admin signs in, the Dashboard shows a Getting started checklist and a Deploy your first app card. The New button (top bar, or /new) opens the resource picker: a Git repository, a Docker image, a Dockerfile, an uploaded .zip / .tar.gz of a project folder, a static site, a Compose stack, one of 11 database engines, or a one-click app from the catalog. Without a Git repository, ninedeploy deploy up ./my-app --create my-app deploys a local folder (details).
To start from a working Dockerfile and health check, deploy a framework starter: Next.js, Laravel, FastAPI, Django, Rails, Express, Astro, Go, Spring Boot or a static site.
If you are joining an existing instance with registration closed, ask the instance operator to create your account. A workspace owner or admin can then invite you as a member. Sign in, open New, and choose a permitted source such as Docker image or Upload source. The instance operator handles the initial setup checklist and built-in demo. Workspace permissions
On a fresh install with a public IP, services get a free test URL right away — http://<service>.<server-ip>.sslip.io — so the first deploy is reachable before any DNS work. Switch to your own wildcard domain, or turn it off, under Settings → Security → Automatic URLs (details).
💻 3. Local Development from Source
# 1. Clone the repository
git clone https://github.com/NineDeploy/NineDeploy.git
cd NineDeploy
# 2. Install dependencies & build
pnpm install
cp .env.example .env
pnpm build
# 3. Start the API (:3000) and, in a second shell, the Web UI (:5173)
pnpm dev # API server
pnpm dev:web # Vite dev server for the web UIOpen http://localhost:5173 in your browser to create the initial admin account.
🔄 4. Upgrading NineDeploy
In-Place Upgrade (Bare-Metal):
Re-running the installation script performs a seamless, zero-data-loss upgrade:
# Upgrade to latest release tag (default)
curl -fsSL https://ninedeploy.com/install.sh | bash
# Pin to a specific version
bash install.sh --version v0.22.0
# Stable channel: the newest release that has been out for 7 days
# (a security release at once). The panel can follow it too:
# Settings → System → Update channel.
bash install.sh --channel stable
# Track edge (main branch)
bash install.sh --channel main
# Discard local modifications and rebuild from scratch
bash install.sh --forceWhere the code comes from: on the release channel the installer downloads the source tarball GitHub publishes for the tag (/archive/refs/tags/vX.Y.Z.tar.gz) — no git required on the host. It falls back to a git clone when the tarball is unreachable, and the main channel always uses git. The resolved tag is looked up from git ls-remote, then the GitHub releases API, then the tags API, so a single unavailable source cannot pin you to a stale version.
Upgrade Safety Mechanism:
Before pulling updates or applying migrations, the installer automatically snapshots .data/ninedeploy.db and .data/master.key to .data/upgrade-backups/pre-update-YYYYMMDD-HHMMSS.tar.gz. Build output (dist/, the turbo cache) is always cleared before rebuilding, so an upgrade can never leave the previous release's panel bundle in place, and the installer fails if apps/web/dist/index.html is missing after the build.
Docker Upgrade:
Installer-managed Docker installs (/opt/ninedeploy-docker) pin the panel image
to the release they installed: the installer writes NINEDEPLOY_IMAGE_TAG=vX.Y.Z
into the 0600 .env beside docker-compose.yml (edge on --channel main). A bare
docker compose pull && docker compose up -d therefore re-pulls the same
release. To upgrade, re-run the installer:
curl -fsSL https://ninedeploy.com/install.sh | bash -s -- --docker
# or, from a checkout: ./install.sh --dockerTo move by hand instead, edit NINEDEPLOY_IMAGE_TAG in that .env, then run
docker compose pull && docker compose up -d in /opt/ninedeploy-docker.
# Bring-your-own compose installs (docker-compose.prod.yml; with no
# NINEDEPLOY_IMAGE_TAG in .env the image tag is :latest):
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
# Plain `docker run` installs: stop + remove, then re-run your original
# command with the existing ninedeploy-data volume and a fresh image:
docker pull ghcr.io/ninedeploy/ninedeploy:latest
docker stop ninedeploy && docker rm ninedeployMigrations apply automatically upon server boot.
Rolling Back:
Running the previous release again on the same data is supported: migrations only add, and an older release ignores what it does not know. What each release leaves behind after a rollback (for 0.14: Traefik back on one dynamic file, public-database sidecars still running, import staging files, literal Vault/AWS references) and how to clean it up is in ROLLBACK.md.
One-Click Self-Update (Bare-Metal Panels):
On systemd bare-metal installations an operator can upgrade the panel from the dashboard itself — an amber banner appears under the header when a new release is available (and the same button lives on About). Confirming it runs this install's own installer for the pinned release tag: snapshot of .data, source swap, rebuild, migrations, service restart. The panel is briefly offline mid-run (~5–15 minutes) while deployed services keep running; progress survives the restart and reports success or failure with the installer output tail. The update refuses to start while a deployment is building or rolling out (it would be interrupted by the restart) and lists them; wait for them, or send "force": true to POST /v1/system/update-start to update anyway. Container-mode installs don't offer self-update — re-run the installer with --docker (installer-managed) or pull the new image (see Docker Upgrade above).
Update channel: every release or stable
By default the panel offers every release as soon as it is published. An operator can switch it to stable under Settings → System → Update channel (or PUT /v1/system/update-channel, SDK system.updateChannel). Stable offers the release the stable channel names. A daily workflow (.github/workflows/stable-channel.yml) keeps it on the newest release that has been out for 7 days, writing the release into a STABLE file on the stable branch and moving the stable tag; the panel takes the newer of the two. A release whose GitHub release notes carry <!-- stable: security --> moves it at once. One with <!-- stable: hold --> is never promoted. The tag never moves backwards. Maintainers can also promote a tag by hand with the workflow's tag input. The workflow writes the tag with the STABLE_TAG_TOKEN repository secret (a fine-grained token with Contents and Workflows read and write), because GitHub refused the built-in workflow token when it tagged a release commit (403). The installer takes the same channel: install.sh --channel stable. Re-running the installer without the flag goes back to the newest release, so pass it every time.
⚙️ 5. Key Environment Variables
| Variable | Default | Description |
|---|---|---|
NINEDEPLOY_PORT | 3000 | HTTP port for API & built Web Dashboard |
NINEDEPLOY_HOST | 127.0.0.1 | Binding address (0.0.0.0 in Docker) |
NINEDEPLOY_DATA_DIR | ./.data | Directory for SQLite DB, repos, logs, backups |
NINEDEPLOY_DB_PATH | ./.data/ninedeploy.db | Absolute path to SQLite database file |
NINEDEPLOY_JWT_SECRET | (required) | 32-byte hex key for signing user auth tokens |
NINEDEPLOY_MASTER_KEYS | (optional) | Key ring for AES-256-GCM secret rotation (e.g. 0:hex,1:hex) |
NINEDEPLOY_PUBLIC_URL | http://localhost:3000 | Public root URL for webhooks and OAuth redirects (fresh 0.16 installs write http://<server-ip>:3000) |
NINEDEPLOY_SETUP_TOKEN | — | One-time token the first-admin signup requires (0.16; the installer generates it, production without it writes DATA_DIR/setup-token) |
NINEDEPLOY_WILDCARD_DOMAIN | — | Base domain for automatic service URLs (<slug>.<domain>); wins over Settings → Automatic URLs — see Automatic URLs |
BUILDKIT_HOST | (unset) | BuildKit daemon for the optional railpack build pack (e.g. docker-container://buildkit); the pack is refused while unset — see Private repositories §6 |
💻 6. Managing with the Terminal CLI (ninedeploy)
Once your server is running, install the CLI on your development machine to manage deployments directly from your terminal:
# 1. Install CLI globally
npm install -g ninedeploy
# 2. Complete initial administrator setup (for a new server)
ninedeploy setup
# Or authenticate with an existing instance:
ninedeploy config --server https://panel.yourdomain.com
ninedeploy login
# 3. Check status and manage services
ninedeploy whoami
ninedeploy services list
ninedeploy system dashboardSource guide (installer links and live inventory counts are normalized for this site): docs/QUICKSTART.md.