Upsun User Documentation

Configure your project

Try Upsun for 15 days
After that, enjoy the same, game-changing Upsun features for less with the First Project Incentive!ΒΉ A monthly $19 perk!
ΒΉTerms and conditions apply
Activate your 15-day trial

Required files Anchor to this heading

To host your application on Upsun, a configuration file (YAML) is needed to manage the way your application behaves. This configuration file is located inside a .upsunfolder at the root of your source code:

my-app
β”œβ”€β”€ .upsun
β”‚   └── config.yaml
β”œβ”€β”€ [.environment]
└── <project sources>

To pre-generate these YAML files, run the following command from the root of your project.

Terminal
upsun project:init

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

  • If possible, automatically detects which framework you’re using. If not detected, you are asked which runtime language your codebase is in.
  • Asks if you want to add any services.
  • Generates the corresponding .upsun/config.yaml and .environment files.

The generated configuration varies slightly based on your answers to these prompts and whether a framework is detected. However, the structure of the configuration file remains similar to the following:

.upsun/config.yaml
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}/':

Commit your new files:

Terminal
git add . && git commit -m "Add configuration for Upsun."

Push up to your Upsun project:

upsun push

Upsun now reads your configuration files, begins building your application image and allocates resources to your various containers.

Errors on first push Anchor to this heading

If you try to push a source code that is not Upsun ready, the following error is usually triggered at this point:

Found 749 commits

E: Error parsing configuration files:
- : Configuration directory '.upsun' not found.

E: Error: Invalid configuration files, aborting build

Create project options

This error is triggered because you have not yet added Upsun configuration to your project to setup deployments.

Errors Anchor to this heading

The project:init CLI command uses your responses and some framework-detection logic to attempt to set some sane configuration for your project. Your project - like most projects - is unique, and this goal of a seamless first deployment may yet be incomplete at this stage.

Have no fear! Upsun provides a highly customizable configuration schema that can be adjusted for your particular package manager, environment variables, builds, deploys, workers, crons, and other requirements to get you fully deployed.

To start exploring what might still be needed, see the following language-specific configuration pages:

Next steps Anchor to this heading

With your deployment finished, you may have noticed that the resources allocated to the application and service containers of your project have been set automatically:

  Opening environment
  Environment configuration
    app (type: php:8.2, cpu: 0.5, memory: 224, disk: 512)
    db (type: mariadb:12.4, cpu: 0.5, memory: 1408, disk: 512)
    memcached (type: memcached:1.6, cpu: 0.5, memory: 1088)

If you need more disk for uploaded files, or less memory for rarely used services, you can adjust resources at any time.

Is this page helpful?