CLI: Static Sites
Deploy and manage static sites using the DanubeData CLI.
Prerequisites
- DanubeData CLI installed
- Authenticated via
danube loginorDANUBE_TOKEN
Quick start
Deploy a static site in 3 commands:
# 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:
danube pages link
The CLI prompts you to:
- Select a team (if you belong to multiple)
- 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:
export DANUBE_SITE_ID="42"
export DANUBE_TEAM_ID="1"
Deploying
Basic deploy
danube pages deploy
Deploys the current directory. The CLI:
- Packages all files into a ZIP (excluding
.git,node_modules,.danube,.gitignorepatterns) - Uploads the ZIP to DanubeData
- Polls the build status until completion (or timeout after 5 minutes)
Deploy a specific directory
danube pages deploy --dir ./dist
Useful for framework builds where the output is in a subdirectory.
Deploy without waiting
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:
{
"outputDir": "dist",
"ignore": ["*.map", "test/**", "*.test.js"]
}
With this in place, danube pages deploy automatically deploys the dist/ directory.
Framework examples
React (Vite):
npm run build
danube pages deploy --dir ./dist
Next.js (static export):
npx next build
danube pages deploy --dir ./out
Vue:
npm run build
danube pages deploy --dir ./dist
Astro:
npm run build
danube pages deploy --dir ./dist
Hugo:
hugo
danube pages deploy --dir ./public
Plain HTML:
danube pages deploy
Deployments
List deployments
danube pages deployments ls
Shows all deployments with revision number, status, trigger type, and timestamps.
Roll back
danube pages deployments rollback 3
Activates deployment revision 3. The rollback is instant — no rebuild required.
Custom domains
List domains
danube pages domains ls
Shows all domains with their type (default/custom), status, and verification date.
Add a domain
danube pages domains add www.example.com
The CLI returns DNS verification instructions. You need to:
- Add a DNS TXT record:
_danubedata-verify.www.example.comwith the provided token - Verify the domain:
danube pages domains verify www.example.com - Add a CNAME record pointing
www.example.comto your site's default domain
Verify a domain
danube pages domains verify www.example.com
Triggers a DNS lookup to verify ownership. Run this after adding the TXT record.
Remove a domain
danube pages domains remove www.example.com
Complete workflow example
# 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
- CLI Overview — Installation, auth, and configuration
- CLI: Serverless Containers — Container deployment commands
- Static Sites overview — Full product reference
- Build with AI — Generate a site with an LLM and deploy via CLI
Questions? Contact support at support@danubedata.ro