Skip to content
Subnomic
← Back to blog
Sites Nov 13, 2026 · Updated Nov 23, 2026 · 2 min read

Password-protect a static site, no login page

A staging site for a client should not need a server, a password file or a login page written in JavaScript.

A staging site for a client, a draft of the new docs, an internal handbook: plenty of static sites should not be public, and a static site has no server of its own to check a password. The usual ways around that each cost something.

The usual ways, and their catch

What a static site needs is the check done where the files are served, before any of them leaves.

How it works on Subnomic Sites

A site is public by default. On the site’s page you can switch it to one of two modes:

The check happens on the server for every request, so nothing is served before it passes: not the HTML, not the scripts, not the images.

Every request to a protected site is checked before any file is served A visitor asks for any address of the site, a preview included. The request is checked first: a shared password, remembered for 12 hours, or a workspace member's sign-in. If it passes, the site's HTML, scripts and images are served; if not, nothing is served. Protected pages are never cached or indexed. Visitor any page or preview Checked first a shared password, remembered 12 hours, or a member’s sign-in The site HTML, scripts, images Nothing served not one file Protected pages are never cached by anything in front of them, and never indexed.
The check runs where the files are served, so there is no page to view source on and no bundle that holds the password.

What else it covers

Changing the password

Type a new one and save. Turning protection off keeps the password, so turning it back on later does not mean choosing a new one.

Setting it up

npm run build
subnomic sites create client-preview --dir dist
subnomic sites deploy --prod

Then open the site in the console and choose who may see it. Protection is on every plan, the free one included, which has one site with 1 GB of traffic a month. The rest is in the Sites documentation; how this compares with other static hosts’ free plans is in Free static site hosting compared.