Netlify has introduced Netlify Server, a backend that stays running between requests. Netlify Functions, its existing backend option, start up for each request and then stop. A persistent server can hold a live connection open and remember things in memory, which matters for chat, multiplayer apps and agents that work for a long time.

Netlify Server is in Early Access. It is available on credit-based plans and on Enterprise plans with credits enabled.

How it works

You write one file at netlify/server/index.ts. It can be a plain request handler, or you can bring an existing Express, Hono or Fastify app. These are common Node.js libraries for building a backend. Netlify says you do not configure ports, add health-check endpoints or install adapters.

The server builds and deploys with the rest of your project. Netlify says each branch and deploy preview runs its own backend version, so a preview of a frontend change talks to the matching backend change. Local builds need Netlify CLI 27.17.0 or later. Netlify says the server works with Netlify Database, Netlify Blobs, AI Gateway and the Cache API.

Because the process is long-lived, Netlify adds three hooks: onStart runs before traffic arrives, for warming up; onHealthCheck reports the server’s status; onShutdown runs before it stops, for cleanup.

Limits during Early Access

  • The server scales to at most 3 instances, or 1 on Free and Personal plans.
  • It scales to zero after 5 minutes without requests, so the first request after a quiet period starts a new instance. Anything held only in memory is gone by then.
  • After Early Access, Netlify says you will be able to keep a minimum number of instances running, so requests never wait for a server to start.

Treat memory as temporary. Save anything you cannot lose, such as chat history or job state, to Netlify Database or Blobs.

Cost

Netlify Server is free to use during Early Access. After general availability, Netlify will bill for reserved memory (GB of RAM per hour) and active CPU time (vCPU hours). Netlify says it will announce the rates before general availability, so the cost of an always-on backend is unknown for now.

Functions are unchanged. Apps that only need ordinary request-and-response endpoints can stay on them, and the new option matters for features Functions could not host, such as WebSockets.


End of article