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="42"
export DANUBE_TEAM_ID="1"

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. Polls the build status until completion (or timeout after 5 minutes)

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.

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. Run this after adding the TXT record.

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