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

# Configure your project

> Add the required YAML configuration files to deploy your project on Upsun Cloud.

## Required files

Upsun Cloud uses a YAML configuration file to control your application's behavior.
Place this file inside a `.upsun/` folder at the root of your source code:

```text Example file structure theme={null}
my-app
├── .upsun
│   └── config.yaml
├── [.environment]
└── <project sources>
```

To generate these YAML files, run the following command from the root of your project:

```bash Terminal theme={null}
upsun project:init
```

Follow the prompts. The `upsun project:init` command does the following:

* Detects your framework automatically. If it can't, it asks which [runtime language](https://developer.upsun.com/docs/languages) your codebase uses.
* Asks if you want to [add any services](https://developer.upsun.com/docs/add-services).
* Generates the `.upsun/config.yaml` and `.environment` files.

The [generated configuration](https://developer.upsun.com/docs/configure-apps/app-reference/single-runtime-image.md) varies slightly based on your answers and whether a framework is detected. The file structure looks similar to the following:

```yaml {configFile="app"} theme={null}
applications:
  # Configuration for all applications within an environment.
  myapp:
    # configuration for the application 'myapp'

services:
  # Configuration for all services within an environment.
  db:
    # configuration for service 'db'

routes:
  # Configuration for routing to applications
  'https://{default}/':
```

The top-level keys map to:

* [`applications`](https://developer.upsun.com/docs/configure-apps/app-reference/single-runtime-image): configuration for all applications within an environment
* [`services`](https://developer.upsun.com/docs/add-services): configuration for all services within an environment
* [`routes`](https://developer.upsun.com/docs/routes): configuration for how requests are handled by the router

> [!NOTE]
>
> For more information on the structure of this configuration file, see the [YAML structure page](https://developer.upsun.com/docs/core-concepts/yaml/yaml-structure.md).

> [!NOTE]
>
> Committing variables
> An additional [`.environment` file](https://developer.upsun.com/docs/development/variables/set-variables#set-variables-via-script) may be located at the root of your source code. This file contains Upsun Cloud-specific environment variables.

Commit your new files:

```bash Terminal theme={null}
git add . && git commit -m "Add configuration for Upsun Cloud."
```

Push to your Upsun Cloud project:

```bash theme={null}
upsun push
```

Upsun Cloud reads your configuration files, builds your application image, and allocates resources to your containers.

> [!NOTE]
>
> By default, Upsun Cloud uses default resources for each of your services and apps. You can [adjust these resources](https://developer.upsun.com/docs/get-started/here/set-resources.md).

## Errors on first push

If you push code without an Upsun Cloud configuration, the following error appears:

> [tab] Using Upsun Cloud CLI
>
> ```bash theme={null}
> Found 749 commits
>
> E: Error parsing configuration files:
> - : Configuration directory '.upsun' not found.
>
> E: Error: Invalid configuration files, aborting build
> ```

> [tab] Using Console
>
> ![Create project options](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/console/first-fail.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=f9612669b7df9f169c45f107f18b1c69)

Add the configuration files described above and push again.

## Configuration errors

The `project:init` command uses your responses and framework-detection logic to generate a starting configuration. Because every project is different, the generated configuration may not cover all your requirements.

Upsun Cloud provides a customizable configuration schema you can adjust for your package manager, environment variables, builds, deploys, workers, crons, and other requirements.

To explore what might still be needed, see the language-specific configuration pages:

* [JavaScript/Node.js](https://developer.upsun.com/docs/get-started/here/configure/nodejs.md)
* [PHP](https://developer.upsun.com/docs/get-started/here/configure/php.md)
* [Python](https://developer.upsun.com/docs/get-started/here/configure/python.md)

## Next steps

After deployment, Upsun Cloud sets resources for your application and service containers automatically:


&#x20; Opening environment
&#x20; Environment configuration
&#x20;   app (type: php:\{\{version:php:latest}}, cpu: 0.5, memory: 224, disk: 512)
&#x20;   db (type: mariadb:\{\{version:mariadb:latest}}, cpu: 0.5, memory: 1408, disk: 512)
&#x20;   memcached (type: memcached:\{\{version:memcached:latest}}, cpu: 0.5, memory: 1088)
&#x20;&#x20;

> [!NOTE]
>
> Each time you create a new branch, your new environment inherits its parent environment's resource allocation.

If you need more disk for [uploaded files](https://developer.upsun.com/docs/development/file-transfer.md), or less memory for rarely used [services](https://developer.upsun.com/docs/add-services), you can [adjust resources](https://developer.upsun.com/docs/manage-resources/adjust-resources.md) at any time.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.