Skip to content

Deploy a static website

Serve HTML/CSS/JS files on your instance and publish them over HTTPS in minutes.

Static website deployment - files served from an instance

What you'll run

Your built site files (from Next.js, Vite, Hugo, Astro, or a plain HTML folder) served by a small web server on one port inside the instance. The platform edge handles HTTPS, so there is no certificate setup and no need to publish ports 80/443.

Upload your files

bash
$ # From your local machine:
$ scp -P <sshPort> -r ./dist/* root@<node-ip>:/root/site/

Serve them on port 8080

bash
$ docker run -d \
--name site \
--restart unless-stopped \
-p 8080:80 \
-v /root/site:/usr/share/nginx/html:ro \
nginx:alpine

Prefer something smaller? python3 -m http.server 8080 --bind 0.0.0.0 works for a quick test. For production, nginx or Caddy in Docker is a better fit.

SPA fallback (React/Vue/Svelte)

A single-page app needs unknown paths to return index.html. Run Caddy inside the instance on port 8080 with this Caddyfile:

text
:8080 {
root * /srv
encode gzip
try_files {path} /index.html
file_server
}
bash
$ docker run -d --name site --restart unless-stopped \
-p 8080:8080 \
-v /root/site:/srv:ro \
-v /root/Caddyfile:/etc/caddy/Caddyfile:ro \
caddy:2

Set the origin port and open the URL

In the dashboard, open Networking, set the web site origin to 8080, and save. Open the HTTPS URL shown there.

bash
$ curl -sI https://<hostname>.nairacloud.xyz
$ curl -s https://<hostname>.nairacloud.xyz | head -1

Use your own domain

Add an A record pointing at the node IP, then attach the hostname under Custom domain in the same tab. The platform issues HTTPS automatically; keep the DNS record DNS-only if your provider offers a proxy.

Practical -- try it now

Live website in under 10 minutes

  1. Provision an instance, SSH in, and upload your built files.
  2. Serve them on port 8080 and set that as the web site origin in Sites.
  3. Open the HTTPS URL -- no DNS or certificate setup required.
Ask a question...
Ctrl+I