---
title: "How to Publish a Website with Claude Code | site.link"
description: "Publish a static site from Claude Code at an address like mycafe.site.link: build it, ask Claude to publish the folder, and it's live with HTTPS. Works with Vite, Astro and Next.js exports."
url: "https://site.link/help/publish-website-claude-code"
---

# Publish a website with Claude Code

Claude Code can build your site and put it online in the same session. site.link hosts the built folder at your address, and every later publish replaces it.

What you need

* site.link added to Claude Code.
* A static site: HTML, CSS, JavaScript, images and fonts.

## 1\. Build the site

site.link hosts the built files, so it needs a folder with an index.html at the top. Most tools make one with their build command:

| Site       | Build                                | Folder                     |
| ---------- | ------------------------------------ | -------------------------- |
| Plain HTML | None                                 | The folder with index.html |
| Vite       | npm run build                        | dist                       |
| Astro      | npm run build                        | dist                       |
| Next.js    | output: "export", then npm run build | out                        |

Static files only: anything that needs a server, like API routes or server-side rendering, won't run. You don't have to run the build yourself. Claude Code can do it in the next step.

## 2\. Ask Claude to publish the folder

With site.link [added to Claude Code](/help/claude-code-setup), ask in your project's folder:

> Build this site and publish it at mycafe.site.link
$ npm run build
sitelink: get_upload_url
$ cd dist && zip -qr ../site.zip . && curl -sS -T ../site.zip "https://mcp.site.link/upload/…"
Published. https://mycafe.site.link is live.

site.link gives Claude a one-time upload link that works for 15 minutes. Claude zips the built folder, uploads it, and the reply says whether the site is live. The limit is 100 files and 10 MB.

## 3\. Publish again after changes

After you change the site, ask Claude to build and publish again. Each upload replaces the whole site, and site.link keeps the version before it while the new one rolls out.

To make it automatic, add a line to your project's CLAUDE.md file, which Claude Code reads in every session:

`After changing the site, build it and publish it to mycafe.site.link.`

## If something goes wrong

* **Too big.** Shrink large images, and leave out source maps and files the site doesn't load.
* **A blank page or missing styles.** Check that Claude published the built folder, not the source, and that the site expects to live at the top of its address, not in a subfolder.
* **The upload link expired.** Ask Claude to publish again. It gets a fresh link.
* **The name points at a ChatGPT Site.** Claude asks before it moves the name to the files you publish. Say yes only if you want the address to stop showing the Site.
* **The publish was refused.** Pages that ask for passwords or card details can't be hosted.

## Related guides

* [Add site.link to Claude Code](/help/claude-code-setup)
* [Host an HTML file online](/help/host-html-file)
* [Keep your name after 30 days](/help/keep-your-name)

Still stuck? Email [care@site.link](mailto:care@site.link) with the address you're working on.
