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.
What is static hosting?
Section titled “What is static hosting?”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.
Create a static app
Section titled “Create a static app”zerokie apps create --name my-site --type staticApp created: my-siteURL: https://my-site.platform-dev.zerokie.comType: staticYour 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
Section titled “Build your site”Build your site locally before deploying. The output directory depends on your framework:
| Framework | Build command | Output directory |
|---|---|---|
| Astro | npm run build | ./dist |
| Hugo | hugo | ./public |
| Next.js (static) | next build && next export | ./out |
| Plain HTML | — | wherever your files are |
Deploy
Section titled “Deploy”Point the CLI at your build output directory:
zerokie apps deploy my-site --dir ./distDeploying to my-site...Uploaded: 42 files (1.2 MB)Deleted: 0 filesURL: https://my-site.platform-dev.zerokie.comThe deploy process:
- Reads all files in the local directory (dotfiles excluded by default)
- Acquires a deploy lock to prevent concurrent deploys
- Uploads all files to the CDN storage
- Deletes remote files that no longer exist locally
- 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.
Custom domains
Section titled “Custom domains”Add a custom domain to your static app:
zerokie domains add my-site www.example.comDomain added: www.example.comCNAME target: my-site.platform-dev.zerokie.comTLS status: pending
Create a CNAME record with your DNS provider: www.example.com → my-site.platform-dev.zerokie.comThen create a CNAME record with your DNS provider:
www.example.com CNAME my-site.platform-dev.zerokie.comTLS 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:
zerokie domains remove my-site www.example.comRedeploying
Section titled “Redeploying”Run the same deploy command again after rebuilding your site:
npm run buildzerokie apps deploy my-site --dir ./distThe 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.
Environment-specific URLs
Section titled “Environment-specific URLs”Your static app URL depends on the environment:
| Environment | URL pattern |
|---|---|
| Development | https://{app}.platform-dev.zerokie.com |
| Production | https://{app}.platform.zerokie.com |
Custom domains work the same way in both environments — just point the CNAME to the appropriate platform domain.