BlogTutorialsHow to Deploy a Static Website with Custom Domain and Free SSL in 2026

How to Deploy a Static Website with Custom Domain and Free SSL in 2026

Adrian Silaghi
Adrian Silaghi
February 24, 2026
12 min read
2 views
#static sites #custom domain #ssl #tls #lets encrypt #web hosting #deploy website #static hosting #https
How to Deploy a Static Website with Custom Domain and Free SSL in 2026

Static websites are faster, more secure, and cheaper to host than dynamic sites. Whether you're building a portfolio, documentation site, marketing page, or single-page application, deploying a static site has never been easier.

This guide walks you through deploying a static website from scratch—including setting up a custom domain and getting free SSL/TLS certificates automatically.

Why Static Sites?

Before diving into deployment, here's why static sites are an excellent choice:

  • Speed: No database queries or server-side rendering means pages load in milliseconds
  • Security: No server-side code means minimal attack surface—no SQL injection, no server exploits
  • Cost: Static hosting is dramatically cheaper than running application servers
  • Reliability: Fewer moving parts means fewer things that can break
  • Scalability: Static files can be served to millions of users without complex infrastructure

Step 1: Choose Your Static Site Generator

If you're starting from scratch, pick a generator that matches your workflow:

Generator Language Best For Build Output
Hugo Go Blogs, docs, fast builds public/
Astro JavaScript Content sites, multi-framework dist/
Next.js (static export) React React SPAs, marketing sites out/
Gatsby React Data-driven static sites public/
Eleventy (11ty) JavaScript Simple, flexible, fast _site/
Nuxt (static) Vue Vue SPAs, content sites .output/public/
Plain HTML/CSS N/A Simple sites, landing pages Your project folder

Already have a built site? Skip to Step 2—you can deploy any folder of static files.

Step 2: Build Your Site

Run your generator's build command to produce the output directory:

# Hugo
hugo --minify

# Astro
npm run build

# Next.js (static export - add output: 'export' to next.config.js)
npm run build

# Eleventy
npx @11ty/eleventy

# Gatsby
gatsby build

# Nuxt (static)
npx nuxi generate

You'll get a folder of HTML, CSS, JavaScript, and image files ready to deploy.

Step 3: Deploy Your Static Site

DanubeData Static Sites supports three deployment methods. Choose the one that fits your workflow.

Method 1: ZIP Upload (Simplest)

Best for quick deploys, one-off sites, or when you build locally.

  1. ZIP your build output: Select all files in your build directory (e.g., dist/) and create a ZIP archive
  2. Create a new site at danubedata.ro/static-sites/create
  3. Choose "ZIP Upload" as your deploy method
  4. Upload your ZIP file (up to 200 MB)
  5. Your site is live at yoursite.pages.danubedata.ro within seconds

That's it. No Git, no CLI, no configuration files. Just upload and go.

Method 2: Git Repository (Recommended for Teams)

Best for ongoing projects where you want automatic deploys on every push.

  1. Create a new site and choose "Git Repository"
  2. Enter your repository URL (GitHub, GitLab, or Bitbucket)
  3. Select the branch to deploy from (default: main)
  4. Set the publish directory: Tell DanubeData where your build output lives (e.g., dist/, build/, public/)
  5. For private repos: Add an SSH key or access token for authentication
  6. Enable auto-deploy (optional): DanubeData will generate a webhook URL—add it to your repository settings

Now every push to your branch triggers an automatic build and deployment.

Method 3: CLI Push (For CI/CD Pipelines)

Best for custom build pipelines, GitHub Actions, or other CI/CD systems.

# Deploy via API using curl
curl -X POST https://danubedata.ro/api/v1/static-sites/{site-id}/deploy 
  -H "Authorization: Bearer YOUR_API_TOKEN" 
  -F "archive=@dist.zip"

Integrate this into your GitHub Actions, GitLab CI, or any CI/CD pipeline for fully automated deployments.

Example: GitHub Actions Workflow

# .github/workflows/deploy.yml
name: Deploy Static Site

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install and Build
        run: |
          npm ci
          npm run build

      - name: Deploy to DanubeData
        run: |
          cd dist
          zip -r ../site.zip .
          curl -X POST https://danubedata.ro/api/v1/static-sites/${{ secrets.SITE_ID }}/deploy 
            -H "Authorization: Bearer ${{ secrets.DANUBEDATA_TOKEN }}" 
            -F "archive=@../site.zip"

