</> HTML5Advent
ENFRESDEITPT

// hosting · Web Platform Advent #12

Static website hosting: how to deploy an Astro, Vite or plain HTML site

What static hosting is, how a CDN serves your build, and how to deploy an Astro, Vite or JAMstack site with a custom domain and free HTTPS.

A technician's hand servicing a blue-lit server in a data center rack

A static website is a set of pre-built files - HTML, CSS, JavaScript and assets - that a server can hand to the browser as-is, with no code running per request. Tools like Astro, Vite, Eleventy or a hand-written HTML folder all produce this kind of output. Hosting it is simpler, cheaper and faster than hosting a dynamic app, because there is nothing to execute server-side.

What "static hosting" actually means

With static hosting, you run a build step locally or in CI, and it emits a folder of plain files (often called dist or _site). The host's only job is to store those files and serve them over HTTP. There is no PHP, no Node process, no database - just files. That has three direct consequences:

  • Speed - files can be cached aggressively and served from the edge, close to the visitor.
  • Cost - no always-on server to pay for; many providers offer a generous free tier.
  • Reliability - fewer moving parts means fewer things that can break under load.

Building your output folder

Every static framework exposes a build command. The result is the folder you upload or point your host at:

# Astro
npm run build        # outputs to ./dist

# Vite
npm run build        # outputs to ./dist

# Plain HTML
# no build step - your folder of .html files is already the output

For a plain HTML site, the "build" is just the folder you already have. For Astro or Vite, the dist directory is what gets served.

A row of black rack-mounted servers in a data center
Behind every static site is physical infrastructure - racks of servers and CDN edge nodes that store and distribute your built files.

Where to host: CDN vs. classic static hosting

You have two broad families of options:

Edge / CDN platforms

These build your project from a Git repository and distribute the output across a content delivery network. A CDN stores copies of your files in many locations worldwide, so a visitor is served from a node near them. This minimizes latency and absorbs traffic spikes. Deploys are usually triggered by a git push.

Classic / object-storage hosting

You can also serve a static site from a traditional web host or from object storage with a CDN in front of it. This is a good fit when you already have hosting for other projects, or when you prefer to manage the upload yourself over FTP/SSH or a deploy script.

Connecting a custom domain

Whichever host you choose, the domain wiring is the same in principle. You point your domain's DNS records at the host:

  • An A (or AAAA) record pointing the apex domain (example.com) to the host's IP, or
  • A CNAME record pointing a subdomain (www.example.com) to the host's provided hostname.

Many platforms also support nameserver delegation, where you hand DNS management to the host entirely. After the records propagate, the host serves your site on your own domain.

Example: a static HTML site on Infomaniak (Switzerland) with your own domain

If you want the files hosted in Switzerland rather than on a global CDN, Infomaniak is a common choice. Its two relevant offers for a static site, as listed on infomaniak.com on 20 November 2026:

OfferPriceWhat fits a static siteLimit to know
Web Hosting StarterFree with a domain registered at InfomaniakA single simple HTML page (CV, links)10 MB, built with Infomaniak's Welcome Page tool, not for uploading an Astro or Vite build
Web HostingFrom CHF 10.91 / month, 30-day free trial (card required)Any dist folder, up to 20 sites, unlimited trafficShared hosting: you upload files, there is no build step on their side

The deployment for an Astro, Vite or hand-written site on the paid Web Hosting plan:

  1. Build locally: npm run build produces dist/. For a plain HTML site, your folder is already the output.
  2. Create the site in the Manager and attach your domain. If the domain is registered at Infomaniak, the DNS records are created for you. If it is registered elsewhere, either point its nameservers to Infomaniak or add the A/AAAA records the Manager shows, as described above.
  3. Upload the contents of dist/ (not the folder itself) into the site's root directory by FTP, or over SSH, which the plan includes, for example rsync -avz --delete dist/ user@host:path/to/site/. The --delete flag removes old hashed assets so the server matches your build.
  4. Enable HTTPS with the free Let's Encrypt certificate from the Manager, then force the redirect from HTTP to HTTPS.

For one static page with no build, the free Starter is enough. For a real Astro or Vite project, or several sites, the paid plan is the one that takes your files. If you already deploy with Git to a CDN platform, Infomaniak mainly makes sense when Swiss hosting or bundling email with the domain matters to you. See Infomaniak's Web Hosting plans.

HTTPS for free

HTTPS is no longer optional - browsers flag plain HTTP as "not secure", and many web platform APIs only work in a secure context. The good news: virtually every modern static host issues and renews TLS certificates for you automatically, usually via Let's Encrypt. Once your domain is connected, the certificate is provisioned without any manual step, and renewals happen on their own.

Quick reference

StepWhat you do
BuildRun npm run build (Astro/Vite) or use your HTML folder
OutputServe the dist / _site folder
HostPick an edge/CDN platform or a static-capable web host
DomainPoint A/AAAA or CNAME records at the host
HTTPSAutomatic TLS certificate, no manual setup

The whole point of static hosting is that it gets out of your way: you build once, push, and the files are served fast from the edge. Reserve dynamic hosting for the parts of your project that genuinely need server-side logic - and keep the static frontend on infrastructure built to deliver files quickly.