Skip to content

CLI: Static Sites

Deploy and manage static sites using the DanubeData CLI.

Prerequisites

Quick start

Deploy a static site in 3 commands:

Bash
# 1. Link your project directory to a site
danube pages link

# 2. Deploy
danube pages deploy

That's it. Your site is live.

Linking a project

Before deploying, link your local directory to a DanubeData static site:

Bash
danube pages link

The CLI prompts you to:

  1. Select a team (if you belong to multiple)
  2. Choose an existing site or create a new one

This creates .danube/project.json in your project directory with the site ID and team ID.

Headless linking (CI/CD)

Skip interactive prompts by setting environment variables:

Bash
export DANUBE_SITE_ID="01a0d8fa-35fa-709d-b9d1-319c28ba28fa"
export DANUBE_TEAM_ID="4"

The site ID is a UUID — danube pages link prints it, and saves it as siteId in .danube/project.json. DANUBE_TEAM_ID is the project the site belongs to (teamId). Headless deploys need CLI 1.6.0 or newer.

Deploying

Basic deploy

Bash
danube pages deploy

Deploys the current directory. The CLI:

  1. Packages all files into a ZIP (excluding .git, node_modules, .danube, .gitignore patterns)
  2. Uploads the ZIP to DanubeData
  3. Waits for that upload's build, then for the new revision to be published, then until your site's URL serves it — and only then prints Live at. If the build fails, the error is printed and the command exits with status 1.

Deploy a specific directory

Bash
danube pages deploy --dir ./dist

Useful for framework builds where the output is in a subdirectory.

Deploy without waiting

Bash
danube pages deploy --no-wait

Uploads the files and exits immediately without waiting for the build to complete.

Using danube.json

Create a danube.json in your project root to configure the default deployment directory and exclude patterns:

JSON
{
  "outputDir": "dist",
  "ignore": ["*.map", "test/**", "*.test.js"]
}

With this in place, danube pages deploy automatically deploys the dist/ directory.

Framework examples

React (Vite):

Bash
npm run build
danube pages deploy --dir ./dist

Next.js (static export):

Bash
npx next build
danube pages deploy --dir ./out

Vue:

Bash
npm run build
danube pages deploy --dir ./dist

Astro:

Bash
npm run build
danube pages deploy --dir ./dist

Hugo:

Bash
hugo
danube pages deploy --dir ./public

Plain HTML:

Bash
danube pages deploy

Deployments

List deployments

Bash
danube pages deployments ls

Shows all deployments with revision number, status, trigger type, and timestamps.

Roll back

Bash
danube pages deployments rollback 3

Activates deployment revision 3. The rollback is instant — no rebuild required. The CLI waits until the platform has published it; add --no-wait to return as soon as the rollback is accepted.

Custom domains

List domains

Bash
danube pages domains ls

Shows all domains with their type (default/custom), status, and verification date.

Add a domain

Bash
danube pages domains add www.example.com

The CLI returns DNS verification instructions. You need to:

  1. Add a DNS TXT record: _danubedata-verify.www.example.com with the provided token
  2. Verify the domain: danube pages domains verify www.example.com
  3. Add a CNAME record pointing www.example.com to your site's default domain

Verify a domain

Bash
danube pages domains verify www.example.com

Triggers a DNS lookup to verify ownership and waits for the result. Run this after adding the TXT record. If the record is not found yet, the CLI prints it again and exits with status 1 — DNS changes can take a while to propagate, so try again later. Add --no-wait to only start the check.

Remove a domain

Bash
danube pages domains remove www.example.com

Complete workflow example

Bash
# Install the CLI
npm install -g @danubedata/cli

# Authenticate
danube login

# Navigate to your project
cd my-website

# Build your site (if using a framework)
npm run build

# Link to a DanubeData static site
danube pages link

# Deploy
danube pages deploy --dir ./dist

# Add a custom domain
danube pages domains add www.mysite.com

# Check deployment status
danube pages deployments ls

Next steps


Questions? Contact support at support@danubedata.ro