LaunchPad features

How to Password Protect a Static Site (Free)

Hostmargin · · 2 min read
How to Password Protect a Static Site (Free)

Sometimes a site shouldn't be public yet: a client preview, a staging version, internal documentation or a launch that isn't ready. On many static hosts, a password costs extra or needs code. On LaunchPad you can password protect a static site for free on every plan, without touching your code.

How it works

When protection is on, every page asks for a username and password before showing anything. That includes the HTML, images, CSS and JavaScript, so nothing leaks through a direct link. LaunchPad also tells search engines not to index the site, so a preview never shows up in Google.

It's enforced by the web server, not by JavaScript in the page, so it can't be bypassed by turning JavaScript off or reading the page source.

Turn it on

  1. Open your project on LaunchPad and go to the Site controls tab.
  2. Under Password protection, switch it on.
  3. Choose a username and a password, and save.

The setting applies within a few seconds. Nothing is rebuilt, and your current release stays live.

Share it with your client

Send the site address, username and password separately, for example the link by email and the password on WhatsApp. When they open the link, their browser asks for the details once and then remembers them for that session.

Make it public again

Switch protection off in Site controls. The site is public straight away, and search engines are allowed to index it again.

Good to know

  • Custom domains are covered too. Protection applies to your LaunchPad address and every custom domain on the project.
  • SSL keeps working. Certificate renewals still go through, so the site stays on HTTPS while it's locked.
  • Deploys still work. Keep pushing while the site is protected. Visitors only need the password to view it.
  • Use a strong password: at least 8 characters that aren't easy to guess.

Other site controls

Password protection sits next to three other free controls:

  • Maintenance mode shows a "We'll be back soon" page on every URL with a 503 status, so search rankings are kept while you fix something.
  • Scheduled publishing deploys your latest commit at a date and time you choose (IST, up to 90 days ahead).
  • Download a release gives you the exact files that were live, as a ZIP.

Next steps

Ship your next site today

Three projects free, forever. Sign in with your Hostmargin account — no credit card required.