Skip to content

Static sites and SPAs

Deploy a Docusaurus site on Enzonic

Docusaurus builds a static documentation site into build. Deploy serves it from the edge and gives every branch a preview URL, which makes reviewing docs changes in pull requests straightforward.

At a glance

What Enzonic Deploy does with a Docusaurus project when you connect it. You can override any of it in the project settings.

Language
JavaScript / TypeScript
Detected from
@docusaurus/core in dependencies
Build command
docusaurus build
Output
build
Runs as
Static

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

    Always.

Deploy Docusaurus step by step

  1. 1Set url and baseUrl in docusaurus.config to your production domain and "/".
  2. 2Connect the repository and deploy.
  3. 3Add your own docs domain under the project's Domains.
docusaurus.config.ts
export default {
  title: 'My docs',
  url: 'https://docs.example.com',
  baseUrl: '/',
  trailingSlash: false,
  // ...presets, themeConfig
};

Connect a database to Docusaurus

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.

api/feedback.js
import pg from 'pg';

const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });

export async function POST(request) {
  const { page, helpful } = await request.json();
  await pool.query('insert into feedback (page, helpful) values ($1, $2)', [page, !!helpful]);
  return new Response(null, { status: 204 });
}
A "was this page helpful?" endpoint as a function in api/, storing votes in Postgres.

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 engine

Things to know

  • A wrong baseUrl is the usual cause of unstyled pages after deploying; it must match the path the site is served from.

Plan limits that matter here

From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.

Plan limits that matter for Docusaurus
LimitFreePro
Build minutes3,000/mo, 1 concurrent10,000/mo, 3 concurrent
Function memory / timeout1 GB / 300 s4 GB / 1800 s
Function invocations2 M/mo20 M/mo
Bandwidth150 GB/mo2 TB/mo

Compare every plan

Related guides

Ship your Docusaurus project tonight

Connect the repository and the build settings fill themselves in. Free plan, no card.

Start free