> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.squarecloud.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Deploying a static site (HTML, React, Vite)

## 1. Prerequisites
Before uploading your site, verify that you have:
* **Square Cloud Account:** Create your account via the [Registration Page](https://squarecloud.app/pt-br/signup) (Email or GitHub).
* **Active Plan:** A paid plan is required for hosting. Check the [pricing here](https://squarecloud.app/pt-br/pricing).

---

> **Note:** Square Cloud has native support for static sites with a premium CDN included, ensuring your site loads fast anywhere in the world.

## 2. Required File Structure
Make sure your project has at least the main file at the root:

* `index.html`: The main file of your site. Or `vite.html`, if you use the Vite framework.
* `404.html`: (Optional) Custom page for "Not Found" errors.

---

## 3. Preparing the Project
Before submitting, verify that all links to CSS files and images are working locally. 

> **Important Notice:** If you are uploading directly through the panel (website), you don't need to worry about configuration files right now, as the system will automatically create the `squarecloud.app` file for you if you upload via the dashboard.

---

## 4. How to Host (Upload)
With the files ready, you have two main paths to put your site online:

### Option A: Via Dashboard (Easiest)
1. Access the Square Cloud dashboard.
2. Click on **Upload Application**.
3. Select your project folder or drag the `.zip` file.
4. Enter the **application name**, point to your **main file**, and check **web publishing** to define your squareweb.app subdomain.

> **Tip:** Static projects do not need a running "server" (like Node.js or Python); Square Cloud itself already configures an nginx server for you.

### Option B: Via CLI 

1. Install the CLI:
```
npm i -g @squarecloud/cli
```
2. Authenticate in the CLI: Get your API token on the **My Account** page by going to the [**Authentication**](https://squarecloud.app/pt-br/account/security) section and requesting the API key; next, authenticate in the CLI with the following command.
```
squarecloud auth login
```
3. Create your configuration file: the [configuration file](https://docs.squarecloud.app/pt-br/getting-started/config-file), `squarecloud.config` or `squarecloud.app`, must be present in your project
4. Upload:
```
squarecloud upload
```
* Or if you created the zip:
```
squarecloud upload --file <path/to/zip>
```