Helm Docs

Preview Settings Reference

This page lists every field on your project's Preview Environments settings tab, which controls how Helm starts your backend's previews from your Docker Compose file. For each field it gives the exact label, what the field does, its default, the values it accepts, the error it can show, and whether a change reaches existing previews.

Who this is for: Every project member can open the tab and read the settings. Changing them needs the Project Admin role or higher. An Owner or Admin of the organization counts as a Project Admin in every project. Other members see the fields greyed out, a grey Save Changes button, and the note "Editing project settings requires Project Admin or higher."

What this page is for

Use this page to look up one setting. If you are setting up previews for the first time, follow Set Up PR Previews for Your Backend instead; it walks through the fields in order.

Open the settings tab

  1. Open your project in Helm.
  2. Click Settings in the sidebar.
  3. In the settings menu, under Build, click Preview Environments. The tab is at /<company>/<project>/settings/previews/.

The tab has two cards:

  • The Preview Environments card holds the eight fields described below, with one Save Changes button for all of them. The first six describe your Compose stack: which Compose file to run, which service answers web traffic, on which port, and the three commands. The last two say which repository and branch Helm copies.
  • The Container Environment Variables card, under it, holds your project variables and secrets, and the two variables Helm sets. It has its own Edit and Save Changes buttons.

How saving works

  • Click Save Changes at the bottom of the Preview Environments card to save every field on it at once. The card then shows "Settings saved successfully."
  • Helm checks every field before it saves any of them. If one value is not accepted, the card shows the reason in a red box at the top, naming the field, and saves nothing. Fix the value and click Save Changes again.
  • Emptying a field and saving puts the field back to its default.
  • A setting never changes a preview that is already running by itself. The table at the end of this page says which settings a Rebuild picks up and which apply only to new previews.

The Compose stack

Each preview is a virtual machine that runs your own Docker Compose file. How to write that file, with a complete example, is in Write the Compose File.

Compose File Path

The path to your Docker Compose file, relative to the top folder of your backend repository. Helm runs this file in the preview. The file must define every service the preview needs, including its database.

  • Default: docker-compose.yml. The empty field shows it in grey; leave the field empty to keep using it.
  • Accepted values: a path inside the repository, with / between folders, for example compose.yaml or deploy/preview.compose.yml. A leading ./ is removed.
  • Errors:

    • "Compose File Path must be relative to the repository root, for example docker-compose.yml." for a path that starts with / or ~.
    • "Compose File Path must not contain .. (the file must be inside the repository)."
    • "Compose File Path must use / between folders, not \."
    • "Compose File Path must name a file, not a folder." for a path that ends with /.
    • "Compose File Path can be at most 255 characters long."
  • Takes effect: for new previews and on the next Rebuild.

The field does not check that the file exists. If the branch Helm copies has no file at this path, the preview fails and the reason names the path.

Web Service

The name of the service in your Compose file that answers web traffic. Helm routes the preview's address to this service, on the App Port, and waits for it to answer before it marks the preview ready.

  • Default: app. The empty field shows it in grey; leave the field empty to keep using it.
  • Accepted values: the name of one service under services: in your Compose file, for example web or api: a letter or digit first, then letters, digits, _, . and -, at most 63 characters.
  • Errors: "Web Service must be the name of a service in your Compose file: a letter or digit first, then letters, digits, underscores (_), dots (.) and hyphens (-)." and "Web Service can be at most 63 characters long."
  • Takes effect: for new previews and on the next Rebuild.

App Port

The port the web service listens on inside its container. Helm sends the preview's web traffic to this port and checks that the service answers on it. Your Compose file does not need to publish the port with ports:; Helm does that itself.

  • Default: 8000. The field shows 8000 when nothing has been saved.
  • Accepted values: a whole number from 1 to 65535, for example 8080.
  • Error: "App Port must be a whole number from 1 to 65535."
  • Takes effect: for new previews and on the next Rebuild.

The web service must listen on all network interfaces (0.0.0.0), not only on 127.0.0.1. If it listens on a different port from this setting, the preview fails with readiness_failed.