Step 4: Set Up Your Custom Domain

Your site is live on yoursite.pages.danubedata.ro, but you probably want your own domain. Here's how:

4.1 Add the Domain

In your site's dashboard, go to Domains and click Add Domain. Enter your domain (e.g., www.example.com or example.com).

4.2 Verify Domain Ownership

DanubeData generates a unique verification token. Add a DNS TXT record:

Record Type Name/Host Value
TXT _danubedata-verify.example.com your-verification-token

Click Verify in the dashboard. DNS propagation usually takes a few minutes, but can take up to 48 hours.

4.3 Point Your Domain

Once verified, add a CNAME record pointing to your DanubeData site:

Record Type Name/Host Value
CNAME www yoursite.pages.danubedata.ro

For root/apex domains (e.g., example.com without www), use an ALIAS or ANAME record if your DNS provider supports it, or use an A record pointing to the DanubeData ingress IP.

4.4 Automatic TLS (Free SSL)

Once your CNAME is active, DanubeData automatically provisions a TLS certificate via Let's Encrypt. This happens within minutes—no configuration needed.

Your site will be accessible via HTTPS with a valid certificate that auto-renews before expiration. HTTP requests are automatically redirected to HTTPS.

Step 5: Password Protect Your Site (Optional)

Need to protect a staging site or client preview? DanubeData includes password protection on every plan—even the free one.

  1. Go to your site's Settings
  2. Enable Password Protection
  3. Set a username and password
  4. Save—your site now requires credentials to access

This uses HTTP Basic Authentication, so visitors see a browser login prompt. It's perfect for:

  • Client staging sites before launch
  • Internal documentation
  • Pre-release marketing pages
  • Design previews for feedback

Step 6: Set Up Auto-Deploy from Git

If you're using the Git repository method, enable automatic deploys:

  1. Go to your site's Settings
  2. Enable Auto-deploy on push
  3. Copy the generated webhook URL
  4. Add it to your Git provider:
    • GitHub: Settings → Webhooks → Add webhook
    • GitLab: Settings → Webhooks → Add new webhook
    • Bitbucket: Repository settings → Webhooks → Add webhook
  5. Set the event to push events on your deploy branch

Now every commit to your branch triggers an automatic build and deploy. You can monitor builds in real-time from the dashboard.

Step 7: Rollback to Previous Versions

Made a mistake? Rollbacks are instant:

  1. Go to your site's Deployments tab
  2. Find the previous working deployment
  3. Click Activate
  4. Your site instantly reverts—no rebuild needed

DanubeData stores container images for each deployment, so rollbacks are instantaneous. There's no waiting for a new build.

Performance Optimization Tips

DanubeData automatically applies optimized caching headers, but here are additional tips to maximize performance:

Built-in Caching

DanubeData's nginx configuration applies these cache headers automatically:

File Type Cache Header Duration
CSS, JavaScript, Fonts public, max-age=31536000, immutable 1 year
Images (jpg, png, webp, avif, svg) public, max-age=604800 7 days
HTML no-cache Always revalidated

Additional Optimization Tips

  • Use hashed filenames for CSS/JS (e.g., main.a1b2c3.css)—this pairs perfectly with the 1-year immutable cache
  • Use modern image formats: WebP or AVIF reduce image sizes by 25-50% compared to JPEG/PNG
  • Minify your HTML, CSS, and JavaScript during the build step
  • Enable gzip compression—DanubeData's nginx has this enabled by default
  • Lazy-load images below the fold with loading="lazy"
  • Preload critical assets with <link rel="preload"> for fonts and above-the-fold CSS

Pricing

DanubeData Static Sites offers transparent, flat-rate pricing:

Plan Price Storage Bandwidth Sites Custom Domains
Free €0/mo 100 MB 10 GB 2 2 per site
Starter €2.99/mo 500 MB 100 GB 10 10 per site
Pro €9.99/mo 2 GB 500 GB 50 50 per site

All plans include: Git deploy, CLI push, ZIP upload, custom domains, free TLS, password protection, instant rollbacks, real-time build logs, and SPA support.

Get Started

Ready to deploy your static site?

Deploy Your Static Site Now — Free plan available, no credit card required.

Your site will be live in under 5 minutes with a custom domain and free HTTPS. All data is hosted in the EU (Germany) for full GDPR compliance.

Need help with your deployment? Contact our team—we're happy to assist.

Share this article

Ready to Get Started?

Deploy your infrastructure in minutes with DanubeData's managed services.