> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# How to create your squarecloud.app configuration file

> Learn how to create your Square Cloud configuration file

## What is the configuration file?

The configuration file is a file that contains your application's parameters, such as the main file, memory, version and other settings. This file is used to configure and deploy your application on the Square Cloud platform.

```systemd squarecloud.app theme={null}
MAIN=main_file.js
DISPLAY_NAME=I am the configuration file
MEMORY=512
VERSION=recommended
```

## Creating the configuration file

Creating the configuration file is very simple: just create a file named `squarecloud.app` or `squarecloud.config` and add the configuration parameters inside it.

<Steps>
  <Step title="Choose extension">
    The configuration file can have two extensions: **.app** or **.config**. You can use `squarecloud.app` or `squarecloud.config`, whichever you prefer. Tip: use **.app** to help promote Square Cloud. 🥰😂
    <Info>On **macOS**, we recommend using the **.config** extension.</Info>
    <Warning>Note: **.app** or **.config** refers to the **file extension**, not the file name.</Warning>
  </Step>

  <Step title="Create file">
    Create a file with the selected extension and add the configuration parameters inside it.
  </Step>
</Steps>

## Configuration parameters

Below you can see all the configuration parameters available for your configuration file.

| Parameter       | Type    | Editable | Limit     | Usage                                                               |
| --------------- | ------- | :------: | --------- | ------------------------------------------------------------------- |
| `MAIN*`         | String  |     ❌    | 32 chars  | Defines the main application file. Ex.: `index.js`, `main.py`, etc. |
| `VERSION*`      | String  |     ❌    | -         | Language version (Ex.: `recommended`).                              |
| `MEMORY*`       | Integer |     ✅    | -         | Amount of memory in megabytes.                                      |
| `DISPLAY_NAME*` | String  |     ✅    | 32 chars  | Display name of the application.                                    |
| `RUNTIME`       | String  |     ❌    | -         | The runtime environment. Ex.: `typescript`, `nodejs`, `go`.         |
| `DESCRIPTION`   | String  |     ✅    | 280 chars | Description/metadata of the application.                            |
| `AUTORESTART`   | Boolean |     ✅    | -         | Auto-restart (`true` or `false`).                                   |
| `START`         | String  |     ✅    | 256 chars | Custom start command.                                               |
| `SUBDOMAIN`     | String  |     ✅    | 63 chars  | Website subdomain (if applicable).                                  |

<Info>Editable parameters (✅) can be modified in the dashboard after deployment. Non-editable (❌) parameters require a full reupload of the application to make changes.</Info>

## Detailing the configuration parameters

Below you can see the configuration parameters you can use in your configuration file.

