# Static Sites

DanubeData Static Sites lets you deploy static websites and single-page applications with automatic TLS, custom domains, and global caching — powered by a fast nginx edge layer with zero server management.

## Key features

- **Three deployment methods** — Upload a ZIP file, connect a Git repository, or push via CLI
- **Automatic builds** — Push to GitHub, GitLab, or Bitbucket and your site deploys automatically
- **Custom domains** — Bring your own domain with DNS verification and automatic TLS via Let's Encrypt
- **Instant rollbacks** — Revert to any previous deployment with one click
- **Password protection** — Restrict access to your site with HTTP Basic Auth
- **Real-time build logs** — Watch your build progress live in the dashboard
- **Global caching** — Optimized nginx configuration with aggressive caching for CSS, JS, and images
- **Free tier** — Deploy your first site at no cost
- **EU data residency** — All data stored in Falkenstein, Germany (GDPR-compliant)

## Deployment methods

### ZIP upload

Upload a ZIP file containing your pre-built site files directly through the dashboard. Best for simple sites, quick prototyping, or when you have a local build pipeline.

- Maximum file size: 100 MB on Free, 500 MB on Starter and Pro (see [Plans and pricing](#plans-and-pricing))
- Supported format: `.zip`

### Git repository

Connect a GitHub, GitLab, or Bitbucket repository for automatic deployments. Each push to your configured branch triggers a new build and deployment.

- **Supported providers** — GitHub, GitLab, Bitbucket
- **Authentication** — Public repos require no credentials. Private repos support SSH keys or access tokens.
- **Auto-deploy** — Builds trigger automatically on push via webhooks
- **Branch selection** — Deploy from any branch (defaults to `main`)

### CLI push

Push your site files from the command line using the DanubeData API. Ideal for CI/CD pipelines and automated workflows.

```bash
# Create a tarball of your site files
tar -czf site.tar.gz -C ./dist .

# Deploy via API
curl -X POST \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@site.tar.gz" \
  https://api.danubedata.ro/api/v1/static-sites/{site-id}/deploy
```

## How it works

### Build and deployment pipeline

```
Upload / Git Push / CLI Push
         |
         v
     Build Queued
         |
         v
      Building Your Site
         |
         v
     Packaging & Storing
         |
         v
        Deploying
         |
         v
      Site Active
```

1. **Source upload** — Your files are uploaded to build storage
2. **Build** — Your files are packaged into an optimized nginx image
3. **Store** — The built image is stored securely, ready to deploy
4. **Deploy** — Your site is rolled out to the DanubeData edge; your previous version stays live until the new build succeeds
5. **Live** — Your site is accessible at its URL with automatic TLS

### Build statuses

| Status | Description |
|--------|-------------|
| **Pending** | Build queued, waiting for resources |
| **Processing** | Preparing build context |
| **Building image** | Your site is being built into an optimized image |
| **Pushing** | Storing the built image, ready to deploy |
| **Succeeded** | Build completed successfully, deployment starting |
| **Failed** | Build failed — check build logs for details |
| **Cancelled** | Build was cancelled before completion |

### Site statuses

| Status | Description |
|--------|-------------|
| **Pending** | Site created, awaiting first deployment |
| **Building** | A build is in progress |
| **Deploying** | Deployment to infrastructure in progress |
| **Active** | Site is live and accessible |
| **Stopped** | Site has been stopped |
| **Error** | Build or deployment failed — check the error details |

Status changes are pushed to your dashboard in real time via WebSocket.

## Site access

Each site is accessible at:

```
https://{slug}.pages.danubedata.ro
```

The slug is auto-generated from your site name with a short suffix to ensure uniqueness.

## Plans and pricing

| Plan | Storage | Max upload | Bandwidth | Sites | Custom domains | Price/month |
|------|---------|------------|-----------|-------|----------------|-------------|
| **Free** | 100 MB | 100 MB | 10 GB | 2 | 2 | EUR 0.00 |
| **Starter** | 500 MB | 500 MB | 100 GB | 10 | 10 per site | EUR 2.99 |
| **Pro** | 2 GB | 500 MB | 500 GB | 50 | 50 per site | EUR 9.99 |

**Storage** is the total size of your deployed site. **Max upload** is the largest single archive accepted per deploy — 500 MB is a platform-wide per-request ceiling, so Pro sites larger than that are built up across multiple deploys rather than one upload.

- **Free** — Perfect for personal projects, portfolios, and testing
- **Starter** — For small teams with multiple sites and custom domain needs
- **Pro** — For agencies and businesses with high-traffic sites

Billing is hourly based on actual usage. Monthly invoices are generated on the 1st of each month.

## Custom domains

Add your own domain to any static site. Custom domains are included on every plan, including Free.

### Adding a custom domain

1. Navigate to your site detail page
2. Click the **Domains** tab
3. Click **Add Domain**
4. Enter your domain (e.g., `www.example.com`)

### Domain verification

After adding a domain, verify ownership by adding a DNS TXT record:

1. **Record name** — `_danubedata-verify.your-domain.com`
2. **Record value** — The verification token shown in the dashboard

Add this TXT record at your DNS provider, then click **Verify** in the dashboard. DNS propagation may take a few minutes.

### Connecting your domain

After verification, create a CNAME record pointing your domain to your site:

```
your-domain.com  CNAME  {slug}.pages.danubedata.ro
```

Once the CNAME is in place, a TLS certificate is provisioned automatically via Let's Encrypt.

### Domain statuses

**Verification status:**

| Status | Description |
|--------|-------------|
| **Pending** | Awaiting DNS TXT record verification |
| **Verifying** | DNS check in progress |
| **Verified** | Domain ownership confirmed |
| **Failed** | Verification failed — check your DNS records and retry |

**TLS status:**

| Status | Description |
|--------|-------------|
| **Pending** | Awaiting TLS certificate provisioning |
| **Provisioning** | Certificate being generated via Let's Encrypt |
| **Active** | HTTPS is active with a valid certificate |
| **Failed** | Certificate provisioning failed — ensure CNAME is correct |

### Setting a primary domain

You can designate any verified domain as the primary domain. The primary domain is used as the canonical URL for your site.

## Password protection

Restrict access to your entire site using HTTP Basic Auth. This is useful for staging environments, client previews, or private content.

1. Navigate to the site detail page
2. Click **Edit**
3. Enable **Password Protection**
4. Enter a username and password (minimum 8 characters)
5. Click **Save**

Visitors will be prompted for credentials before accessing any page on the site.

## Git webhooks

When using Git repository deployment, DanubeData sets up webhook integration for automatic builds.

### Supported providers

| Provider | Signature header | Verification method |
|----------|-----------------|---------------------|
| **GitHub** | `X-Hub-Signature-256` | HMAC-SHA256 |
| **GitLab** | `X-Gitlab-Token` | Token comparison |
| **Bitbucket** | `X-Hub-Signature` | HMAC-SHA256 |

### Setting up webhooks

1. Navigate to the site detail page
2. Copy the **Webhook URL** and **Webhook Secret** shown in the Git configuration section
3. In your Git provider settings, add a new webhook:
   - **URL** — The webhook URL from the dashboard
   - **Secret** — The webhook secret from the dashboard
   - **Events** — Push events only

### Auto-deploy

When auto-deploy is enabled, every push to the configured branch triggers a new build and deployment automatically. You can disable auto-deploy from the site settings if you prefer manual deployments.

## Deployment history and rollbacks

Every successful deployment is recorded with its revision number, commit details, and timestamp.

### Viewing deployments

Navigate to the site detail page and click the **Deployments** tab to see your full deployment history.

### Rolling back

To revert to a previous deployment:

1. Open the **Deployments** tab
2. Find the deployment you want to restore
3. Click **Activate**

The previous deployment is restored immediately without rebuilding. This is useful for quickly reverting a broken deployment.

## Caching

Static Sites use an optimized nginx configuration with aggressive caching headers:

| Content type | Cache policy |
|-------------|-------------|
| **CSS and JavaScript** | `public, max-age=31536000, immutable` (1 year) |
| **Images** | `public, max-age=604800` (7 days) |
| **HTML** | `no-cache` (always revalidated) |

HTML files are always served fresh to ensure visitors see the latest content, while static assets (CSS, JS, images) are cached aggressively for performance.

## Technical specifications

| Specification | Value |
|--------------|-------|
| **Web server** | nginx 1.27 (Alpine) |
| **TLS** | Let's Encrypt with automatic renewal |
| **Default domain** | `{slug}.pages.danubedata.ro` |
| **Maximum upload size** | 100 MB (Free), 500 MB (Starter and Pro) per deploy |
| **Build timeout** | 10 minutes |
| **Build system** | Isolated, containerized builds |
| **Deployment** | Automated rollout; previous version stays live until the new build succeeds |
| **Data location** | Germany (EU) |

## FAQ

### What types of sites can I deploy?

Any static site or single-page application (SPA). This includes sites built with React, Vue, Next.js (static export), Nuxt (static), Hugo, Jekyll, Astro, Eleventy, or plain HTML/CSS/JS.

### Can I use a custom build command?

Not currently. Static Sites expects pre-built files. Run your build locally or in CI/CD, then upload the output directory as a ZIP or push via CLI.

### How do I deploy a React or Vue app?

Build your app locally (e.g., `npm run build`), then upload the output directory (typically `dist/` or `build/`) as a ZIP file. For Git deployments, set the **Publish directory** to the folder containing your built files.

### Can I use the Free plan for production?

Yes. The Free plan includes 2 sites, 100 MB storage, 10 GB bandwidth, and 2 custom domains, which is sufficient for personal sites and portfolios.

### How long does a deployment take?

Most deployments complete within 1-2 minutes. Build time depends on the size of your files. The build timeout is 10 minutes.

### Can I password-protect only certain pages?

No. Password protection applies to the entire site. For per-page access control, implement authentication in your application code.

### What happens if my build fails?

Your current live deployment remains active. Failed builds do not affect the running site. Check the build logs for error details and try again.

### Can I use a root domain (apex domain)?

Custom domains work with both subdomains (`www.example.com`) and root domains (`example.com`). For root domains, use an A or ALIAS record instead of CNAME, depending on your DNS provider's capabilities.

### Is there a CLI tool?

You can deploy using the DanubeData API with any HTTP client (curl, httpie, etc.) or integrate it into your CI/CD pipeline. See the CLI deployment section for details.

### How do rollbacks work?

Each deployment is saved as an immutable image. Rolling back re-activates a previous image without rebuilding, making rollbacks nearly instant.

## Next steps

- [Static Sites quick start](https://docs.danubedata.ro/static-sites-quickstart) — Deploy your first static site
- [Build with AI](https://docs.danubedata.ro/static-sites-ai) — Use Claude, ChatGPT, or other AI assistants to generate your website
- [Custom domains](https://docs.danubedata.ro/static-sites-domains) — DNS verification and TLS setup
- [Git deployments](https://docs.danubedata.ro/static-sites-git) — Webhooks and auto-deploy

---

**Questions?** Contact support at support@danubedata.ro
