# Build and publish a website

Have a bot build a small website, preview it, share a link while you work on it, then put it online with your own domain.

Canonical page: https://themachine.myapps.ai/docs/desktop/guides/build-a-website

In this guide a bot builds a small website for you on its computer. You
preview it inside Machine Desktop, send a temporary link to someone for
feedback, and then publish it for good, optionally on your own domain name.

**What you'll end up with:** a live website with its own link.

**Time needed:** about 20 minutes, plus however long the bot takes to build.

**What you need first:**

- Machine Desktop installed and signed in.
- A bot. Any bot works. The **Coding partner** starting point (a bot called
  *Dev*) is made for this kind of work.
- Optional: your logo or photos, to attach.
- Optional: a domain name you own, if you want the site on your own address.

### Start a fresh thread

Right-click your bot in the sidebar and choose **New thread**. One website
per thread keeps its files together.

Leave the chip above the message box on **Cloud**. The bot builds and runs
the site on its own computer in the cloud.

Need a new bot? Press **Ctrl+N** (**⌘N** on Mac) and pick **Coding
partner**.

### Describe the website

Say what the site is for, what goes on it, and how it should feel. Ask to
see a preview. For example:

> Make a one-page website for my bakery, "Rise". Include opening hours
> (Tue–Sun, 7am–3pm), our address, and three menu highlights. Use warm
> colors. Show me a preview when it's running.

> Build a simple personal website with three sections: About me, My work,
> and Contact. Keep the design clean, with lots of white space. Put all the
> files in a folder called site, and run it so I can preview it.

To use your own logo or photos, click the **paperclip** and attach them
(images up to 10 MB each). They're copied onto the bot's computer, into a
folder called `uploads`.

If a card asks for approval, read it and click **Allow once**. Everything
happens on the bot's own cloud computer, not yours.

### Preview the site

To test the site, the bot usually *runs* it on its computer. There are two
ways to see it:

- **In the chat.** A live preview of the website appears in the bot's reply,
with **Reload** and **Open in browser**.
- **In the Browser tab.** Click the **monitor** icon in the chat header to
open the bot's computer, then the **Browser** tab. Click the **Running**
chip for the site. Or type the address the bot gave you, like
`localhost:3000`, and click **Open**.

"localhost" means "this computer", and the number is the port the website
runs on. If you see *"Nothing to show yet"*, ask the bot:

> Run the site so I can preview it.

### Ask for changes

Reply in the same thread with what to change. Be specific:

> Make the header dark green, move the opening hours to the top, and make
> the menu highlights into three cards side by side.

To show the bot what you mean, take a screenshot of the preview and paste
it into the message box with **Ctrl+V** (**⌘V**). Images are shown to the
model directly, so it can see them.

To point at one part of an image that's already in the chat, click the
image to open it, click **Annotate a region**, drag a box around the part you
mean, and type a comment. The cropped picture and your comment are attached
to your next message.

### Share a link while you work on it

Want someone to look at it before it's public for good? While the site is
running:

1. Click the **Export conversation** icon in the chat header.
2. Click **Share the site on localhost:3000** (or whatever number your site
uses).

This creates a public link to the website and copies it, so you can send it
to anyone. It's handy for quick feedback. To put the website online
permanently, deploy it (next step).

To turn a link off, open the same menu and click the trash icon next to it.

### Put it online

When you're happy, publish the site as a **deployment**: a live website with
its own link. Either:

- **Ask the bot.** For example:

> Deploy the site folder.

- **Do it yourself.** Open the bot's computer, go to the folder, and click
**Deploy** followed by the folder's name. At the top level, click
**Deploy…** and pick a folder.

When it finishes, you get a **Live:** link. If it fails, the message says
why.

### Add your own domain

1. Open **Tools → Deployments** at the bottom of the sidebar. Every site and
app your bots have published is listed here.
2. Click **Edit** on your site.
3. Under **Custom domains**, type your domain. Put one domain per line.
4. Point each domain's DNS at the deployment. The domain goes live only
after that. The drawer shows which domains are currently serving.
5. Save your changes. Saving doesn't deploy, so click **Redeploy** to put
them live.

> **Changing the site later**
> After you change the site, ask the bot to deploy it again, or click
> **Redeploy** on the **Deployments** page. If a deploy fails, click **Logs**
> to see why, and try again.

![Previewing the site on the bot's computer](/images/docs/desktop/computer-browser.webp)

## Tips

- **Ask for one folder.** *"Put all the files in a folder called site"*
  makes deploying simple.
- **Don't put passwords or API keys in Environment variables.** On the
  **Deployments** page, these are stored as plain text.
- **Stop** takes a site offline but keeps it, so you can deploy it again.
  **Delete** takes it down for good and can't be undone.
- **Deleting the thread doesn't take the site down.** Websites you deployed
  from a thread stay online.
- **Start with the default model.** If the bot keeps getting something wrong,
  try a more capable model from the **model chip**.

![The Deployments page with the site live](/images/docs/desktop/deployments.webp)

## Next steps

- [Preview a website and use the terminal](/docs/desktop/cloud-computer/preview-and-terminal)
- [Deployments](/docs/desktop/deployments)
- [Share a site or export a conversation](/docs/desktop/chat/find-share-export)
- [Mark up images and comment on replies](/docs/desktop/chat/message-actions)
- [What the bot's computer costs](/docs/desktop/cloud-computer/cost-and-sleep)
