Platform.sh is now Upsun. Click here to learn more
Upsun User Documentation

Single-runtime image

See all of the options for controlling your apps and how they’re built and deployed on Upsun.

Use the .upsun/config.yaml file, located at the root of your Git repository, to configure the apps in a single-runtime image.

See a comprehensive example of a configuration in a .upsun/config.yaml file.

Multi-app projects can be set up in various ways.

Primary application properties Anchor to this heading

In the .upsun/config.yaml file, configure each application as a unique key beneath the top-level applications key.

For example, if your deployed site requires a Javascript frontend application container and a Python backend application container, the .upsun/config.yaml file would start to look something like this:

.upsun/config.yaml
applications:
  frontend:
    type: 'nodejs:24'
    # Additional frontend configuration
  backend:
    type: 'python:3.13'
    # Additional backend configuration

The following table presents all of the properties available to each unique app beneath the applications key.

The Set in instance column defines whether the given property can be overridden within a web or workers instance. To override any part of a property, you have to provide the entire property.

Name Type Required Set in instance? Description
type A type Yes No The base image to use with a specific app language. Format: runtime:version.
container_profile A container profile Yes Determines which combinations of CPU and RAM a container can use.
relationships A dictionary of relationships Yes Connections to other services and apps.
mounts A dictionary of mounts Yes Directories that are writable even after the app is built. Allocated disk for mounts is defined with a separate resource configuration call using upsun resources:set.
web A web instance N/A How the web application is served.
workers A worker instance N/A Alternate copies of the application to run as background processes.
timezone string No The timezone for crons to run. Format: a TZ database name. Defaults to UTC, which is the timezone used for all logs no matter the value here. See also app runtime timezones
access An access dictionary Yes Access control for roles accessing app environments.
variables A variables dictionary Yes Variables to control the environment.
firewall A firewall dictionary Yes Outbound firewall rules for the application.
build A build dictionary No What happens when the app is built.
dependencies A dependencies dictionary No What global dependencies to install before the build hook runs.
hooks A hooks dictionary No What commands run at different stages in the build, deploy, and post_deploy phases.
crons A cron dictionary No Scheduled tasks for the app.
source A source dictionary No Details about the app’s source code and available operations.
runtime A runtime dictionary No Customizations to your PHP runtime.
additional_hosts An additional hosts dictionary Yes Mappings of hostnames to IP addresses.
operations A dictionary of runtime operations No Runtime operations for the application.

Root directory Anchor to this heading

Some of the properties you can define are relative to your app’s root directory. The root defaults to the root of the repository.

.upsun/config.yaml
applications:
  frontend:
    type: 'nodejs:24'
    # Default behavior of source.root
    source:
      root: "/"

That is, if a custom value for source.root is not provided in your configuration, the default behavior is equivalent to the above.

To specify another directory, for example for a multi-app project, use the source.root property.

type Anchor to this heading

The type defines the base container image used to run the application. The version is the major (X) and sometimes minor (X.Y) version numbers, depending on the service, as in the following table. Security and other patches are taken care of for you automatically.

Available languages and their supported versions:

Language runtime Supported version
C#/.Net Core dotnet 7.0, 6.0, 8.0
Elixir elixir 1.18, 1.15, 1.14
Go golang 1.25, 1.24, 1.23, 1.22, 1.21, 1.20
Java java 21, 19, 18, 17, 11, 8
JavaScript/Node.js nodejs 24, 22, 20
PHP php 8.5, 8.4, 8.3, 8.2, 8.1
Python python 3.13, 3.12, 3.11, 3.10, 3.9, 3.8
Ruby ruby 3.4, 3.3, 3.2, 3.1, 3.0
Rust rust 1

Example configuration Anchor to this heading

These are used in the format runtime:version:

.upsun/config.yaml
applications:
  APP_NAME:
    type: 'php:8.5'

build Anchor to this heading

The only property of the build dictionary is flavor, which specifies a default set of build tasks to run. Flavors are language-specific.

See what the build flavor is for your language:

In all languages, you can also specify a flavor of none to take no action at all (which is the default for any language other than PHP and Node.js).

.upsun/config.yaml
applications:
  myapp:
    source:
      root: "/"
    type: 'nodejs:24'
    build:
      flavor: none

dependencies Anchor to this heading

Installs global dependencies as part of the build process. They’re independent of the code dependencies of your application and are available in the PATH during the build process and in the runtime environment. They’re installed before the build hook runs using a package manager for the language.