Commands

Three optional commands let you run your own work at set points in a preview's life. Each one runs in the preview's virtual machine, in the folder of your Compose file, with docker compose available and your variables and secrets in its environment. When each command runs and how a failure shows up are explained in Preview Commands.

The three commands share these rules:

  • Accepted values: one line of shell text, at most 4096 bytes long after Helm removes spaces at the start and end. A character such as é counts as two bytes.
  • Errors: "<label> is N bytes long; the limit is 4096 bytes." and "<label> contains a null byte.", where <label> is the field's name, for example "Pre-deploy Command is 5120 bytes long; the limit is 4096 bytes."
Warning: Command text is stored and shown as plain text. Do not put passwords or keys in a command. Put them in encrypted variables on the Container Environment Variables card, which every command can read.

Pre-deploy Command

Runs before the stack starts, on every new preview and every rebuild. The usual use is applying database migrations and loading seed data, for example:

docker compose run --rm --build app sh -c "python manage.py migrate --noinput && python manage.py loaddata seed.json"
  • Default: empty, which runs nothing.
  • Takes effect: for new previews and on the next Rebuild.

Start Command

Brings the stack up, on every new preview and every rebuild, after the pre-deploy command. It must return once the services are running.

  • Default: empty, which runs docker compose up --build --detach --wait. The empty field shows it in grey.
  • Takes effect: for new previews and on the next Rebuild.

First-deploy Command

Runs after the stack has started and the web service answers, on every new preview and every rebuild. A rebuild starts with empty data, so this is a good place to load seed or demo data, for example:

docker compose exec -T app python manage.py loaddata demo.json
  • Default: empty, which runs nothing.
  • Takes effect: for new previews and on the next Rebuild.

Start timeout (minutes)

How long a preview may take from its first command until the web service answers HTTP. The clock starts with the pre-deploy command, or with the start command when there is no pre-deploy command, so building your images counts. The first-deploy command has its own 15 minutes on top of this, after the web service answers. If the preview runs out of time, it fails and the reason says how long it ran and which step it stopped at, for example:

build_failed: stopped after 20 minutes at the start stage, the project's start timeout; raise it under Settings, Previews; see logs/start.log

The step is one of pre-deploy, start, wait-for-app (the web service had not answered yet) and first-deploy.

Raise it when your images take a long time to build, for example the first build of a branch with an empty build cache. A project whose stack takes 25 minutes to build and start needs 25 or more.

  • Accepted values: a whole number of minutes from 5 to 60.
  • Default: 20.
  • Error: "Start timeout (minutes) must be a whole number of minutes from 5 to 60."
  • Takes effect: for new previews and on the next Rebuild.

One preview only. When one preview needs more or less time than the rest, set Start timeout (minutes) in the Create preview card on the PR Previews page, or send start_timeout_minutes to the preview API (POST /api/previews/) or the MCP tool create_preview_environment. The value has the same 5 to 60 minute limits and applies to that preview only. It is kept when the preview is rebuilt, and when a new push to the same pull request replaces the preview without giving a start timeout of its own. Leave it empty to use the project's setting.

Admin path

The path of your backend's admin site, such as the Django admin, on the preview's address. The Admin and Copy admin URL items in each preview's Actions menu on the PR Previews page use the preview's address followed by this path. For example, with /admin/ they open https://myapp-pr-42-a1b2c3.preview.helmcode.dev/admin/. This setting does not change how a preview runs.

  • Default: empty. When the field is empty, the PR Previews page shows no Admin or Copy admin URL items for this project's previews. Leave it empty if your backend has no admin site.
  • Accepted values: a path such as /admin/ or /manage/, at most 200 characters, with no spaces. If you leave out the first /, Helm adds it, so admin/ is saved as /admin/. A slash at the end is kept as you type it. A query is allowed, for example /admin/login/?next=/admin/.
  • Errors:
    • "Admin path must be a path on the preview's own address, for example /admin/, not a full URL." for a value that starts with a scheme or a host, such as https://example.com/admin/ or //example.com/admin/.
    • "Admin path may not contain a backslash; use /."
    • "Admin path may not contain spaces."
    • "Admin path can be at most 200 characters long."
  • Takes effect: at once, for every preview of the project. No rebuild is needed. An open PR Previews page or Dashboard updates its menus by itself the next time it checks for changes.

