Posts tagged "Server"

Subscribe to feed
  • Netlify Server is now available in Early Access

    Netlify Server lets you run your application’s backend as a long-lived Node.js server. Netlify provisions it, scales it with demand and scales it down to zero when nothing is using it.

    Whereas, functions handle one request per instance and finish when they respond, some backends need more. Netlify Server keeps running between requests so that it can:

    • Handle many requests at once in a single instance.
    • Keep warm database connection pools and in-memory caches.
    • Hold WebSocket and Server-Sent Events connections open, for things like live chat and real-time collaboration.
    • Run an existing Express, Hono, Fastify or Koa app as-is, without additional adapters.

    A server is a single file at netlify/server/index.ts. Here’s a simple way to get started without any framework, with the same signature as a Netlify function:

    import type { Context } from '@netlify/server';
    export default async (req: Request, context: Context) => {
    return Response.json({ message: `Hello from ${context.geo.city}` });
    };

    Every deploy, including branch deploys and Deploy Previews, runs its own version of your server. The server can use other platform primitives, such as Netlify Database, Netlify Blobs and the AI Gateway, with no setup.

    Full-stack frameworks such as Next.js, Astro and Nuxt don’t run on Netlify Server yet, so for now we recommend using a server in projects that don’t use one of these frameworks.

    Early Access

    Netlify Server is available on credit-based plans and on Enterprise plans with credits enabled. Its APIs and behavior might change during Early Access.

    In Agent Runners, we’re releasing Netlify Server gradually over the coming days, so your agent runs might not use it right away.

    Limits

    These are the main limits during Early Access:

    • A server scales up to 3 instances, or 1 instance on credit-based Free and Personal plans.
    • An instance always scales to zero after 5 minutes without requests. After Early Access, you’ll be able to keep a minimum number of instances running, so infrequent requests won’t need to wait for your server to start.

    The limits page has the full list.

    Pricing

    Netlify Server is free to use during Early Access. When it reaches General Availability, usage will be charged in credits based on two meters: reserved memory (in GB-hours) and active CPU time (in vCPU-hours). We’ll announce the cost in credits before then. If your usage during Early Access suggests you’ll need to upgrade your plan or buy more credits, we’ll let you know.

    Other metered features in your project are billed as usual, and every request your server handles counts toward the web requests meter. Learn more about pricing.

    To get started, read the Netlify Server docs and follow the guide to create your first server.

    Permalink to Netlify Server is now available in Early Access