Language Key name Package manager
PHP php Composer
Python 2 python or python2 Pip 2
Python 3 python3 Pip 3
Ruby ruby Bundler
Node.js nodejs npm (see how to use yarn)

The format for package names and version constraints are defined by the specific package manager.

An example of dependencies in multiple languages:

.upsun/config.yaml
applications:
  APP_NAME:
    type: 'nodejs:24'
    source:
      root: "/"
    dependencies:
      php: # Specify one Composer package per line.
        drush/drush: '8.0.0'
        composer/composer: '^2'
      python2: # Specify one Python 2 package per line.
        behave: '*'
        requests: '*'
      python3: # Specify one Python 3 package per line.
        numpy: '*'
      ruby: # Specify one Bundler package per line.
        sass: '3.4.7'
      nodejs: # Specify one NPM package per line.
        pm2: '^4.5.0'

runtime Anchor to this heading

This applies to PHP only.

The following table lists the various possible modifications to your PHP runtime:

Name Type Language Description
extensions List of strings OR extensions definitions PHP PHP extensions to enable.
disabled_extensions List of strings PHP PHP extensions to disable.
request_terminate_timeout integer PHP The timeout (in seconds) for serving a single request after which the PHP-FPM worker process is killed.
sizing_hints A sizing hints definition PHP The assumptions for setting the number of workers in your PHP-FPM runtime.
xdebug An Xdebug definition PHP The setting to turn on Xdebug.

You can also set your app’s runtime timezone.

Extensions Anchor to this heading

You can enable PHP extensions just with a list of extensions:

.upsun/config.yaml
applications:
  APP_NAME:
    type: 'php:8.5'
    source:
      root: "/"
    runtime:
      extensions:
        - geoip
        - tidy

Alternatively, if you need to include configuration options, use a dictionary for that extension:

.upsun/config.yaml
applications:
  APP_NAME:
    type: 'php:8.5'
    source:
      root: "/"
    runtime:
      extensions:
        - geoip
        - name: blackfire
          configuration:
            server_id: SERVER_ID:
            server_token: SERVER_TOKEN:

In this case, the name property is required.

Sizing hints Anchor to this heading

The following table shows the properties that can be set in sizing_hints:

Name Type Default Minimum Description
request_memory integer 45 10 The average memory consumed per request in MB.
reserved_memory integer 70 70 The amount of memory reserved in MB.

See more about PHP-FPM workers and sizing.

Resources (CPU, memory, and disk space) Anchor to this heading

By default, Upsun assigns a container profile and container size to each application and service on the first deployment of a project.

The container profile defines and enforces a specific CPU-to-memory ratio. The default container profile for an app or service in a composable image is HIGH_CPU.

Use the Upsun CLI or Console to manually adjust the allocated container size (CPU and memory resources)—that is, to perform a vertical‑scaling action. When you redeploy, the container runs with the CPU‑to‑memory ratio defined by its profile, so it enforces the size you specified.

Related topics:

  • For detailed steps for changing the container size, see the Vertical scaling section of the “Resource configuration topic.
  • For details about container sizes for each resource allocation strategy (shared CPU, guaranteed CPU, and initial allocation), see the Advanced: Container profiles section of the “Resource configuration” topic.
  • To learn more about general resource management in Upsun, see the topics in the Manage resources section.

Downsize a disk Anchor to this heading

You can reduce the target disk size of an app. Keep in mind:

  • Backups created before the downsize are incompatible and cannot be used; you must create new backups.
  • The downsize will fail if the disk contains more data than the target size.

Combine single-runtime and composable images Anchor to this heading

In a multiple application context, you can use a mix of single-runtime images and composable images.

The following sample configuration includes two applications:

  • frontend – uses a single-runtime image
  • backend – uses a composable image
    In this app, PHP is the primary runtime and is started automatically (PHP-FPM also starts automatically when PHP is the primary runtime). For details, see the PHP as a primary runtime section in the Composable image topic.
.upsun/config.yaml
applications:
  frontend:
    # this app uses the single-runtime image with a specific node.js runtime
    type: 'nodejs:24'
  backend:
    # this app uses the composable image and specifies two runtimes
    type: "composable:25.05"
    stack:
      runtimes:
        - "php@8.4":
            extensions:
              - apcu
              - sodium
              - xsl
              - pdo_sqlite
        - "python@3.13"
      packages:
        - "python313Packages.yq" # python package specific