Static sites and SPAs
Deploy a Astro site on Enzonic
Astro builds a static site unless you add a server adapter. Deploy serves dist as files, and when @astrojs/node is installed it starts dist/server/entry.mjs as a Node.js server on port 4321 for on-demand rendered pages and API endpoints.
At a glance
What Enzonic Deploy does with a Astro project when you connect it. You can override any of it in the project settings.
- Language
- JavaScript / TypeScript
- Detected from
- astro in dependencies; @astrojs/node switches to server mode
- Build command
- astro build
- Output
- dist
- Runs as
- Static or Server
Dependencies install with the package manager your lockfile names: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile, or bun install --frozen-lockfile. Node.js 18, 20, 22 and 24 are available. Deploy reads engines.node in package.json, then .nvmrc or .node-version, and uses Node.js 22 when nothing pins a version.
How it runs
Static
The default output: dist is served from the edge.
Server
With @astrojs/node in standalone mode: dist/server/entry.mjs runs as a server, dist/client holds the assets.
Deploy Astro step by step
- 1For a static site, nothing to configure: connect the repository and deploy.
- 2For server rendering, run npx astro add node, keep mode: 'standalone', and deploy.
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
export default defineConfig({
output: 'server',
adapter: node({ mode: 'standalone' }),
});Connect a database to Astro
Create a database on Enzonic Databases (or from the project's settings) and its connection string is added to the project's environment variables. This example uses PostgreSQL.
import postgres from 'postgres';
const sql = postgres(import.meta.env.DATABASE_URL ?? process.env.DATABASE_URL);
export const prerender = false;
export async function GET() {
const posts = await sql`select id, title from posts limit 20`;
return new Response(JSON.stringify(posts), { headers: { 'content-type': 'application/json' } });
}Postgres projects get two variables: DATABASE_URL through the connection pooler for the app, and DATABASE_URL_UNPOOLED for migrations.
PostgreSQL on Enzonic DatabasesEvery database engineThings to know
- The node adapter in middleware mode does not start a server by itself; use standalone mode.
- A custom outDir is respected when it is set in the project's build settings.
Plan limits that matter here
From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.
| Limit | Free | Pro |
|---|---|---|
| Build minutes | 3,000/mo, 1 concurrent | 10,000/mo, 3 concurrent |
| Servers | 1 instance, 512 MB, sleeps after 15 min idle | 3 always-on, 2 GB |
| Function memory / timeout | 1 GB / 300 s | 4 GB / 1800 s |
| Function invocations | 2 M/mo | 20 M/mo |
| Bandwidth | 150 GB/mo | 2 TB/mo |
Related guides
- Deploy a SvelteKit appSvelteKit with adapter-node as a server, or adapter-static as a static site.
- Deploy a Eleventy siteEleventy (11ty) sites built into _site.
- Deploy a Docusaurus siteDocumentation sites from docusaurus build, with previews for every docs branch.
Ship your Astro project tonight
Connect the repository and the build settings fill themselves in. Free plan, no card.