Skip to main content
SSR adapters allow you to deploy your Astro site with server-side rendering (SSR) to various hosting platforms. Each adapter configures your output to match the requirements of a specific deployment target.

When to Use Adapters

You need an adapter when:
  • Using output: 'server' or output: 'hybrid' mode
  • Implementing on-demand rendering for dynamic routes
  • Using server endpoints and API routes
  • Deploying to a platform that requires a specific output format
For static sites (output: 'static'), you don’t need an adapter.

Available Adapters

Node

Deploy to any Node.js host

Vercel

Deploy to Vercel with serverless or edge functions

Netlify

Deploy to Netlify with serverless functions

Cloudflare

Deploy to Cloudflare Pages or Workers

Deno

Deploy to Deno Deploy

Node

The Node adapter allows you to deploy your SSR site to any Node.js environment.

Installation

Or manually:

Configuration

astro.config.mjs

Options

Standalone Mode

Creates a server that starts when the entry module is run:
astro.config.mjs
Start the server:

Middleware Mode

Exports the handler for use with your own HTTP server:
astro.config.mjs
Use with your own server:
server.mjs

Deployment

Build your project and start the server:
Or with a custom port:

Vercel

The Vercel adapter deploys your site to Vercel with serverless or edge functions.

Installation

Configuration

astro.config.mjs

Options

Edge Functions

Use Vercel Edge Functions instead of serverless:
astro.config.mjs

Per-Route Configuration

Set configuration per route using route export:
src/pages/api/cached.astro

Image Optimization

Enable Vercel’s Image Optimization:
astro.config.mjs

Incremental Static Regeneration (ISR)

astro.config.mjs

Netlify

The Netlify adapter deploys your site to Netlify with serverless functions.

Installation

Configuration

astro.config.mjs

Options

Edge Functions

Use Netlify Edge Functions:
astro.config.mjs

Distributed Persistent Rendering (DPR)

Cache rendered pages at the edge:
astro.config.mjs
Set cache headers per page:
src/pages/products/[id].astro

Image CDN

Netlify automatically optimizes images:

Cloudflare

The Cloudflare adapter deploys your site to Cloudflare Pages or Workers.

Installation

Configuration

astro.config.mjs

Options

Access Runtime APIs

Access Cloudflare runtime in your pages:
src/pages/api/data.json.ts

Wrangler Configuration

Configure Cloudflare resources in wrangler.toml:
wrangler.toml

Cloudflare Pages Functions

For advanced use cases, use directory mode:
astro.config.mjs
Add custom functions in functions/ directory.

Deno

The Deno adapter allows you to deploy to Deno Deploy.

Installation

Configuration

astro.config.mjs

Deployment

Deploy using the Deno CLI:
Or connect your GitHub repository to Deno Deploy for automatic deployments.

Choosing Output Mode

Adapters work with different output modes:

Server Mode

All pages rendered on-demand:
astro.config.mjs

Hybrid Mode

Pages are static by default, opt-in to SSR:
astro.config.mjs
Opt-in to SSR per page:
src/pages/dynamic.astro

Static Mode

All pages pre-rendered (no adapter needed):
astro.config.mjs

Next Steps

Server Endpoints

Create API endpoints with server-side logic

On-Demand Rendering

Learn about server-side rendering in Astro