# Node.js and Python apps

> Run Node.js and Python web apps as managed services behind the web server, with Git deploys.

Node.js and Python apps run as managed systemd services on a local port; the web server in front handles the domain, HTTPS and static files.

## 1. Install the runtime

In the server's [web stack](/docs/web-stack), **Install Node.js** (22, 24 or 26) or **Install Python** (3.12, 3.13 or 3.14).

## 2. Add the site

**Add site** with **Runs on: Node.js** or **Python**, the version and the domain. Zefily assigns a free local port to the app.

## 3. Deploy the code

On the site's **Deploy** pane, set up a [Git deploy](/docs/deploy-from-github) with the **Node.js** or **Python** preset:

| | Node.js | Python |
| --- | --- | --- |
| Build commands | `npm ci`, `npm run build --if-present` | `uv sync --frozen --no-dev` |
| Start command | `npm start` | `uv run gunicorn --bind 127.0.0.1:$PORT app:app` |

The **Start command** runs in the live release as the site user. Your app must listen on `127.0.0.1:$PORT`; the environment also carries `HOST=127.0.0.1`, `WEB_CONCURRENCY` (worker processes sized for the server's cores and memory) and for Node.js `NODE_ENV=production` plus `NODE_OPTIONS=--max-old-space-size=…`, a heap ceiling per worker sized from the app's share of the memory. Python apps use `uv` with the managed Python version; for FastAPI or another ASGI app use for example `uv run uvicorn main:app --host 127.0.0.1 --port $PORT --workers $WEB_CONCURRENCY`.

The app restarts on every deploy; if it does not answer after a deploy, the site switches back to the previous release.

## Environment and database

Put configuration in the site's [.env](/docs/logs-and-env); [connect a database](/docs/databases) to get `DATABASE_URL`. The app's output is on the **Logs** pane under **App process**.

## Background workers

Run queue consumers, schedulers or bots as [daemons](/docs/cron-and-daemons) of the site's user, with their working directory in the site's `current` folder.

---
Source: https://zefily.com/docs/node-python-apps
