Set the Node.js, Python, Go or Ruby version
Lizard reads the runtime version from files in your project when lizardpack builds it: .nvmrc or engines.node for Node.js, .python-version or requires-python for Python, the go line of go.mod for Go, and .ruby-version or the Gemfile ruby line for Ruby. To change the version, edit that file and deploy again. Without one, Lizard uses Node.js 22, Python 3.13, Go 1.24 or Ruby 3.4.
Test status: we checked every rule on this page on 2026-10-12 by running lizardpack, the build planner Lizard’s builders run, against sample projects.
Where Lizard looks
| Language | Files, first match wins | Part of the version used | Default | Base image |
|---|---|---|---|---|
| Node.js | .nvmrc, .node-version, .tool-versions (nodejs or node), engines.node in package.json | Major: 20.11.1 → 20 | 22 | node:<major>-slim |
| Python | .python-version, .tool-versions (python), requires-python in pyproject.toml | Major and minor: 3.12.4 → 3.12 | 3.13 | python:<x.y>-slim |
| Go | The go line in go.mod | Major and minor: 1.24.3 → 1.24 | 1.24 | golang:<x.y>-alpine to build, alpine:3.19 to run |
| Ruby | .ruby-version, the ruby line in Gemfile | Major and minor: 3.4.1 → 3.4 | 3.4 | ruby:<x.y>-slim |
Lizard uses the official image tag for the major or major/minor version and drops the patch number. Each build gets the patch release that tag points to when the build runs.
These files apply only when lizardpack writes the Dockerfile. See when Lizard ignores version files.
Change the Node.js version
echo 24 > .nvmrc
lizard up --service webWith a GitHub service, commit the file and push instead. Rules:
- Write a number:
24,v24and24.1.0all select Node.js 24. Lizard skips lines that start with#. - Lizard skips
lts/*andnodein.nvmrcand moves on to the next file. It uses other aliases, such aslts/iron, as written, and the build fails. .nvmrcwins overengines.node.engines.nodegives the lowest version in its range:>=18builds on Node.js 18, and^20.11.0on Node.js 20. A range with||, such as18 || 20, fails the build.
Change the Python version
echo 3.12 > .python-version
lizard up --service web.python-versionmust hold a version number such as3.12or3.12.4. Lizard skips lines that start with#. It also skips other values, such aspypy3.10, and moves on to the next file.requires-python = ">=3.11"builds on Python 3.11, the lowest version in the range.- A range with an upper bound, such as
">=3.11,<3.14", produces an image name that does not exist and the build fails. Add a.python-versionfile; it wins. runtime.txtis not read.
Change the Go version
go mod edit -go=1.25
lizard up --service apiLizard reads only the go line. It does not read the toolchain line.
Change the Ruby version
echo 3.4.1 > .ruby-version
lizard up --service webWrite the bare number. rails new writes ruby-3.4.1, and Lizard does not strip the ruby- prefix, so the build fails. A Gemfile line such as ruby "~> 3.3.0" builds on Ruby 3.3. A Rails app that keeps its generated Dockerfile takes the version from that file instead; see Deploy a Rails app.
When Lizard ignores version files
- Your own Dockerfile. Its
FROMline decides, for exampleFROM node:24-slim. See Deploy a Docker container from a Dockerfile. - A build or start command on the service. Lizard then writes a Dockerfile from the commands on a fixed image:
node:22-alpine,python:3.13-slimorgolang:1.24-alpine, chosen by the first word of the command. To return to version files, clear both:
lizard service set web --set buildCommand= --set startCommand=Clearing buildCommand on a running service starts a rebuild by itself. Check lizard events before you run lizard redeploy, so you do not queue a second build. See the build decision order.
Check which version a build used
lizard logs --build --service webThe build log names the base image, such as node:24-slim or python:3.12-slim. To check the version at run time, print it when your app starts, for example process.version in Node.js or sys.version in Python, and read lizard logs --service web.
Related
- Build pipeline
- Deploy a Node.js app
- Deploy a Go app
- Deploy a Streamlit app
- Deploy FastAPI
- Deploy Django
Updated