Skip to content

Static Hosting

Zerokie’s static hosting serves your files directly from a CDN — no containers, no servers to manage. Your site gets automatic TLS, custom domain support, and global edge caching.

Static hosting is for sites built from HTML, CSS, JavaScript, and other assets that don’t require a server at runtime. This includes sites built with Astro, Hugo, Next.js (static export), plain HTML, and any other static site generator.

Files are uploaded to Zerokie and served via CDN. There is no container orchestration involved, which means faster deploys, lower cost, and zero cold starts.

Terminal window
zerokie apps create --name my-site --type static
App created: my-site
URL: https://my-site.platform-dev.zerokie.com
Type: static

Your app is immediately available at the platform URL. The --type static flag is required — without it, Zerokie creates a container app. The app type cannot be changed after creation.

Build your site locally before deploying. The output directory depends on your framework:

FrameworkBuild commandOutput directory
Astronpm run build./dist
Hugohugo./public
Next.js (static)next build && next export./out
Plain HTMLwherever your files are

Point the CLI at your build output directory:

Terminal window
zerokie apps deploy my-site --dir ./dist
Deploying to my-site...
Uploaded: 42 files (1.2 MB)
Deleted: 0 files
URL: https://my-site.platform-dev.zerokie.com

The deploy process:

  1. Reads all files in the local directory (dotfiles excluded by default)
  2. Acquires a deploy lock to prevent concurrent deploys
  3. Uploads all files to the CDN storage
  4. Deletes remote files that no longer exist locally
  5. Purges the CDN cache so visitors see the latest version

To include dotfiles (e.g. .htaccess), use --include-hidden. The .git/ directory is always excluded.

Add a custom domain to your static app:

Terminal window
zerokie domains add my-site www.example.com
Domain added: www.example.com
CNAME target: my-site.platform-dev.zerokie.com
TLS status: pending
Create a CNAME record with your DNS provider:
www.example.com → my-site.platform-dev.zerokie.com

Then create a CNAME record with your DNS provider:

www.example.com CNAME my-site.platform-dev.zerokie.com

TLS is provisioned automatically via Let’s Encrypt once the CNAME record is in place. This typically takes 1-10 minutes depending on DNS propagation.

To remove a custom domain:

Terminal window
zerokie domains remove my-site www.example.com

Run the same deploy command again after rebuilding your site:

Terminal window
npm run build
zerokie apps deploy my-site --dir ./dist

The CLI uploads all files and removes any remote files that are no longer in your local directory. The CDN cache is purged automatically on each deploy, so your changes are visible immediately.

Your static app URL depends on the environment:

EnvironmentURL pattern
Developmenthttps://{app}.platform-dev.zerokie.com
Productionhttps://{app}.platform.zerokie.com

Custom domains work the same way in both environments — just point the CNAME to the appropriate platform domain.