# Instant Sites

The **Instant Sites** feature lets you publish any static folder or file in your project to a live URL—instantly, on demand. You can deploy via your editor’s file tree or by asking Cosine directly. This guide covers enabling the feature, both deployment methods, customizing your subdomain, using a custom 404 page, and how to manage your deployments.

***

### Table of Contents

1. Enabling Instant Sites
2. Deployment Methods
   * A. Right-Click Deploy
   * B. “Ask Cosine” Deploy
3. Viewing & Sharing Your Deployment
4. Customizing the Subdomain
5. Custom 404 Pages
6. Troubleshooting & FAQs

***

### 1. Enabling Instant Sites

1. Open your project’s **Dashboard**.
2. Navigate to **Settings → Deployment Settings**.
3. Toggle **Instant Sites** to **On**.

> Once enabled, “Deploy” options and Cosine's deploy tool become available in your editor.

<figure><img src="https://2537874235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJjYsV6DXCvFPeCUEBwo5%2Fuploads%2FeZl3JwWGBYh4jVrdVEoU%2FSettings%20_%20html-starter%20_%20Lumon.jpeg?alt=media&#x26;token=fca78f37-533b-438f-bd8a-6a675cf87497" alt=""><figcaption></figcaption></figure>

***

### 2. Deployment Methods

#### A. Right-Click Deploy

1. In your IDE’s **File Tree**, locate the folder (e.g. `public/`, `docs/`) or single file (`index.html`) you want to publish.
2. Right-click it and select **Deploy**.

You’ll see a notification when it’s live.

<figure><img src="https://2537874235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJjYsV6DXCvFPeCUEBwo5%2Fuploads%2FsXGnp0POG8TuExNGge4x%2FCapture-2025-07-22-104837.png?alt=media&#x26;token=0e16c57c-6f5c-4154-9ee1-35e8fd87bf03" alt=""><figcaption></figcaption></figure>

#### B. “Ask Cosine” Deploy

1. Open the **Cosine Chat** or **Command Palette** in your editor (e.g. via the Cosine icon or `Ctrl/Cmd+Shift+P`).
2. Type a natural-language request, for example:

   ```
   Deploy the folder docs/ as an instant site
   ```
3. Choose the path from the suggestions, confirm any prompt (e.g. name or description), and send.

Cosine will run the deployment and notify you when the site is published.

***

### 3. Viewing & Sharing Your Deployment

* **Live URL**\
  Once deployed, Instant Sites assigns a URL like:

  ```
  https://<random-id>.cosine.page
  ```
* **Share Deployment Modal**\
  In the preview panel or after the deploy notification, click **Share** to open the modal:
  * **Copy URL** button copies the live link.
  * **Custom Subdomain** input lets you update the subdomain in place.

***

### 4. Customizing the Subdomain

1. Open the **Share Deployment** modal (from preview panel or post-deploy alert).
2. Under **Custom Subdomain**, enter your desired prefix (e.g. `my-docs`).
3. Click **Update Subdomain**.

Your site moves to:

```
https://my-docs.cosine.page
```

<figure><img src="https://2537874235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJjYsV6DXCvFPeCUEBwo5%2Fuploads%2FNtkqqh2EN74sh3s0okXH%2FCapture-2025-07-22-105014.png?alt=media&#x26;token=c793f99c-d039-4d45-bcf4-58afdcc88af3" alt=""><figcaption></figcaption></figure>

***

### 5. Custom 404 Pages

If your static folder contains a **404.html** file at its root, Instant Sites will serve that as the custom “Not Found” page. Otherwise, a default 404 page is shown.

* To use a custom 404:
  1. Add a file named `404.html` to the root of the folder you’re deploying.
  2. Deploy or redeploy that folder.
  3. Visit a non-existent path (e.g. `https://<id>.cosine.page/nonexistent`) to see your custom 404 page in action.

***

### 6. Troubleshooting & FAQs

**Q: I don’t see Deploy in my file tree.**

* Ensure **Instant Sites** is toggled on in **Settings → Deployment** and restart your editor.

**Q: Cosine didn’t pick the correct folder.**

* Be explicit in your prompt:

  ```
  Deploy the public/ directory
  ```

**Q: My custom 404 isn’t showing.**

* Confirm your `404.html` is in the root of the deployed folder and that you redeployed after adding it.

**Q: Custom subdomain update failed.**

* Remember, subdomains under `cosine.page` must be unique.
* If you see an error, try a different prefix that isn’t already in use.

**Q: My site shows 404 after deploy.**

* Confirm the target folder/file contains an `index.html`.
* Review the deployment logs in the **Preview** panel for errors.

***

You’re all set! 🚀\
Enable **Instant Sites**, deploy in one click or with a quick Cosine prompt - instantly on `cosine.page`. Enjoy!