<Steps>
  <Step title="MAIN [*]" icon="file">
    **Type**: String | **Editable**: ❌ | **Limit**: 32 chars

    Defines the main application file.

    ```systemd theme={null}
    MAIN=index.js
    ```

    ```systemd theme={null}
    MAIN=src/loaders/index.js
    ```

    <Info>When this parameter is set, the runtime environment will be inferred based on the main file extension</Info>
    <Tip>This setting is **IGNORED** if you use the START parameter.</Tip>
  </Step>

  <Step title="MEMORY [*]" icon="memory">
    **Type**: Integer | **Editable**: ✅ | **Limit**: Minimum 256MB (bot), 512MB (site)

    Defines the amount of memory your application will use.

    ```systemd theme={null}
    MEMORY=256
    ```

    <Info>The value must be specified in megabytes (MB).</Info>
  </Step>

  <Step title="VERSION [*]" icon="arrow-up-9-1">
    **Type**: String | **Editable**: ❌ | **Values**: `recommended`, `latest` or specific version
    <Tip>We recommend using `recommended` for optimal stability.</Tip>

    Defines the language version for your application.

    ```systemd theme={null}
    VERSION=recommended
    ```

    | Language           | `recommended` | `latest` |
    | ------------------ | ------------- | -------- |
    | Node.js \[JS & TS] | 24.15.0       | 26.1.0   |
    | Python             | 3.13.13       | 3.14.5   |
    | Java               | JDK 25        | JDK 25   |
    | Elixir             | 1.19.5        | 1.19.5   |
    | Rust               | 1.95.0        | 1.95.0   |
    | Ruby               | 4.0.4         | 4.0.4    |
    | PHP                | 8.5.6         | 8.5.6    |
    | Go                 | 1.26.3        | 1.26.3   |
    | .NET/C#            | 10.0.8        | 10.0.8   |
  </Step>

  <Step title="DISPLAY_NAME [*]" icon="text">
    **Type**: String | **Editable**: ✅ | **Limit**: 32 chars

    Defines the display name of your application.

    ```systemd theme={null}
    DISPLAY_NAME=Admin BOT
    ```
  </Step>

  <Step title="DESCRIPTION" icon="text">
    **Type**: String | **Editable**: ✅ | **Limit**: 280 chars

    Defines the description of your application.

    ```systemd theme={null}
    DESCRIPTION=This bot is designed to help you with your daily tasks.
    ```
  </Step>

  <Step title="AUTORESTART" icon="rotate">
    **Type**: Boolean | **Editable**: ✅ | **Values**: `true`, `false` | **Default**: `false`

    Defines whether the application should automatically restart on failure.

    ```systemd theme={null}
    AUTORESTART=true
    ```
  </Step>

  <Step title="SUBDOMAIN" icon="globe">
    **Type**: String | **Editable**: ✅ | **Limit**: 63 chars | **Default**: `undefined`

    Defines the subdomain for your site (web applications only).

    ```systemd theme={null}
    SUBDOMAIN=mysite
    ```

    <Note>The final URL will be: `mysite.squareweb.app`</Note>
  </Step>

  <Step title="RUNTIME" icon="server">
    **Type**: String | **Editable**: ❌

    Defines a runtime environment manually.

    ```systemd theme={null}
    RUNTIME=nodejs
    ```

    Check the accepted values and environments below.

    | Environment | RUNTIME                  |
    | ----------- | ------------------------ |
    | Nodejs      | `nodejs`, `javascript`   |
    | TypeScript  | `typescript`             |
    | Python      | `python`                 |
    | C#/Dotnet   | `c#`, `dotnet`, `csharp` |
    | Elixir      | `Elixir`                 |
    | Java        | `java`                   |
    | Rust        | `Rust`                   |
    | PHP         | `php`                    |
    | Golang      | `go`, `golang`           |
    | HTML/CSS    | `static`, `html`         |

    <Warning>If you set this parameter, you'll don't need to set the MAIN, instead, you'll need to set a custom START command.</Warning>
  </Step>

  <Step title="START" icon="play">
    **Type**: String | **Editable**: ✅ | **Limit**: 256 chars | **Default**: `undefined`

    Defines a custom start command.

    ```systemd theme={null}
    START=npm run start
    ```

    <Warning>This parameter **overrides** the default MAIN behavior.</Warning>
  </Step>
</Steps>

## Configuration examples for bots

Here are some examples of configuration for bots:

```systemd theme={null}
# Required parameters.
MAIN=index.js
MEMORY=512
VERSION=recommended
DISPLAY_NAME=Robin bot
```

```systemd theme={null}
# Example with all parameters.
MAIN=index.js
MEMORY=512
VERSION=recommended
DISPLAY_NAME=Robin bot
DESCRIPTION=This bot was created to help with your daily tasks.
START=npm run start
AUTORESTART=true
```

## Configuration examples for sites

Here are some examples of configuration for websites:

<Info>The site URL will be: `mysite.squareweb.app`</Info>

```systemd theme={null}
# Example with all parameters.
MAIN=index.js
MEMORY=1024
VERSION=recommended
DISPLAY_NAME=My site
DESCRIPTION=My site is really cool!
SUBDOMAIN=mysite
START=npm run build && npm run start
AUTORESTART=true
```

<Info>`next.config.js` as MAIN is only used to let the system recognize the project as a JavaScript or TypeScript project (another .ts/.tsx file)</Info>

```systemd theme={null}
# Example for a Next.js site.
MAIN=next.config.js
MEMORY=2048
VERSION=recommended
DISPLAY_NAME=Next.js site
DESCRIPTION=This site was built with Next.js.
SUBDOMAIN=nextjs
START=npm run build && npm run start
AUTORESTART=true
```
