
How to Publish Gemini-Generated HTML as a Shareable Web Page
Publish HTML from the Gemini website or app: copy a complete file, preview it, get a standalone link and check it on your phone.
If Gemini has written a complete HTML page, you can publish a separate copy with dochost and send people a link to the rendered page. Ask for one self-contained HTML document, copy the full source, paste it into HTML to URL, then select Get my link. Recipients do not need your Gemini conversation.
This guide covers the Gemini website or app. For Gemini CLI, see the separate CLI and MCP publishing guide.
When Gemini’s own share link is enough
Gemini supports sharing Canvas content through its own public links. If that meets your needs, use the built-in option described in Google’s Canvas sharing instructions.
Publishing HTML elsewhere creates a separate copy. It does not automatically transfer Canvas AI features, shared data, or hosted services. Copying HTML is not a migration of the whole app.
1. Ask for a page that can travel on its own
A file:// address points to a file on your device. Sending that address does not send the file. A hosted HTTPS link lets another browser retrieve a published copy.
Try this prompt in Gemini:
Create one complete, self-contained HTML page for a neighborhood reading corner project update. Use fictional content, with a title, summary, three milestones and an expandable Next steps section. Put CSS in a style element and use native HTML interactions. Include UTF-8 encoding and a mobile viewport. Do not use external libraries, local files, API keys, a backend or a build step. Return the whole document from doctype through the closing html tag.
If Gemini returns React source, package.json, or npm instructions, ask for plain HTML first. Uploading code does not run a build or create a backend.
2. Copy the complete source
Copy the HTML itself, without explanatory text or surrounding Markdown code fences. Check the closing tag is present. If the response was cut off, ask for a shorter complete document.
Alternatively, save the source as a UTF-8 .html file, not page.html.txt. Controls vary by device and output type; this workflow requires the complete source rather than a specific export button.
3. Publish on dochost
- Open HTML to URL. Paste the code or upload the
.htmlfile, and select HTML format. - Review the preview: heading, spacing, links and interactions.
- Choose visibility. Public on Explore makes the page discoverable there. Private means link-only: anyone who obtains the viewing link can open it. This is separate from password protection.
- Select Get my link. Resolve any safety-review or error status before sharing.
- Copy the viewing link. Keep the Edit link private: possession can allow someone to rewrite your page.
Free publishing allows 10 live pages, 1 MB per page, and an initial lifetime of 7 days for public pages or 3 days for private pages. Paid plans support permanent links and password protection. Trial pages have separate expiry rules: check the actual expiry shown for your page. See plan limits.
4. Check the link as a recipient
Open the viewing URL in a private browser window and on your phone. It should show the rendered page without access to your Gemini account. Test buttons and links, expand sections, and check long text fits the screen.
Images stored beside your HTML do not upload automatically. Paths such as images/photo.jpg, styles.css and app.js require files that a standalone upload does not include. Inline small assets or use suitable public HTTPS URLs. External resources remain dependencies and can fail or require login. Check every image from a second device.
Keep a local copy of your source as a backup.
A small example to try
This example has no scripts, external assets or personal information. The expandable section uses native HTML.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Reading corner — fictional example</title>
<style>
* { box-sizing: border-box; }
body { margin: 0; padding: 24px; background: #eef2f6;
color: #162235; font: 18px/1.6 system-ui, sans-serif; }
main { max-width: 680px; margin: 32px auto; padding: 28px;
background: white; border-radius: 18px; overflow-wrap: anywhere; }
h1 { line-height: 1.15; }
summary { cursor: pointer; font-weight: 700; }
</style>
</head>
<body>
<main>
<p>Fictional example</p>
<h1>A neighborhood reading corner</h1>
<p>Our sample team is preparing a shared reading space.</p>
<ul><li>Choose a quiet space.</li><li>Collect books.</li><li>Prepare a welcome sign.</li></ul>
<details><summary>Next steps</summary><p>Review the layout and choose a shelf location.</p></details>
</main>
</body>
</html>Troubleshooting
The link displays code. Select HTML instead of Markdown, copy the actual source and remove surrounding code fences.
Styles or images are missing. Look for relative paths and ask Gemini for a self-contained version. Uploading an entry file does not upload its folder.
A button stops working. Check JavaScript errors and unavailable endpoints. Hosting does not supply a database, payment service or backend. See JavaScript troubleshooting.
There is a form. A visible form does not prove responses are saved. Verify the receiving service separately and never embed passwords or API keys in client-side HTML.
I want to revise the same link. For anonymous publishing, use the private edit link while valid. For signed-in publishing, edit your page from the dashboard. Both preserve the viewing URL. Invalidated tokens and moderation restrictions still apply. See how edit links work.
Is this a Gemini integration?
This is a manual copy-and-paste or file-upload workflow. It does not require a Gemini extension or give dochost access to your Gemini account. The existing dochost browser extension supports ChatGPT and Claude; this guide does not describe a Gemini extension.
For a report built from headings, lists and tables, Markdown may be simpler: paste its source, select Markdown, review the rendered output and publish the same way.
More Posts

How to Open an HTML File on Your Phone (iPhone and Android)
Someone sent you an .html file and you're on your phone. Here are the local options that half-work, and the one method that renders on any device.

How Explore and Likes Work on dochost
Public pages appear on Explore, readers can like them from the corner pill, and 30 likes buy a free page another 30 days. Here is what gets listed, how the three sort orders are ranked, what a like counts, and how to keep a page off Explore without hiding the link.

How to Collect Form Responses From a Published dochost Page
A third of the HTML pages on dochost have an input box, and most of them send the answer nowhere. Here is the pattern that works — a fetch() to any endpoint that accepts JSON — with a live demo and drop-in code for Formspree, Supabase and Google Sheets.
Newsletter
Join the community
Subscribe to our newsletter for the latest news and updates