htmlhost.co
clideploymulti-pagedirectorytutorial

Deploy Entire Folders with a Single Command

htmlhost.co·September 15, 2026·3 min read
Deploy Entire Folders with a Single Command

The problem with file-by-file uploads

Most websites aren't a single HTML page. Even a simple portfolio has separate files for CSS, a few pages for different sections, and maybe some images or fonts. Uploading these one by one through a browser is tedious and error-prone. Miss a CSS file? Your layout breaks. Forget to update an image path? Broken thumbnails.

The htmlhost CLI solves this by deploying your entire project folder at once.

How it works

Open your terminal, navigate to your project folder, and run:

htmlhost deploy

No arguments needed. The CLI treats the current directory as your project root and uploads everything inside it.

Before uploading, you'll see a summary showing every file and its size, along with a total count. Nothing goes live until you confirm.

How files become URLs

The CLI maps your file names to clean URL paths automatically. Here's how the mapping works:

Local fileLive URL path
index.html/ (homepage)
about.html/about
contact.html/contact
blog/index.html/blog
blog/first-post.html/blog/first-post

No file extensions in the URL, no trailing slashes. Just clean paths that match your folder structure.

What gets included (and what doesn't)

The CLI uploads all files in your folder, including HTML, CSS, JavaScript, images, fonts, and any other assets. But it's smart about what to skip:

  • node_modules/ and .git/ are always excluded
  • .DS_Store, .env files, and other OS/editor artifacts are skipped
  • Lock files like package-lock.json and yarn.lock are excluded
  • The .htmlhost link file itself is never uploaded

You don't need a .gitignore or a deploy config. The defaults cover what 99% of projects need.

Custom 404 pages

Add a 404.html file to your project and htmlhost serves it automatically when someone visits a URL that doesn't match any of your pages. No configuration required.

Incremental uploads

When you run htmlhost deploy a second time, the CLI compares file hashes with what's already on the server. Files that haven't changed are skipped, so only the differences are uploaded. This makes re-deploys fast, even for large projects.

You'll see "Skipped (unchanged)" next to files that didn't need uploading, and "Uploaded" next to files that were new or modified.

The .htmlhost link file

After your first deploy, the CLI creates a .htmlhost file in your project folder. This small JSON file records which remote site your project is linked to, along with sync metadata like the version number and last deploy time.

This link is what makes re-deploys seamless. You never have to remember a slug or pass extra flags. Just run htmlhost deploy again and the CLI knows where to send your files.

Tip: add .htmlhost to your .gitignore if you share the repo with others and want each person to have their own deploy target.

A practical example

Imagine you're building a documentation site for a small open-source project. Your folder looks like this:

docs/
├── index.html
├── getting-started.html
├── api-reference.html
├── styles.css
├── logo.png
└── 404.html

From inside the docs folder, run:

htmlhost deploy

Within seconds, you'll have live URLs at:

  • your-slug.htmlhost.co/ (your homepage)
  • your-slug.htmlhost.co/getting-started
  • your-slug.htmlhost.co/api-reference

CSS, the logo, and the custom 404 page are all included. Share the URL and your docs are live.

What's next

Deploying the folder is just the start. If someone edits the site through the web editor, you can pull those changes back to your local folder with htmlhost pull. And if the site was originally created in the browser, you can clone it locally to start editing in your own code editor.

Ready to try it yourself?

Paste HTML, get a link. Deploy your site in under 3 seconds — no config, no build step.

Start hosting