How to host an HTML file privately
Five ways to host an HTML file so only chosen people can open it, from basic auth on your own server to a private link. A decision table included.
Last updated
Steps
- 1
Decide who needs access
Write down the people or company domains. This decides which option fits.
- 2
Decide whether you need to know who viewed
If yes, you need an option that verifies identity, not a shared password.
- 3
Pick an option from the table
Match your answers to the decision table below.
- 4
Make the file self-contained
Inline styles, scripts and data so the page does not depend on other hosts.
- 5
Publish, then test as a recipient
Open the link in a private window to see exactly what your reader will see.
Hosting an HTML file is easy. Hosting it so that only the right people can open it takes a decision. There are five realistic options.
The options
| Option | Access control | Know who viewed | Setup | Revoke one person |
|---|---|---|---|---|
| 1. Static host, unlisted URL | None. The URL is the secret | No | Minutes | No |
| 2. Your server with basic auth | Shared username and password | No | An hour, if you have a server | Only by changing the password for all |
| 3. Static host behind an identity proxy | Company sign-in or email allowlist | Yes, in the proxy logs | A few hours | Yes |
| 4. Encrypted HTML file | A passphrase, checked in the browser | No | Minutes | No |
| 5. Private document link | Password, verified email or invite list | Yes | Minutes | Yes |
1. Static host, unlisted URL
Upload the file to any static host and share the address. This is hosting, not private hosting. Use it only for material that could be public.
2. Your own server with basic auth
If you run nginx, two directives protect a folder:
location /reports/ {
auth_basic "Private";
auth_basic_user_file /etc/nginx/.htpasswd;
}
Create the password file with htpasswd -c /etc/nginx/.htpasswd reader. Serve over HTTPS only, because basic auth sends credentials with each request. It is sound for a small trusted group. Everyone shares one login, so you cannot tell readers apart.
3. A static host behind an identity proxy
Put the site behind an access proxy that requires sign-in with a company identity provider or an emailed code. This is strong and auditable. It suits internal audiences. It takes real setup, and external recipients may not have the right identity.
4. An encrypted HTML file
Tools exist that encrypt a page and wrap it in a small script that asks for a passphrase. You can host the result anywhere, even publicly. The trade-off is that anyone can download the file and guess passphrases offline without limit, and you cannot revoke a copy. Use a long passphrase or do not use this at all.
5. A private document link
A document sharing service hosts the file and checks access on each view. Linkwoven is this kind of tool, built for HTML. Recipients verify by email code and do not create accounts. You see who opened the document and can remove one person without affecting the others. See access modes.
Decision table
| Your situation | Use |
|---|---|
| Not sensitive, speed matters | Option 1 |
| Small technical team, you have a server | Option 2 |
| Internal audience with company sign-in | Option 3 |
| No third party may hold the file | Option 4, with a long passphrase |
| External recipients, and you need to know who read it | Option 5 |
| You will update the file and want one stable link | Option 3 or 5 |
One more risk: where the file runs
An HTML file is a program. If you host an untrusted or AI-generated file on a domain that also holds your logins, a script in that file runs with access to that domain's cookies. Host documents on a separate domain from your app. Linkwoven does this by design, as described in the security model.
Make the file portable first
Whichever option you choose, a self-contained file avoids most problems. Inline the CSS and JavaScript, embed the data, and avoid remote images. The HTML checker page has a list and a prompt that does this for you.
Limits of every option
None of these stops a permitted reader from taking a screenshot or copying text. Access control decides who gets in. It does not control what they do afterwards.
Linkwoven is in private beta. Join the waitlist to get access. For a shorter comparison focused on sharing, see how to share an HTML file privately.
Frequently asked questions
- Can I host an HTML file privately for free?
- Yes. Basic authentication on a server you already have costs nothing extra, and several static hosts have free plans. Check each host's current terms. Linkwoven plans a free plan that includes private sharing. Its pricing is not final.
- Is an unlisted URL private?
- No. An unlisted URL is public to anyone who has it. It can be forwarded, logged by chat tools and found in browser history. Treat it as public with a delay.
- Can I host HTML on a cloud drive?
- Cloud drives generally store HTML as a file to download or show as source. They are not built to render it as a page for recipients.
- What is the simplest private option for one recipient?
- A link that requires a verified email from that one address. The recipient types a code from their inbox and nothing else.