Whether you're a beginner testing your first web page, or a seasoned developer looking to quickly share a prototype with a client, figuring out where and how to host a simple HTML file can feel surprisingly complicated.
Historically, you would need to purchase web hosting, deal with cPanel, configure DNS records, and use an FTP client just to show someone a single web page. Today, it takes less than three seconds.
Method 1: Drag and Drop (The Easiest Way)
If you just have an index.html file (or a folder containing your HTML, CSS, and images), the fastest way to get it online is using a visual dropzone.
- Open your file explorer or Finder and locate your
index.htmlfile. - Navigate to the htmlhost.co homepage.
- Drag your file and drop it anywhere on the page.
That's it. Your file is instantly uploaded to a global edge network, and you are immediately redirected to a live, shareable URL (like https://your-site-name.htmlhost.co). There is no build step and no waiting.
Method 2: Using the CLI (For Developers)
If you prefer working in the terminal, deploying your HTML is just as easy. This is perfect for when you are continuously editing your files and want to push updates rapidly.
First, install the CLI globally via npm:
npm install -g htmlhost-cliNext, navigate to the folder containing your HTML files:
cd path/to/your/projectFinally, run the deploy command:
htmlhost deployThe CLI will automatically upload your directory and provide you with a production URL in your terminal output. Any subsequent deploys in that folder will update the same URL.
What about external CSS and JavaScript?
A common question is whether you can host a full website, or just a single HTML file.
Modern static hosting supports entire directories. As long as your main entry point is named index.html, you can include external stylesheets, scripts, and images. Just drag the entire folder into the dropzone (or run the CLI inside the folder), and all relative paths will work perfectly.
Try it right now
Ready to see it in action? You don't even need to leave this page or create an account. Drag your HTML code into the box below to deploy it instantly.