# Static Sites quick start

Deploy a static website on DanubeData in under 5 minutes. This guide walks you through building a simple site and deploying it step by step.

## Prerequisites

- A DanubeData account ([sign up at danubedata.ro](https://danubedata.ro))

## What you will build

A personal portfolio page with your name, a short bio, and links — hosted at `https://your-slug.pages.danubedata.ro` with automatic HTTPS.

## Step 1: Create your website files

Create a folder on your computer called `my-site` with a single `index.html` file:

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Jane Doe — Developer</title>
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: #0f172a;
      color: #e2e8f0;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .card {
      text-align: center;
      max-width: 480px;
      padding: 3rem 2rem;
    }
    h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #f8fafc; }
    .subtitle { color: #94a3b8; margin-bottom: 1.5rem; }
    p { line-height: 1.7; color: #cbd5e1; margin-bottom: 2rem; }
    .links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
    .links a {
      color: #38bdf8;
      text-decoration: none;
      padding: 0.5rem 1.25rem;
      border: 1px solid #38bdf8;
      border-radius: 6px;
      transition: all 0.2s;
    }
    .links a:hover { background: #38bdf8; color: #0f172a; }
  </style>
</head>
<body>
  <div class="card">
    <h1>Jane Doe</h1>
    <div class="subtitle">Full-Stack Developer</div>
    <p>I build web applications with modern tools.
       Currently exploring cloud infrastructure and open source.</p>
    <div class="links">
      <a href="https://github.com/janedoe">GitHub</a>
      <a href="https://linkedin.com/in/janedoe">LinkedIn</a>
      <a href="mailto:jane@example.com">Email</a>
    </div>
  </div>
</body>
</html>
```

Open `index.html` in your browser to preview it locally.

> **Tip:** You can also use an AI assistant like Claude or ChatGPT to generate your site. See the [Build with AI](https://docs.danubedata.ro/static-sites-ai) guide for prompts and examples.

## Step 2: Package your site as a ZIP file

Select all files inside your `my-site` folder and compress them into a ZIP file.

**macOS:**
```bash
cd my-site
zip -r ../my-site.zip .
```

**Windows:**
Right-click the files inside the folder > **Send to** > **Compressed (zipped) folder**.

**Linux:**
```bash
cd my-site
zip -r ../my-site.zip .
```

Important: the `index.html` must be at the **root** of the ZIP, not nested inside a subfolder.

## Step 3: Create a static site in the dashboard

1. Log in to the DanubeData dashboard
2. Click **Static Sites** in the sidebar
3. Click **Create Static Site**
4. Fill in the form:
   - **Site name** — `my-portfolio` (or any name you like)
   - **Slug** — auto-generated from the name; this becomes your URL
   - **Description** — optional
5. Choose a plan:

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

6. Select **ZIP Upload** as the deployment method
7. Click **Create Static Site**

## Step 4: Upload your ZIP file

1. On the site detail page, click the **Upload** button
2. Select your `my-site.zip` file
3. The upload starts and a build is triggered automatically

## Step 5: Wait for deployment

Watch the status on the dashboard — it updates in real time:

1. **Pending** — Build queued
2. **Building** — Your site is being built
3. **Deploying** — Rolling out your site
4. **Active** — Your site is live

Most builds complete in 1-2 minutes.

## Step 6: Visit your site

Once the status shows **Active**, click the URL on the site detail page:

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

Your site is now live with automatic HTTPS.

## Step 7: Update your site

To deploy a new version:

1. Edit your local files
2. Create a new ZIP file
3. On the site detail page, click **Upload** and select the new ZIP
4. The previous version stays live until the new build succeeds

## Next steps

Now that your site is deployed, here are some things you can do:

### Add a custom domain

Point your own domain (e.g., `www.janedoe.com`) to your static site with automatic TLS:

1. Go to the site detail page > **Domains** tab
2. Click **Add Domain** and enter your domain
3. Add the DNS TXT record shown in the dashboard for verification
4. After verification, add a CNAME record pointing to `{slug}.pages.danubedata.ro`
5. A TLS certificate is provisioned automatically

See the [Custom Domains guide](https://docs.danubedata.ro/static-sites-domains) for detailed DNS instructions.

### Switch to Git deployment

For continuous deployment from GitHub, GitLab, or Bitbucket:

1. Push your site files to a Git repository
2. Edit your static site in the dashboard
3. Change the deployment method to **Git Repository**
4. Enter your repository URL, branch, and publish directory
5. Set up a webhook for automatic deploys on push

See the [Git Deployments guide](https://docs.danubedata.ro/static-sites-git) for step-by-step webhook setup.

### Deploy from CI/CD

Use the API to deploy from any CI/CD pipeline:

```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
```

### Enable password protection

Restrict access to your site (useful for staging or client previews):

1. Go to the site detail page > **Edit**
2. Enable **Password Protection**
3. Enter a username and password
4. Click **Save**

### Roll back to a previous version

If something goes wrong after a deploy:

1. Go to the site detail page > **Deployments** tab
2. Find the version you want to restore
3. Click **Activate**

Rollbacks are instant — no rebuild required.

## Quick reference

| Operation | How |
|-----------|-----|
| Upload new version | Site detail page > **Upload** > select ZIP file |
| Trigger rebuild | Site detail page > **Redeploy** |
| View build logs | Site detail page > click on a build entry |
| Roll back | **Deployments** tab > **Activate** on a previous deployment |
| Add custom domain | **Domains** tab > **Add Domain** |
| Enable password protection | **Edit** > toggle **Password Protection** |
| Delete site | Site detail page > **Delete** |

## Troubleshooting

### Build failed

- Check the build logs on the site detail page for error details
- Ensure your ZIP file contains valid static files (HTML, CSS, JS)
- Verify the ZIP is not corrupted and is within your plan's upload limit (100 MB on Free, 500 MB on Starter and Pro)
- Make sure `index.html` is at the root level of the ZIP, not in a subfolder

### Site shows "404 Not Found"

- Ensure your site has an `index.html` file at the root of the publish directory
- For SPAs, verify that the publish directory setting matches your build output folder

### Custom domain not working

- Verify the DNS TXT record is in place and verification status shows **Verified**
- Ensure you have added a CNAME record pointing to `{slug}.pages.danubedata.ro`
- DNS changes may take up to 24 hours to propagate, though most take only minutes

### Git webhook not triggering builds

- Verify the webhook URL and secret match what is shown in the dashboard
- Check that the webhook is configured for push events
- Ensure **Auto-deploy on push** is enabled in the site settings

## Related guides

- [Build with AI](https://docs.danubedata.ro/static-sites-ai) — Use Claude, ChatGPT, or other AI assistants to generate your website
- [Static Sites product documentation](https://docs.danubedata.ro/static-sites) — Full feature reference
- [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
