---
title: "Deploy a Static Website"
description: "Host HTML, CSS, JavaScript, and static-site generator bundles on Hosted EZ with zero-PHP nginx serving, versioned archive deploys, and 1-click atomic rollbacks."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.hostedez.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a Static Website

Hosted EZ's **Static Site** runtime serves files directly from nginx over HTTP/2 and HTTP/3 with Brotli and gzip compression, TLS 1.3, automatic HTTPS, and zero PHP overhead. Hidden dotfiles (except `/.well-known/acme-challenge/`) and `*.php` requests return `404` automatically.

## Create a Static Site

1. **Choose Static Site in the New Site wizard**

   Open **Sites → New site** in [app.hostedez.com](https://app.hostedez.com/dashboard?tab=sites&new=1), select **Static Site**, and continue to Step 2.
2. **Configure static delivery options**

   Enter a site name and configure initial routing defaults (you can change these anytime in **Routing → Static Delivery**):
- **SPA fallback**: enable for client-side routers (React Router, Vue Router, TanStack Router) so unmatched paths serve `/index.html`.
- **Clean URLs**: enable for static site generators (Astro, Next.js static export, Hugo) so `/about` resolves `/about.html` cleanly.

3. **Package your build output**

   Build your site locally and archive the output directory into a `.zip`, `.tar.gz`, or `.tgz` file:

### zip

```bash
# Example: bundle dist/ into dist.zip
zip -r dist.zip dist/
```
### tar.gz

```bash
# Example: bundle dist/ into dist.tar.gz
tar -czf dist.tar.gz -C dist .
```

   > **Automatic wrapper-folder stripping**
   >
   > If every file in your archive sits inside a single top-level folder (such as `dist/` or `build/`), Hosted EZ automatically strips that wrapper folder during extraction so `dist/index.html` becomes `/index.html`. macOS `__MACOSX/` and `.DS_Store` metadata entries are also stripped cleanly.
4. **Upload and deploy**

   Open your site's **Deployments** tab, drag and drop your archive onto the upload zone, add an optional release note (up to 500 characters), and click **Deploy**.

## How atomic deploys & rollbacks work

When you upload a release archive:

1. Hosted EZ extracts and validates the archive in an isolated staging directory—your live site keeps serving the previous release throughout upload and extraction.
2. Permissions are normalized and an immutable `.tar.gz` release snapshot is persisted for rollback.
3. Hosted EZ swaps `public_html` atomically in one filesystem operation—zero half-deployed files and zero downtime.
4. If **Global Edge CDN** is enabled on the site, Hosted EZ automatically purges the edge cache as part of the deploy.
5. Up to **10 release snapshots** are retained on disk per static site.

To revert to a previous release, open the **Deployments** tab, click **Rollback** on any retained version, optionally enter a rollback note, and confirm. Rollbacks swap `public_html` atomically, record a new version entry pointing to the restored snapshot, and purge the Global Edge CDN automatically.

## Archive limits & security rules

| Rule | Limit / Behavior |
| --- | --- |
| **Supported formats** | `.zip`, `.tar.gz`, `.tgz` |
| **Max uploaded archive size** | `100 MiB` |
| **Max extracted size** | `512 MiB` (also capped by your account SSD storage quota) |
| **Max regular files per deploy** | `20,000` files |
| **Retained rollback releases** | `10` most recent releases |
| **Forbidden archive entries** | Symlinks, hardlinks, absolute paths, `..` traversal, Windows backslashes (`\`), device/FIFO/socket entries |
| **Auto-ignored entries** | `__MACOSX/` trees and `.DS_Store` files |
| **Default directory index** | `index.html` (directory listing is disabled) |

## Default caching behavior

Out of the box, nginx sets sensible `Cache-Control` headers on static sites:

- **Static assets** (`.css`, `.js`, `.mjs`, `.svg`, `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.avif`, `.ico`, `.woff`, `.woff2`, `.ttf`, `.otf`, `.eot`, `.map`): `public, max-age=604800` (7 days).
- **HTML & other documents**: `no-cache, must-revalidate` so browsers always pick up new deployments immediately.
- **Password-protected paths**: `private, no-store` to prevent shared caches from storing private content.

To set `public, max-age=31536000, immutable` on hashed asset folders (like `/assets` or `/_astro`), add a Custom Response Header rule in **Routing → Static Delivery**. See [SPA Routing, Clean URLs & Custom Headers](/domains/spa-routing-and-headers).

## Alternative deployment methods

- **Automated CI/CD**: Deploy on every push to `main` from GitHub Actions using SFTP and SSH public keys. See [SFTP & GitHub Actions CI/CD](/deploy/sftp-and-github-actions).
- **Quick single-file edits**: Edit `index.html`, `robots.txt`, or `sitemap.xml` directly in the dashboard using the [File Manager](/deploy/file-manager-and-terminal).
- **AI Agents**: Deploy static bundles and inspect releases programmatically via the [Hosted EZ MCP Server](/automation/mcp-server).

> **SFTP edits vs. versioned releases**
>
> Uploading files via SFTP or File Manager writes directly to `public_html` without creating a versioned release snapshot. If you need 1-click rollbacks for every release, deploy via the **Deployments** tab (or MCP static deployment tools).

## Framework guides

- [Deploy React & Vite](/deploy/react-vite) — Configure Vite builds, SPA fallback, hashed asset caching, and GitHub Actions.
- [Deploy Astro & Next.js Static Export](/deploy/astro-nextjs-static) — Export static HTML with Clean URLs, Custom 404 pages, and security headers.
- [SPA Routing & Custom Headers](/domains/spa-routing-and-headers) — Full reference for SPA fallback, Clean URLs, Custom 404, and all 15 allowlisted headers.
- [Connect a Custom Domain](/domains/connect-custom-domain) — Serve your static site from your own domain with automatic HTTPS.

Source: https://docs.hostedez.com/deploy/static-sites/index.mdx
