Build settings

How your code becomes a running app - the build method, its commands, and the port it listens on.

The Build card, in the app's Settings -> Deployments. Most apps never touch it. A Docker image app or a pasted Compose app has no Build card.

Build methods

Three tabs at the top of the card. Switching keeps the app's domains, variables and volumes.

TabWhat it doesIts own fields
Automatic (default)Your Dockerfile or Compose file if there is one, otherwise RailpackFramework, Port, the Advanced drawer
DockerfileBuilds your Dockerfile as it isDockerfile path, Build context, Build stage, Port
ComposeBuilds and starts the services of the Compose file in your repositoryCompose file

Nixpacks and Static are gone

Nixpacks, Static, Heroku and Paketo apps moved to Railpack. A folder they published became Railpack's Output directory.

Automatic

On every deploy, the server agent looks in the Root directory:

  1. A Dockerfile? It builds it.
  2. Otherwise a Compose file (compose.yaml, compose.yml, docker-compose.yaml, docker-compose.yml) that builds a service from the repository? It deploys it as a stack. One that only runs images, or breaks a rule, is skipped and the log says why.
  3. Otherwise, Railpack builds the app.

The card shows the result under the tabs, for example Last deploy: Railpack. To ignore a development Dockerfile or Compose file, tick Always build with Railpack in Advanced. To deploy a Compose file that only runs images, pick the Compose tab.

Railpack

Railpack reads your code, finds the language and the framework, and writes the build.

  • No version to pick: Deplo uses the one it tested, 0.43.0 today, updated with the server agent.
  • Its settings are variables: any RAILPACK_*, like RAILPACK_PYTHON_VERSION=3.13 or RAILPACK_DEPLOY_APT_PACKAGES=ffmpeg.
  • Java follows your Gradle toolchain. RAILPACK_JDK_VERSION still wins.
  • A railpack.json in the repository is used.
  • GitHub downloads of language tools use a read-only token when the team has the GitHub App, past GitHub's 60 anonymous requests an hour.

Dockerfile

No framework detection. Dockerfile path and Build context are relative to the repository root. Build stage picks one stage of a multi-stage Dockerfile, like runtime; empty builds the last.

Docker Compose

The Compose tab: Deplo reads the Compose file in your repository on every deploy, builds its services and starts them as one stack.

  • Compose file picks another path, like deploy/compose.prod.yaml.
  • Your variables reach the stack. The domain goes to the service with ports: or expose:.
  • Folders a service mounts, like ./data, survive a redeploy in the server's copy of the repository. Backups and moves carry named volumes only: keep data there.
  • It builds on the app's own server, never a build server. A pull request preview uses its own Compose file.

Anyone who can push writes this file, so these rules always apply:

In the fileWhat happens
ports:Not opened on the server. The domain reaches that port
An env_file the repository does not shipSkipped. Your Deplo variables arrive anyway
image: on a service with build:Renamed, so it never stands in for another app's image
traefik.* labelsIgnored. Deplo routes the domains
privileged, cap_add, devices, network_mode, pid: host, ipc: host, security_opt and other host-level keysRefused
A bind mount outside the repository, or of the Docker socketRefused
An external volume or network, or one with a fixed nameRefused
include:, extends of another file, label_fileRefused. Put the content in this file
A build that reads outside the repository, forwards SSH keys, or runs privilegedRefused
An env_file, build folder or mounted path inside a folder a service mounts writableRefused. Mount that folder :ro

A refused file fails the deploy with the reason in the log. Pasted YAML is a different thing: Compose apps.

Framework detection

With Automatic, the framework is read from package.json and the root configuration on every deploy. It fills in the build command (your build script), the port, and a start command only where there is one obvious answer (SvelteKit adapter-node, AdonisJS). Your start script is never used: it is usually the dev server.

The Framework select, Detect automatically by default, overrides detection, sticks across redeploys and sets that framework's port. Use plus the detected name goes back.

The fields

Port is on the card for Automatic and Dockerfile. The rest are in the Advanced drawer of Automatic. A typed value wins over detection; empty goes back to detection (the grey text is a placeholder).

FieldWhat it does
Install commandOverrides the install step, like npm ci --include=dev
Build commandOverrides the build step, like npm run build:prod
Start commandOverrides the start step, like node dist/server.js
Output directoryServes this folder as a static site, like dist. Empty for an app with its own server
Node.js versionPins the Node.js major. Empty reads it from your project
Single-page applicationSends unknown paths to index.html, for client-side routing
Always build with RailpackSkips your Dockerfile and Compose file
PortWhere the app listens in its container. 3000, or the framework's own

Root directory is on the Source card of a repository app: the subfolder to build from, like apps/web. Save build settings does not deploy: Redeploy applies it.

The port is the one people get wrong

Deplo sends traffic to one port per app. Framework defaults that surprise:

FrameworkPortFrameworkPort
Vite, Preact, Svelte4173Astro4321
Angular4200AdonisJS3333
Gatsby9000Strapi1337
Eleventy, Vue8080Everything else3000

Deplo finds the real port. If the app listens on 8080 instead of 3000, the deploy moves the traffic, saves 8080 as Port, records it in Activity and logs:

Your app listens on port 8080, not 3000: Deplo now sends its traffic to 8080.

With several ports open, it picks the one that answers HTTP. PORT is still set. It cannot fix 127.0.0.1: an app listening only there fails the deploy. Make it listen on 0.0.0.0.

One hostname can override the port in Domains, to serve an API and a dashboard on two domains.

Build cache

Build cache and where the build runs, on Settings -> Advanced

Settings -> Advanced, the Build & triggers card. Build cache is on by default. It lives on the server, shared by every app there: the first build is slow, the next ones are not.

  • The switch turns the cache off for this app only.
  • Clear cache makes the next deploy build from scratch. It frees no disk: that is Docker cleanup.
  • Build on (beta) builds on another server of the same CPU architecture. With Build somewhere else if that server is down on (default), a failed build server hands over to a build fallback server, then the app's own; off, the deploy fails. Build servers.
  • Extra compose flags, like --wait: Compose apps.
  • Deploy hook: Automatic deployments.

Troubleshooting

SymptomWhat to check
No start command detectedSet Start command.
Railpack does not recognise this folderSet Root directory, or add a Dockerfile.
Node.js 25 is not available (or another language)Pin a released version: Node.js version, or the variable the message names.
command not found during the buildSet Build command, or pick the Framework.
listens only on 127.0.0.1Make the app listen on 0.0.0.0.
A Compose app's domain answers nothingAdd expose: ["3000"] to the service that serves the app.
Every build is slowBuild cache is off, or a cleanup removes it.
A setting saved but nothing changedSaving is not deploying. Redeploy.

More in Deploys and builds.

Next steps

Did this page help you?

On this page