Skip to Content

Runtimes

Zenifra does not perform automatic runtime detection. In projects created from a Git repository, the user explicitly chooses the runtime during project creation.

Supported runtimes

RuntimeHow it works
Node.jsThe user chooses the version in the console, and the platform installs dependencies with npm ci
PythonThe user chooses the version in the console, and the platform installs dependencies with pip install --no-cache-dir -r requirements.txt when the file exists
BunThe user chooses the version in the console, and the platform installs dependencies with bun install --frozen-lockfile
GoThe user chooses the version in the console; go.mod modules are downloaded by the build itself, with no separate install step
JavaThe user chooses the JDK version in the console; dependencies are downloaded by the build (Maven or the repository's Gradle wrapper), with no separate install step
PHPThe user chooses the version in the console, and the platform installs dependencies with composer install --no-dev --optimize-autoloader when composer.json exists

Note: Today, Node.js, Python, Bun, Go, Java, and PHP are officially supported for Git repository builds. .NET, Nginx, Apache, and other stacks should be published via OCI Image.

Available versions

RuntimeVersionsSuggested default port
Node.js20, 22, 24, and 263000
Python3.11, 3.12, 3.13, and 3.148000
Bun1.2, 1.3, and 1.43000
Go1.25, 1.26, and 1.27 (default 1.27)8080
Java17, 21, and 25, all LTS (default 21)8080
PHP8.3, 8.4, and 8.5 (default 8.4)8080

Pick the same major version you use in development. The suggested port is just a starting point: the project Port field must match the port your app listens on.

Build and runtime environment

  • Project environment variables are available during dependency install, pre-build, and build, as well as at runtime. This lets build steps use variables such as NEXT_PUBLIC_* or VITE_*.
  • Changing a variable restarts the instances but does not rebuild. Values embedded during the build only change on a new deployment.
  • The app runs as an unprivileged user inside the application directory. It can write to that directory, but files are ephemeral unless stored in persistent storage.
  • On Node.js and Bun, the app runs with NODE_ENV=production.
  • The build uses the folder set in Root directory (the repository root by default; in monorepos, a subfolder such as backend) and an environment generated by Zenifra for the selected runtime: an existing Dockerfile in the repository is not used. To build with your own Dockerfile, publish an OCI Image.
  • The repository .git folder is not included in the published application. If your application read Git information at runtime (for example, the current commit), use an environment variable.
  • On Python, print() and logging output reaches the logs unbuffered, and the build environment includes a C compiler and the PostgreSQL client libraries for packages with native extensions.

Important rule

In GitHub projects created in the console, runtime, version, and branch cannot be changed in the console; through the API (PUT /v1/project/:id/source) or the CLI (zenifra project source) you can reconfigure the source. In GitLab and Forgejo projects, the Git repository card in Edit project lets you change the runtime, version, and commands.

Node.js

Required files

{
  "name": "my-app",
  "scripts": {
    "start": "node index.js"
  }
}

For Node.js projects based on Git, these files are required:

  • package.json
  • package-lock.json

Default dependency install

Zenifra installs dependencies with:

npm ci

By default, npm ci installs the dependencies declared in the lockfile. Keep TypeScript, bundlers, and other build tools in devDependencies. If the project configuration sets NODE_ENV=production for the build, that install omits those dependencies; in that case, set pre-build to npm install --include=dev. It runs after the default install and before npm run build, making the tools available to the build. The current runtime does not prune devDependencies after that step.

No build command: when the build field is empty, devDependencies are pruned after install. Everything the start command uses must be in dependencies.

Git projects using Yarn or pnpm are compatible with the current Node.js runtime only when they also provide a compatible npm package-lock.json. Zenifra does not automatically convert Yarn or pnpm lockfiles or workspaces; without a compatible npm lockfile, publish an OCI Image prepared by your own build process.

Project commands

After the default install step, these commands are user-defined during project creation:

  • pre-build (optional)
  • build (optional)
  • start (required)

A common use of pre-build in Node.js is generating code before the build, such as ORM clients. pre-build runs during the build, not on every application start; for database migrations, prefer running them at the beginning of start, as shown in the framework guides.

Python

Dependency files

Keep a requirements.txt in the project's Root directory (the repository root by default) with the runtime dependencies. The install below runs only when that file exists. If the repository also has pyproject.toml or setup.py, the package is installed with pip install -e . after the build.

Default dependency install

pip install --no-cache-dir -r requirements.txt

Project commands

These commands are user-defined during project creation:

  • pre-build (optional)
  • build (optional)
  • start (required)

Bun

Files

{
  "name": "my-app",
  "scripts": {
    "start": "bun index.ts"
  }
}
  • package.json (required)
  • bun.lock (recommended): commit the lockfile so the build installs exactly the versions used in development. Generate it with the same Bun version selected for the project: a lockfile created by a newer version can be rejected by an older one.

Default dependency install

bun install --frozen-lockfile

devDependencies stay installed after the build, so tools such as TypeScript and bundlers are available to pre-build and build. Bun runs TypeScript directly, with no required compile step.

Project commands

The default start command is bun run start, which runs the start script from package.json. As with the other runtimes, you can also set:

  • pre-build (optional)
  • build (optional)
  • start (required)

Go

Files

Keep go.mod (and go.sum) in the project's Root directory (the repository root by default). Choose a Go version equal to or newer than the go line of go.mod: with an older version the build stops with go.mod requires go >= …. There is no separate install step: modules are downloaded by the build itself, and a committed vendor/ folder works with go build -mod=vendor.

Default commands

# build
go build -o app .

# start
./app

The default build compiles the main package at the root. If it lives in a subfolder, as in the cmd/server layout, point the build at it:

go build -o app ./cmd/server

The optional pre-build (for example, go generate ./...) runs before build. If the build field is left empty, nothing is compiled and start has nothing to run.

Notes

  • The build is static: CGO is disabled and the environment has no C compiler. Packages that depend on CGO need a pure Go alternative or an OCI Image. For example, github.com/mattn/go-sqlite3 compiles but fails when the app starts (requires cgo); use modernc.org/sqlite. Pure Go drivers such as pgx work normally.
  • Files embedded with //go:embed (templates, static files) go into the binary normally.
  • The binary does not include Git information. To expose the version or commit, use an environment variable.
  • The environment sets PORT=8080 by default. Read the port from PORT and keep the project Port field equal to the port your app listens on.

Java

Environment and files

The build uses an Eclipse Temurin JDK in the selected version (17, 21, or 25) with Maven 3.9. In Maven projects, keep pom.xml in the Root directory; in Gradle projects, commit the wrapper (gradlew and the gradle/ folder). There is no separate install step: dependencies are downloaded by the build. If the project has a .dockerignore, it is not used in this build.

Default commands (Maven)

# build
mvn -B -DskipTests package

# start
java -jar target/*.jar

The default start expects one executable jar in target/, such as the one Spring Boot produces. If the project has the Maven wrapper, you can use ./mvnw -B -DskipTests package as build.

Gradle

Gradle projects use the repository's own wrapper. For example, with Spring Boot:

# build
./gradlew bootJar -x test

# start
java -jar build/libs/<name>.jar
  • Point start at the exact jar: Gradle also produces a -plain.jar, which is not executable.
  • If build.gradle sets a Java toolchain (languageVersion = JavaLanguageVersion.of(17)), choose that same version in the project. Otherwise the build fails while looking for that JDK.
  • With Kotlin and Ktor, ./gradlew buildFatJar produces build/libs/<name>-all.jar.

Other frameworks

Frameworkbuildstart
Spring Boot (Maven)mvn -B -DskipTests packagejava -jar target/*.jar
Quarkusmvn -B -DskipTests packagejava -jar target/quarkus-app/quarkus-run.jar
Javalin and others with maven-shade-pluginmvn -B -DskipTests packagejava -jar target/<name>.jar
Ktor (Gradle)./gradlew buildFatJarjava -jar build/libs/<name>-all.jar

In Quarkus, set quarkus.http.port=${PORT:8080} in application.properties or keep the project Port at 8080.

A single-file program (Main.java) can run without a build: leave build empty and use java Main.java as start.

Memory

The app starts with -XX:MaxRAMPercentage=75: the JVM uses up to 75% of the plan memory for the heap, instead of the JVM default of 25%. To change it, set the JAVA_TOOL_OPTIONS environment variable.

Notes

  • The optional pre-build runs before build.
  • The environment sets PORT=8080 by default, and Spring Boot already listens on 8080. If your app uses another port, adjust the project Port field.

PHP

Environment and files

The app runs on FrankenPHP, a production PHP application server, in the selected version (8.3, 8.4, or 8.5). Keep composer.json (and composer.lock) in the project Root directory. When composer.json exists, the install step runs composer install --no-dev --optimize-autoloader; without it, as in a plain PHP site, the step is skipped.

Extensions

Besides the standard PHP extensions (mbstring, curl, openssl, xml, ctype, fileinfo, tokenizer, sodium, pdo_sqlite, and others) and OPcache, the environment already includes pdo_mysql, mysqli, pdo_pgsql, redis, zip, intl, gd, bcmath, exif, and pcntl. Extensions that composer.json requires in require (for example, "ext-mongodb": "*") and that are not on this list are installed automatically before composer install, which makes that step take longer.

Default commands

# build
(empty)

# start
frankenphp php-server --listen :$PORT --root public/

The default start serves the public/ folder used by Laravel, Symfony, Slim, and CodeIgniter. If index.php sits at the project root, replace public/ with . in start. The optional pre-build and build run after composer install.

Laravel

Set the project environment variables:

VariableValue
APP_KEYOutput of php artisan key:generate --show
APP_ENVproduction
APP_DEBUGfalse
APP_URLhttps://your-project.clients.zenifra.com or your domain
LOG_CHANNELstderr, so logs show up in the console
DB_CONNECTIONpgsql or mariadb
DB_URLConnection URI of the managed database, copied from the console
REDIS_URLValkey URI, copied from the console, if the application uses Valkey

Use the console URI in DB_URL, not DB_HOST and the other separate variables: that way, the connection follows the console URI, with TLS. On MariaDB, the PHP runtime already has TLS set up, with the certificate verified: there is nothing to add. See Laravel with PostgreSQL and Laravel with MariaDB.

To run migrations and build the config, route, and view caches on every start, use this start:

php artisan migrate --force && php artisan optimize && frankenphp php-server --listen :$PORT --root public/

Build the caches in start rather than in build: a variable changed in the console then applies on the next restart, without a new deployment.

If the front end uses Vite, install Node.js in the build itself:

apk add --no-cache nodejs npm && npm ci && npm run build

For Laravel to generate https URLs, set trustProxies(at: '*') in bootstrap/app.php. Files in storage/app are lost on every deployment: use persistent storage or an object storage service.

Symfony

Set APP_ENV=prod and APP_SECRET in the project environment variables. Since variables also apply during install, Composer scripts (such as cache:clear) already run in production and do not look for development packages. The default start works unchanged.

For the database, use DATABASE_URL. On PostgreSQL, add serverVersion to the console URI; on MariaDB, change mariadb:// to mysql:// and provide the CA bundle in doctrine.yaml. See Symfony with Doctrine and PostgreSQL and Symfony with Doctrine and MariaDB.

Notes

  • The environment sets PORT=8080 by default, and the default start listens on $PORT. Keep the project Port field equal to the port your app listens on.
  • The build runs on Alpine Linux: extra system packages can be installed with apk add --no-cache in pre-build or build.

What can be edited later

In GitHub projects, after creation, the pre-build, build, and start commands and the update mode remain editable; runtime, runtime version, and branch are set during creation. See GitHub Deployment.

In GitLab and Forgejo projects, you can also change the repository, branch, runtime, version, and deployment mode after creation; see Deploy from GitLab and Deploy from Forgejo.

Last updated on

On this page