Fix Nixpacks "could not determine how to build" on Coolify

Error: Nixpacks was unable to generate a build plan for this app. / No setup or build phase could be determined (could not determine how to build the app)

Coolify's default Nixpacks build pack couldn't match your repo to any language or framework at the Base Directory, so it refused to produce a build plan.

Coolify defaults new apps to the Nixpacks build pack, which auto-detects the stack from files at the configured Base Directory. It fails when the app lives in a monorepo subfolder (Base Directory points at the wrong path), when no recognised manifest (package.json, requirements.txt, go.mod, Cargo.toml, etc.) sits at that path, or when the framework isn't in Nixpacks' provider list.

The fix

  1. Open the application in Coolify, go to Configuration > General, and check the Base Directory field. Coolify describes it as the directory Nixpacks uses as the root. Point it at the folder that actually holds your manifest (e.g. /backend or /apps/web for a monorepo, or / if your files are at the repo root).

  2. If the stack is supported but living in a subfolder, set Base Directory to that subfolder and redeploy. That alone fixes most monorepo cases.

  3. If Nixpacks still can't detect it, force an explicit build plan. Commit a nixpacks.toml at the Base Directory naming the provider and the build/start commands. Nixpacks picks it up automatically when present.

    # nixpacks.toml at your Base Directory
    providers = ["node"]
    
    [phases.install]
    cmds = ["npm ci"]
    
    [phases.build]
    cmds = ["npm run build"]
    
    [start]
    cmd = "npm run start"
  4. The most robust permanent fix is to stop relying on auto-detection. Commit a Dockerfile, then in Coolify's "Choose the Build Pack" / Configuration > General set the Build Pack to Dockerfile. Coolify then builds exactly what you wrote, with no guessing.

    # In Coolify: set Build Pack = Dockerfile (Configuration > General), then redeploy
  5. Commit and push the new file(s), then trigger a redeploy in Coolify.

Verify it worked

The deploy log shows a detected provider (e.g. a Node/Python provider line under "Nixpacks v...") or a normal Dockerfile build, and the build proceeds past the planning step into the install and build phases instead of erroring out.

Related Coolify errors

Have Emsden Studio fix it for you — from A$149

All Coolify deploy errors