Instance environment variables

Self-hosted Coolify reads its instance environment from /data/coolify/source/.env. Use this file for settings such as PHP memory, workers, scheduled job dispatch, SSH host key checks, and API limits that are not exposed in the dashboard.

These settings affect the Coolify instance. To configure a deployed application, use that application's environment variables and image configuration instead.

PHP memory and worker settings

The standard production Compose configuration supplies these defaults when the corresponding variable is unset:

VariableCoolify defaultPurpose
PHP_MEMORY_LIMIT256MPHP memory limit for an individual script.
PHP_FPM_PM_CONTROLdynamicPHP-FPM process-manager mode. The image supports dynamic, ondemand, and static.
PHP_FPM_PM_START_SERVERS1Number of workers started when using dynamic mode.
PHP_FPM_PM_MIN_SPARE_SERVERS1Minimum idle workers maintained in dynamic mode.
PHP_FPM_PM_MAX_SPARE_SERVERS10Maximum idle workers maintained in dynamic mode.

PHP_MEMORY_LIMIT is separate from Docker's container memory limit. Raising it does not allocate more RAM to the container or server. PHP workers and other processes still share the available memory.

Keep worker settings consistent with the selected process-manager mode and the server's resources. Additional image-supported settings are listed in the Server Side Up PHP environment reference. Coolify's own configuration can override image defaults, so verify the effective value after making changes.

Scheduled job dispatch

SCHEDULED_JOBS_DISPATCH_MODE controls how the scheduler checks every minute which database backups, tasks, volume backups, and Docker cleanups are due:

ValueBehavior
sequentialOne process checks all four job types, one after another. This uses the least CPU and memory. A slow job type can delay the other types.
concurrentOne process for each job type, all at the same time. A slow job type cannot delay the other types, but each process loads Coolify, so CPU and memory usage are higher every minute.

When the variable is not set, or has another value, self-hosted instances use sequential. Use concurrent when many backups or tasks are due at the same minute and one slow job type delays the others.

To change the mode, add or update this entry in /data/coolify/source/.env:

SCHEDULED_JOBS_DISPATCH_MODE=concurrent

Then follow Apply the changes below to recreate the Coolify container while preserving its current image and any custom Compose overrides.

SSH host key checking

Coolify saves the SSH host key of a server on the first connection. SSH_HOST_KEY_CHECKING sets what Coolify does when the key changes, for all servers of the instance:

ValueBehavior
warnCoolify connects, shows the new key, and notifies the team. This is the default.
enforceCoolify refuses to connect until you trust or reset the new key.
offCoolify does not check the host key.

Coolify uses warn for any other value. With warn, a team can still enforce the check on one server. Read SSH host key for details.

SSH_HOST_KEY_CHECKING=enforce

API failed request limit

API_FAILED_REQUEST_RATE_LIMIT sets how many failed API requests one token or IP address can send in one minute. The default is 30. Requests that return 401 or 403 count, and 404 counts only for requests without a token. When a client reaches the limit, Coolify answers all its API requests with 429 for 1 minute, then for 5 and 15 minutes when the client reaches the limit again within one hour. The team of the token gets one notification a day. Set 0 to turn the limit off.

API_FAILED_REQUEST_RATE_LIMIT=60

For the general API request limit, read Rate limits.

Change a setting

Connect to the server where the Coolify instance runs. Back up the existing environment file, then edit it:

cp /data/coolify/source/.env /data/coolify/source/.env.backup
nano /data/coolify/source/.env

For example, to raise the PHP memory limit to 512M, add or update this line:

PHP_MEMORY_LIMIT=512M

Update the existing entry rather than adding duplicate keys. Keep the instance's other values, including APP_KEY, unchanged. Store the backup securely: it contains instance credentials.

Do not edit the generated docker-compose.prod.yml to change one of these defaults. Installer and update scripts can replace that file.

Apply the changes

Changing .env does not update an existing container's environment. Recreate the Coolify container using your installation's Compose configuration; a plain docker restart coolify does not reload these variables.

For a standard self-hosted installation, run these commands in Bash from the source folder:

cd /data/coolify/source || exit 1
coolify_image=$(docker inspect --format '{{.Config.Image}}' coolify) || exit 1
compose_files=(-f docker-compose.yml -f docker-compose.prod.yml)
if [ -f docker-compose.custom.yml ]; then
  compose_files+=(-f docker-compose.custom.yml)
fi

docker compose "${compose_files[@]}" -f - up -d --no-deps --force-recreate coolify <<EOF
services:
  coolify:
    image: "$coolify_image"
EOF

The final inline override keeps the running Coolify image instead of falling back to the Compose file's default image tag. The command also includes docker-compose.custom.yml if present. See Compose overrides for details.

You do not need to run docker compose down first. --force-recreate replaces the Coolify container, while --no-deps leaves PostgreSQL and Redis running. The dashboard is briefly unavailable while Coolify restarts.

Verify the configuration

Check the PHP memory limit inside the recreated container:

docker exec coolify php -r 'echo ini_get("memory_limit"), PHP_EOL;'

For the example above, the result should be 512M. To inspect the effective PHP-FPM pool configuration, run:

docker exec coolify php-fpm -tt

Confirm the dashboard still loads and review container logs if startup fails:

docker logs --tail 100 coolify

When to use a Compose override

Use .env for parameters supported by the instance configuration or its container image. Use /data/coolify/source/docker-compose.custom.yml for Compose attributes such as mem_limit, CPU limits, port bindings, and additional file mounts.

An arbitrary environment variable does not automatically become a PHP setting. If a parameter has no environment-variable support, it needs the image's supported configuration-file mechanism. Coolify also provides its own PHP configuration, so check the loaded configuration before assuming an image setting took effect.

Read Compose override examples for container limits and mount configuration.

On this page