Repository and branch

Backend Repo URL

The GitHub repository Helm copies for every preview of this project, whichever repository's workflow asked for the preview. A pull request in your iOS app gets a preview of this backend. When you click Save Changes, Helm checks that its GitHub App can read the repository, so a wrong URL is refused at once instead of every preview failing later.

  • Default: empty.
  • Accepted values: a GitHub repository in one of these forms. The short form is saved as the first one.

    https://github.com/your-org/your-backend
    https://github.com/your-org/your-backend.git
    your-org/your-backend
  • Validation: when the value changes, Helm asks GitHub, with the Helm GitHub App's access for the repository's owner, whether it can read the repository. Nothing is saved when the check fails. The messages are:

    • "Backend Repo URL must be a GitHub repository, written as https://github.com/<owner>/<repository> or <owner>/<repository>, for example https://github.com/acme/backend."
    • "Helm's GitHub installation for your-org cannot reach your-org/your-backend. Install the Helm GitHub App on your-org or add this repository to its selected repositories, or correct the URL."
    • "The Helm GitHub App is not installed on your-org, so Helm cannot reach your-org/your-backend. Install the Helm GitHub App on your-org, or correct the URL."
    • "Helm will not use the Helm GitHub App for the GitHub account "your-org" because it is not linked to your Helm organization. …"
    • "Helm could not check that it can reach your-org/your-backend, because GitHub or the Helm orchestrator did not answer. Nothing was saved. Try again in a few minutes."
    • "Helm could not check that it can reach your-org/your-backend, because the Helm orchestrator refused the request (<reason>). Nothing was saved. Contact Helm support if this keeps happening."
  • When it is empty: a preview asked for by a workflow uses the repository whose workflow asked, and Create preview on the PR Previews page refuses with "This project has no preview backend repo configured — set PREVIEW_BACKEND_REPO_URL in Settings."
  • Also needed: the GitHub account that owns the repository must be connected to your Helm organization, and the Helm GitHub App must be able to read the repository. See Connect GitHub for PR Previews.
  • Takes effect: for new previews only. A rebuild, including a rebuild that starts a failed preview again, uses the repository the preview was created with.

Fallback Branch

The backend branch Helm copies when the backend repository has no branch with the same name as the branch that asked for the preview. The help text reads "Default backend branch when the triggering branch is not found (e.g. development, staging)". The full rules for choosing a branch are in "Which branch Helm uses" in Set Up PR Previews for Your Backend.

  • Default: empty, which means staging.
  • Accepted values: any branch name, for example development. The field does not check that the branch exists, so make sure it does and that it has your Compose file.
  • Also used for: the starting value of the Branch field in the Create preview card on the PR Previews page.
  • Takes effect: for new previews only. A rebuild uses the branch the preview was created with.

Container Environment Variables

The second card on the tab holds the environment variables every preview gets. An environment variable is a named value, such as a database address, that your app reads when it starts. On this card you can:

  • add your own plain and encrypted variables, one at a time or with Bulk Edit;
  • rename or turn off the two variables Helm sets, PREVIEW_DOMAIN and PREVIEW_URL, in the list labelled "How variables reach your preview, and the two variables Helm sets in each preview: PREVIEW_DOMAIN and PREVIEW_URL. You can rename those two or turn them off." The same list explains how your variables reach every container; see "How variables reach your preview" in Preview Variables.

Click Edit to change the card and Save Changes on the card to save it. It shows "Environment variables saved." when it is done. Saving the card does not save the fields above it, and the reverse. New previews get the variables saved when they are created, and a Rebuild picks up the variables saved at the time of the rebuild. The name rules and how your Compose file reads the variables are described in Preview Variables.

