htmlhost.co
Back to Guides
Developer Guide

How to Deploy HTML Code Online

Pushing static code shouldn't require a complicated CI/CD pipeline. Here is how to deploy HTML, CSS, and JS directories straight to the edge.

As developers, we often build small prototypes, landing pages, or documentation sites that consist entirely of static HTML, CSS, and JavaScript. Yet, when it comes time to deploy HTML code online, we often default to complex platforms that require configuration files, build commands, and waiting for pipelines to run.

htmlhost is built for speed. It skips the build step entirely. Here is how to deploy your HTML projects using our CLI tool.

Step 1: Install the htmlhost CLI

The fastest way to deploy any local directory is via your terminal. You can install the CLI globally using npm:

npm install -g htmlhost-cli

Step 2: Navigate to your project

Open your terminal and navigate to the directory containing your index.html file. The CLI supports multi-page routing automatically, meaning /about.html will cleanly map to /about on the live server.

cd path/to/my-static-site

Step 3: Deploy

To deploy the current directory, simply run:

htmlhost deploy

In less than 3 seconds, your files are uploaded to our global CDN. The terminal will output your live URL (e.g., https://my-project-123.htmlhost.co). A local .htmlhost file is created so subsequent deploys automatically update the same live URL.

What about the browser?

If you don't have Node.js installed or prefer a visual interface, you can also deploy HTML by simply dropping your files or folders into the dropzone on our homepage. It works exactly the same way, instantly provisioning a secure subdomain for your site.

Deploy from your browser

No terminal required. Drop your HTML files below to get a live URL.

Import your project

Free to start
Host and Edit Websites Using AI