DEV Community

Neurobin
Neurobin

Posted on

Publish an HTML File Online Without GitHub Pages, FTP, or a Server


Sometimes you do not have a "website project."

You just have an HTML file.

Maybe it is a prototype from an AI tool. Maybe it is a report exported from a script. Maybe it is a quick documentation page, a product mockup, a pricing table, a portfolio draft, or a static demo for a teammate.

In those cases, setting up GitHub Pages, a full hosting provider, CI, DNS, and a repository can feel heavier than the actual page.

The better question is:

What is the smallest reliable way to turn this HTML file into a public URL?

Here is a practical way to think about it.

First, identify what you actually have

Before choosing a publishing method, decide which type of artifact you are dealing with.

1. One self-contained HTML file

Example:

pricing-demo.html
Enter fullscreen mode Exit fullscreen mode

This is the easiest case. If the CSS and JavaScript are inside the file, you can usually publish it directly.

2. An HTML file with assets

Example:

demo/
  index.html
  styles.css
  app.js
  logo.png
Enter fullscreen mode Exit fullscreen mode

This should be published as a folder or zip so the relative paths still work.

3. A source project

Example:

demo-app/
  package.json
  src/
  public/
  vite.config.ts
Enter fullscreen mode Exit fullscreen mode

This usually needs to be built first.

npm install
npm run build
Enter fullscreen mode Exit fullscreen mode

Then you publish the output folder, such as dist/, not the source folder.

The direct upload approach

For a single HTML file, the simplest workflow is:

  1. Open the publishing tool
  2. Paste or upload the HTML
  3. Get a public HTTPS URL
  4. Share the URL

This is useful for quick review because the recipient does not need to download anything or run a local server.

I keep a short walkthrough of this exact use case here:

Publish HTML online

This style of workflow is especially handy for:

  • HTML reports
  • AI-generated pages
  • Static prototypes
  • One-page documentation
  • Simple demos
  • Temporary review links

The folder upload approach

If your HTML references local files, do not upload only the HTML file.

For example:

<link rel="stylesheet" href="./styles.css" />
<script src="./app.js"></script>
<img src="./preview.png" alt="Preview" />
Enter fullscreen mode Exit fullscreen mode

This page depends on nearby files.

If you upload only index.html, the browser will request styles.css, app.js, and preview.png, but those files will not exist at the published URL.

The correct artifact is the whole folder:

demo/
  index.html
  styles.css
  app.js
  preview.png
Enter fullscreen mode Exit fullscreen mode

Or a zip of that folder.

This is the difference between "uploading an HTML file" and "uploading a static website."

If you want a checklist for that distinction, this guide covers it:

Upload an HTML file to a website

The command-line approach

If you generate HTML locally, a CLI can be faster than opening a browser UI every time.

For example:

npx previewship deploy ./index.html
Enter fullscreen mode Exit fullscreen mode

For a folder:

npx previewship deploy ./demo
Enter fullscreen mode Exit fullscreen mode

For a built frontend project:

npm run build
npx previewship deploy ./dist
Enter fullscreen mode Exit fullscreen mode

This works well if your workflow creates many one-off previews:

npx previewship deploy ./reports/june-growth.html
npx previewship deploy ./mockups/onboarding.html
npx previewship deploy ./experiments/hero-section-v2.html
Enter fullscreen mode Exit fullscreen mode

The mental model is simple:

Deploy the browser-ready artifact.

Do not deploy:

node_modules/
src/
.env
package-lock.json
Enter fullscreen mode Exit fullscreen mode

Do deploy:

index.html
assets/
Enter fullscreen mode Exit fullscreen mode

When GitHub Pages is still a good option

GitHub Pages is great when:

  • The content should live in a repository
  • You want version history
  • You want public source code
  • The site is long-lived
  • The project has docs that should evolve with the code

But it can be too much for:

  • One-off previews
  • Private review links
  • Temporary demos
  • Generated reports
  • AI-generated HTML artifacts
  • Client drafts that may be replaced tomorrow

For those cases, a direct HTML hosting workflow is often faster.

When Vercel or Netlify is still a good option

Vercel and Netlify are excellent for real frontend projects.

They are especially good when you need:

  • Framework builds
  • Environment variables
  • Preview deployments from pull requests
  • Serverless functions
  • Team workflows
  • Custom domains

But if the artifact is just report.html, a full project deployment may be unnecessary.

A practical decision tree

Use this quick rule:

Single HTML file?
  Publish the file directly.

HTML plus assets?
  Publish the folder or zip.

Frontend source project?
  Build it first, then publish the output folder.

Production app?
  Use your normal hosting pipeline.
Enter fullscreen mode Exit fullscreen mode

That rule avoids most broken preview links.

Final checklist

Before sharing the URL, check:

  • The page opens in a private browser window
  • CSS is loading
  • JavaScript is loading
  • Images are loading
  • No links point to localhost
  • No private data is embedded in the file
  • The page title is readable
  • The preview is the final built output

If those pass, you probably have a shareable HTML preview.

For a broader overview of lightweight HTML hosting, this page may help:

Host an HTML file online

Sometimes the best publishing system is not the most powerful one. It is the one that fits the artifact you actually have.

Top comments (0)