# Node.js on Heroku

Canonical: https://inetgeek.com/stacks/nodejs-on-heroku/

Heroku publishes its own guide for deploying Node.js.

JavaScript runtime used to run servers and build tooling outside the browser.

## What Node.js needs

Every host claims to run Node.js, so the claim on its own decides nothing. These are the things Node.js requires from the platform underneath it, and what Heroku publishes about each. Heroku documents 4 of the 4.

| Requirement | Heroku | Why it matters |
| --- | --- | --- |
| Persistent processes | Supported | A long-running process is the point: WebSocket connections, in-memory caches and job queues all die with it. A host that only runs functions cannot keep one alive. |
| Max request duration | 30 seconds (initial window for the web process to return response data) | Anything the process does inside a request — a large upload, a slow query, a streamed response — is bounded by this ceiling. |
| Docker deployment | Supported | Node apps routinely need a system binary the platform's buildpack does not ship. A Dockerfile is the escape hatch when they do. |
| Scales to zero | Limited | An always-on process bills while idle. Scaling to zero removes that cost and adds a cold start to the next request instead. |

- Persistent processes source: https://devcenter.heroku.com/articles/dynos
- Max request duration source: https://devcenter.heroku.com/articles/limits
- Docker deployment source: https://devcenter.heroku.com/articles/container-registry-and-runtime
- Scales to zero source: https://devcenter.heroku.com/articles/eco-dyno-hours

## What Heroku documents

> This article describes how to take an existing Node.js app and deploy it to Heroku.

Source: https://devcenter.heroku.com/articles/deploying-nodejs

### Node.js features on Heroku

- **websockets**: Supported — When developing real-time Node.js applications, you can use WebSockets directly. You can also use an abstraction library like Socket.io, which provides fallbacks for clients that don't support the WebSocket protocol. ([source](https://devcenter.heroku.com/articles/node-websockets))
- **background_workers**: Supported — Heroku allows you to specify an application-specific process model, which can include background workers retrieving and processing jobs from the work queue. [...] You can then scale the number of web dynos independently of the number of worker dynos. [...] Background Jobs in Node.js with Redis ([source](https://devcenter.heroku.com/articles/background-jobs-queueing))
- **configurable_request_timeout**: Not supported — The timeout value is not configurable. If your server requires longer than 30 seconds to complete a given request, we recommend moving that work to a background task or worker to periodically ping your server to see if the processing request has been finished. ([source](https://devcenter.heroku.com/articles/request-timeout))
- **ssh_shell_access**: Supported — Heroku Exec is a feature for creating secure TCP and SSH tunnels into a dyno. It supports SSH sessions, port forwarding, remote debugging, and inspection with popular Java diagnostic tools. ([source](https://devcenter.heroku.com/articles/exec))

## What it costs to run there

|  | Heroku |
| --- | --- |
| Entry paid plan | $5 per month (Eco dynos plan, 1000 dyno hours shared across the account) |
| Pricing model | Usage-based on wall-clock time, prorated to the second |
| When you exceed a cap | Service sleeps: on the Eco plan ($5/month for a 1000 dyno-hour pool, the cheapest paid tier) exhausting the pool forces every Eco dyno on the account to sleep for the rest of the month, and extra hours cannot be bought |
| Regions | 2 regions on the Common Runtime, which is what a standard dyno runs in: eu (Europe) and us (United States). A further 10 — Dublin, Frankfurt, London, Montreal, Mumbai, Oregon, Singapore, Sydney, Tokyo and Virginia — exist only in Private Spaces, an Enterprise product. |

- Entry paid plan source: https://devcenter.heroku.com/articles/eco-dyno-hours
- Pricing model source: https://devcenter.heroku.com/articles/usage-and-billing
- When you exceed a cap source: https://devcenter.heroku.com/articles/eco-dyno-hours
- Regions source: https://devcenter.heroku.com/articles/regions

## Whether it suits you

Teams that want to deploy by pushing to Git and let the platform handle the runtime, with Postgres, a scheduler and Docker deploys available on the same platform.

Consider something else if: The dyno filesystem is ephemeral, and a web process must respond within 30 seconds of receiving a request.

Written by Palash Bagchi on 2026-09-05. This is a recommendation, not a sourced fact — it carries no citation because it is an opinion.

## Related

- Best hosting for Node.js: https://inetgeek.com/stacks/nodejs/
- Heroku: https://inetgeek.com/hosting/heroku/
