Everything you need to deploy, manage, and edit HTML sites from the browser, terminal, or API.
Get a live site in under 30 seconds. No account required for anonymous hosting. Sign in for more sites, longer TTLs, and AI editing.
Go to htmlhost.co/new, paste or drop an HTML file, pick a TTL, and hit Publish. Done.
bash# Install globally
npm i -g htmlhost-cli
# Authenticate (get a token at htmlhost.co/settings#keys)
htmlhost login
# Deploy (auto-detects index.html in current directory)
htmlhost deploy
# ✓ Live at https://bold-fern-x3k.htmlhost.co
# Linked → .htmlhost (future deploys update this site)bashcurl -X POST https://htmlhost.co/api/sites \
-H "Authorization: Bearer hh_live_your_token_here" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello World</h1>","ttl":"7d"}'The htmlhost CLI is a zero-dependency Node.js tool. Requires Node 18+.
bashnpm i -g htmlhost-cliAuthenticate with an API token. Tokens are generated at Settings → API keys. Credentials are saved to ~/.htmlhostrc.
Deploy an HTML file and get a live URL. If no file is specified, defaults to index.html in the current directory.
--ttl <value>stringSet TTL: 1d, 7d, 30d, never--slug <slug>stringRe-deploy to a specific site--title <title>stringSet the site title--newflagForce a new site (ignore .htmlhost link)--no-assetsflagSkip automatic local asset uploading--ttl <value>string--slug <slug>string--title <title>string--newflag--no-assetsflagWhen you deploy, the CLI automatically scans your HTML for local file references — scripts, stylesheets, images, fonts, video, and audio. Each local file is uploaded to your media library, and the references in the HTML are rewritten to point at the hosted URLs. This means your deployed site is fully self-contained and always works.
Files larger than 10 MB are skipped to avoid accidentally depleting storage. External URLs (https://, data:, etc.) are left untouched.
bash# Deploy with automatic asset uploading (default)
htmlhost deploy
# ✓ Found 3 local assets to upload
#
# ✓ styles.css (4.2 KB) → https://htmlhost.co/m/a1b2c3d4
# ✓ app.js (12.1 KB) → https://htmlhost.co/m/e5f6a7b8
# ✓ hero.png (340 KB) → https://htmlhost.co/m/c9d0e1f2
#
# ● Deploying new site…
# ✓ Live at https://bold-fern-x3k.htmlhost.co
# Skip asset uploading
htmlhost deploy --no-assetsThe following references are detected and processed:
<script src>, <link href> — JS and CSS files<img src>, <img srcset> — images<video src>, <video poster>, <audio src> — mediaurl() in <style> blocks and inline styles — CSS backgrounds, fonts, etc.After the first deploy, the CLI saves the site slug to a .htmlhost file in your project directory. On subsequent deploys, the CLI detects this file and asks what to do:
text? This project is linked to bold-fern-x3k.htmlhost.co
1. Overwrite existing site
2. Create a new site instead
3. Cancel
4. Always overwrite (remember for this project)
5. Always create new (remember for this project)
Enter choice (1-5):Choosing option 4 or 5 saves the preference to .htmlhost, so you won't be asked again for that project. Use --new to skip the prompt and force a new site.
bash# First deploy — creates site and .htmlhost link
htmlhost deploy
# Second deploy — prompts to overwrite or create new
htmlhost deploy
# Deploy a specific file
htmlhost deploy contact.html
# Force a new site (bypass .htmlhost)
htmlhost deploy --newList all your sites in a formatted table showing slug, URL, size, TTL, and expiry.
Delete a site by slug. Use --force to skip the confirmation prompt.
Upload images, fonts, or other assets to your media library. Returns permanent URLs to use in your HTML.
bash# Single file
htmlhost upload logo.png
# → https://htmlhost.co/m/a3f91c2b
# Entire directory
htmlhost upload ./assets/Show the authenticated user's email, handle, and plan.
Remove saved credentials from ~/.htmlhostrc.
All endpoints accept Authorization: Bearer <token> headers. Generate tokens at Settings → API keys.
Base URL: https://htmlhost.co
/api/sites/api/sites/api/sites?slug={slug}/api/media/api/media/api/media/api/tokens/api/tokens/api/tokens?id={id}/api/tokens/meCreate a new site or update an existing one.
htmlstringRequired. The HTML content to deploytitlestringOptional. Falls back to <title> tag or auto-generated namettlstringOptional. 1d, 7d, 30d, or never. Defaults to plan defaultslugstringOptional. If provided, re-deploys to that existing sitehtmlstringtitlestringttlstringslugstringjson{
"ok": true,
"id": "550e8400-e29b-41d4-a716-446655440000",
"slug": "bold-fern-x3k",
"url": "bold-fern-x3k.htmlhost.co",
"version": 1,
"ttl": "7d",
"expiresAt": "2026-05-11T08:00:00.000Z"
}Returns all your sites and aggregate usage stats.
json{
"sites": [
{
"id": "...",
"slug": "bold-fern-x3k",
"title": "My Portfolio",
"url": "bold-fern-x3k.htmlhost.co",
"sizeBytes": 4200,
"size": "4.1 KB",
"ttl": "7d",
"expiresAt": "2026-05-11T08:00:00.000Z",
"createdAt": "2026-05-04T08:00:00.000Z",
"updatedAt": "2026-05-04T08:00:00.000Z"
}
],
"usage": {
"siteCount": 1,
"maxSites": 20,
"totalBytes": 4200,
"maxBytes": 524288000,
"plan": "free"
}
}Delete by slug or UUID.
bashcurl -X DELETE "https://htmlhost.co/api/sites?slug=bold-fern-x3k" \
-H "Authorization: Bearer hh_live_your_token"Upload images, fonts, and other assets. Each file gets a permanent URL served from Cloudflare's edge CDN. Use these URLs in your HTML.
Tip: When you htmlhost deploy, local assets are automatically uploaded to your media library and the HTML references are rewritten — no manual upload step needed. See the CLI → Automatic asset uploading section for details.
bashcurl -X POST https://htmlhost.co/api/media \
-H "Authorization: Bearer hh_live_your_token" \
-F "file=@logo.png"bashhtmlhost upload logo.png
htmlhost upload ./images/Images (PNG, JPG, GIF, SVG, WebP, ICO), fonts (WOFF, WOFF2, TTF, OTF), documents (PDF), video (MP4, WebM), audio (MP3, OGG, WAV), and code assets (CSS, JS, JSON).
The browser editor includes an AI assistant that can edit your HTML visually. Click any element, describe the change in natural language, and watch it update live.
Free plan: 10 AI edits per day. Pro plan: 100 edits per day. Uses platform-managed API keys — no setup required.
For unlimited edits, add your own API key from any supported provider. Keys are stored in your browser's localStorage and never sent to our servers.
sk-...sk-ant-...AIza...sk-...sk-ant-...AIza...Pro users can connect custom domains to any site. Go to Settings → Domains and add your domain.
textType: CNAME
Name: your-subdomain (or @ for apex)
Value: sites.htmlhost.co
TTL: AutoSSL is provisioned automatically. Propagation takes 1–10 minutes. We verify ownership via DNS lookup.
Tokens authenticate CLI and API requests. Generate them at Settings → API keys.
texthh_live_a91fc7b3d2e014c8f5a6b9d0e1f2a3b4c5d6e7f8Tokens start with hh_live_ and contain 48 hex characters. The raw token is shown once at creation. We store only the SHA-256 hash on our servers.
When a site's TTL elapses, the public URL goes offline (returns a 410). The site stays in your dashboard so you don't lose track of it.
Questions? Reach out at hey@htmlhost.co