Node.js versioning in Nixpacks

Nixpacks supports selecting a Node.js major version. The Nix package archive used by the build determines the exact minor and patch version.

Select a major version

Use one repository source of truth:

{
  "engines": {
    "node": "22"
  }
}

Nixpacks can also read .nvmrc or .node-version.

Alternatively, add a build variable in Coolify:

NIXPACKS_NODE_VERSION=22

Keep Build Variable enabled, then redeploy and inspect the build log to confirm the resolved version.

Why a range does not pin a patch release

Values such as 22, 22.x, or >=22 select a compatible major version. They do not tell Nixpacks which nixpkgs archive to use.

The selected archive contains a particular Node.js package. A build can therefore resolve Node.js 22.13.1, 22.14.0, or another 22.x release even when the application version setting has not changed.

Pin a nixpkgs archive

When the application must stay on the package set from one nixpkgs commit, add nixpacks.toml to the application source directory:

[phases.setup]
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'

The value is a complete commit SHA from the NixOS/nixpkgs repository. The example commit contains Node.js 22.13.1.

Redeploy and inspect the Nixpacks build log to confirm the Node.js version selected from the pinned archive.

An archive pin changes the complete package set

A nixpkgs commit controls more than Node.js. The pin can also change system libraries and other packages used by the build. Test the image and application before moving an archive change to production.

Use a Dockerfile with an exact base-image tag or digest when exact runtime reproducibility is a deployment requirement.

Find an archive commit

To locate a nixpkgs commit for a required Node.js release:

  1. Open the NixOS/nixpkgs repository.
  2. Find the Node.js version definition, such as pkgs/development/web/nodejs/v22.nix.
  3. Open the file history and find the commit that introduced the required version.
  4. Confirm the version and source hash in that revision.
  5. Copy the complete commit SHA into nixpacks.toml.
  6. Deploy in a non-production environment and verify the resolved Node.js version in the build log.

For example, commit 51ad838b03a05b1de6f9f2a0fffecee64a9788ee updates the Node.js 22 package from 22.12.0 to 22.13.1.

Read the upstream nixpkgs archive configuration for the Nixpacks setting.

Node.js source-hash reference

The following values were collected from Node.js package definitions in nixpkgs history. Use them to compare the package definition in a candidate archive commit with the Node.js release you expect.

Reference data only

These hashes are not nixpkgs archive commit IDs, and they do not pin a version by themselves. The values have not been independently verified for every platform or archive state. Confirm the version and hash in the candidate nixpkgs commit before using it.

VersionSHA256
20.0.0sha256-dFDnV5Vo99HLOYGFz85HLaKDeyqjbFliCyLOS5d7XLU=
20.1.0sha256-YA+eEYYJlYFLkSKxrFMY9q1WQnR4Te7ZjYqSBmSUNrU=
20.2.0sha256-IlI98jFsNVaXFP8fabBTwuKGztRgiYQX3uRpRe/N+Yk=
20.3.0sha256-G6jUlCPtOnVykGa7PqJkk+6ct9ZWjvlIWX/J70VPdDU=
20.3.1sha256-EqgtswZpeVm0OJs1Gl+XhImGsTE/mQGw4LPYz08/mZE=
20.4.0sha256-Cb0Lc8UmtjwCnV3f2IXRCWLnrYfJdblFg8H4zpDuU0g=
20.5.0sha256-yzJ1aVje8cBOBpp5txtSymHtFZDBfyz6HuOvZB9y4Fg=
20.5.1sha256-Q5xxqi84woYWV7+lOOmRkaVxJYBmy/1FSFhgScgTQZA=
20.6.0sha256-nvtcunqPSxjTiw19N6mzDe1zOQyE44DPTeianTCn1vo=
20.6.1sha256-Ouxeco2qOIAMNDsSkiHTSIBkolKaObtUZ7xVviJsais=
20.7.0sha256-P8/c0FxGFRdIBZZZZnTfhbNc/OWX3QrjP1QW/E3xK+o=
20.8.0sha256-QSvoR65t9hAQup2jzD5r5bZ6oALjVOkZ9Z7INgNxcEw=
20.8.1sha256-95nGb2pjhruKwsdaN490DEVel/H+lkOT3TnJ+fbvvHA=
20.9.0sha256-oj2WgQq/BFVCazSdR85TEPMwlbe8BXG5zFEPSBw6RRk=
20.10.0sha256-MuslbuvYys1VdOZjHlS0K+fsjr4lrUeoymhUA7rRVTU=
20.11.0sha256-MYB+vu6wScU/F2XkqVrtaUdqS2lt0QDLU5q2aNeVC0A=
20.11.1sha256-d4E+2/P38W0tNdM1NEPe5OYdXuhNnjE4x1OKPAylIJ4=
20.12.0sha256-duU0bOv9WBUo9pn3ZPTRpuh8uBi2lnCPI13ctiWg940=
20.12.1sha256-aEDUkLpNHVFlXg++EgmVahXbQFUQ1+oWa62YqMnTek4=
20.12.2sha256-18vMX7+zHpAB8/AVC77aWavl3XE3qqYnOVjNWc41ztc=
20.14.0sha256-CGVQKPDYQ26IFj+RhgRNY10/Nqhe5Sjza9BbbF5Gwbs=
20.15.0sha256-D0p6BRw12V65BejLKqQ8XUArExIDkI/mM+s8+gUO+Qc=
20.15.1sha256-/dU6VynZNmkaKhFRBG+0iXchy4sPyir5V4I6m0D+DDQ=
20.16.0cd6c8fc3ff2606aadbc7155db6f7e77247d2d0065ac18e2f7f049095584b8b46
20.17.09abf03ac23362c60387ebb633a516303637145cb3c177be3348b16880fd8b28c
20.18.07d9433e91fd88d82ba8de86e711ec41907638e227993d22e95126b02f6cd714a
20.18.191df43f8ab6c3f7be81522d73313dbdd5634bbca228ef0e6d9369fe0ab8cccd0
20.18.269bf81b70f3a95ae0763459f02860c282d7e3a47567c8afaf126cc778176a882
20.18.30674f16f3bc284c11724cd3f7c2a43f7c2c13d2eb7a872dd0db198f3d588c5f2
20.19.05ac2516fc905b6a0bc1a33e7302937eac664a820b887cc86bd48c035fba392d7
20.19.15587b23e907d0c7af2ea8a8deb33ec50010453b46dbb3df5987c5678eee5ed51
20.19.24a7ff611d5180f4e420204fa6f22f9f9deb2ac5e98619dd9a4de87edf5b03b6e
20.19.399be7b9d268d48b93be568a23240398ceacb0782dc7055b9972305c000b0e292
20.19.4b87fd7106013d3906706913ffc63a4403715fbb272c4f83ff4338527353eec0f
20.19.5230c899f4e2489c4b8d2232edd6cc02f384fb2397c2a246a22e415837ee5da51
20.19.62026f9ff52c286d7c7d99932b21be313d1736aea524c5aff1748d41ab0bd9a20

Read the Nixpacks Node provider for upstream version-selection behavior.

On this page