When a change takes effect

SettingNew previewsRebuild of a running preview
Compose File PathYesYes
Web ServiceYesYes
App PortYesYes
Pre-deploy CommandYesYes
Start CommandYesYes
First-deploy CommandYesYes. It runs again on every rebuild.
Start timeout (minutes)YesYes, unless the preview was created with its own start timeout, which it keeps.
Admin pathYesNo rebuild needed. It changes only the admin links on the PR Previews page, for every preview at once.
Backend Repo URLYesNo. It keeps its repository.
Fallback BranchYesNo. It keeps its branch.
Container Environment VariablesYesYes

To apply a change to a running preview, click Rebuild in its Actions menu on the PR Previews page; see The PR Previews Page. For a change a rebuild does not pick up, tear the preview down and request a new one.

Related settings on other tabs

A few other settings affect previews. They are not on the Preview Environments tab:

  • GitHub Repos, on the project's Settings → GitHub tab: the repositories whose GitHub Actions workflows may ask for previews with an OIDC token. See Set Up PR Previews for Your Backend.
  • Previews Poll, on the project's Settings → Dashboard tab: how many seconds the PR Previews page and the dashboard wait between checks for changes while no preview is starting, rebuilding or being torn down. It is 60 seconds when empty. While a preview is changing they check every few seconds whatever this says.
  • Preview TTL (hours) and Max Concurrent Previews, in Company settings → Usage Limits: how long previews live and how many your organization may have at once. See "Expiry and limits" in Preview Lifecycle.
  • The connection to GitHub itself, in Company settings → GitHub. See Connect GitHub for PR Previews.

Troubleshooting

The fields are greyed out and I cannot save

You do not have the Project Admin role on this project. Ask a Project Admin, or an Owner or Admin of your organization, to make the change or to give you the role.

"App Port must be a whole number from 1 to 65535."

The App Port field holds something other than a whole number in that range, such as 8000.5 or 0. Enter the port your app listens on, for example 8000, and click Save Changes. Nothing on the card was saved, so check any other fields you changed too.

"stopped after N minutes at the … stage, the project's start timeout"

The preview's commands, image builds included, did not finish and the web service did not answer within the start timeout. The reason names the step that was still running. If the build was simply slow, raise Start timeout (minutes) on this tab, or create that one preview with a longer start timeout, then rebuild. If the web service never answers, a longer timeout will not help: check that it listens on 0.0.0.0 at the App Port.

"Pre-deploy Command is N bytes long; the limit is 4096 bytes."

The command is too long. Put the steps in a script in your repository, for example scripts/predeploy.sh, and set the command to run it:

sh scripts/predeploy.sh

"Compose File Path must not contain .."

Helm only runs a Compose file inside the repository it copied. Move the file into the repository, or give its path from the repository's top folder, for example deploy/preview.compose.yml.

"Web Service must be the name of a service in your Compose file"

Copy the service's name exactly as it appears under services: in your Compose file, for example app, without spaces or a colon.

I changed a setting but my running preview did not change

Running previews keep the settings they started with. Click Rebuild on the PR Previews page. If the setting is one a rebuild does not pick up (see "When a change takes effect"), tear the preview down and request a new one.

Previews use the wrong repository or branch

Check that Backend Repo URL names a GitHub repository in one of the accepted forms, and that Fallback Branch names a branch that exists. A value that is not a GitHub repository is ignored, and Helm then copies the repository whose workflow asked for the preview.

"Helm's GitHub installation for your-org cannot reach your-org/your-backend"

The Helm GitHub App is installed on the GitHub account, but it was given access to selected repositories only, and this repository is not one of them, or the URL has a typing mistake. On GitHub, open the account's Settings, then GitHub Apps, click Configure next to the Helm app, add the repository under Repository access, and save the URL again. See Connect GitHub for PR Previews.

"Helm could not check that it can reach …"

GitHub or Helm did not answer in time, so Helm could not tell whether the repository is right. Nothing was saved. Wait a few minutes and click Save Changes again.