Skip to content

Self-hosting

By default, lukurauha shelf runs on Node.js with SQLite (data.db) and local disk storage (uploads/). A single server process is all that is required.

Check these two points before creating the first account:

  • Passkeys are bound to your domain. Finalize your public HTTPS domain before creating your first passkey—changing the domain later prevents existing passkeys from signing in.
  • If you plan to invite others, review Inviting people and update /about and /privacy (see Customizing) first.

Assuming your scaffolded project is on a server with Node.js 24+ and pnpm:

  1. Install dependencies and build the production bundle:

    Terminal window
    pnpm install
    pnpm build
  2. When running behind a TLS-terminating reverse proxy, set EMDASH_SITE_URL so EmDash generates redirects and links with the public origin:

    Terminal window
    export EMDASH_SITE_URL="https://example.com"
  3. Start the built server:

    Terminal window
    pnpm start
  4. Open /_emdash/admin on your public URL and create the first administrator account.

Once you can sign in on the home page and open a book, deployment is complete. See the EmDash Node.js deployment guide for reverse-proxy and process-manager details.

In the default setup, persistent state lives in two places:

Data Path
Accounts, stored books, CMS pages data.db (SQLite)
Files uploaded through the EmDash admin uploads/

Back up or migrate data.db and uploads/ together.

EmDash also supports Cloudflare Workers with D1 and R2. Because @lukurauha/shelf/plugin is a native EmDash plugin, no separate sandboxRunner configuration is needed.

Replace @astrojs/node with @astrojs/cloudflare, and replace sqlite() / local() with d1() / r2() from @emdash-cms/cloudflare in astro.config.mjs:

astro.config.mjs
import node from "@astrojs/node";
import cloudflare from "@astrojs/cloudflare";
import { d1, r2 } from "@emdash-cms/cloudflare";
import lukurauhaShelf, { libraryPlugin } from "@lukurauha/shelf";
export default defineConfig({
output: "server",
// Keep trailingSlash, react(), and lukurauhaShelf() as configured
adapter: node({ mode: "standalone" }),
adapter: cloudflare(),
integrations: [
emdash({
database: sqlite({ url: "file:./data.db" }),
storage: local({
directory: "./uploads",
baseUrl: "/_emdash/api/media/file",
}),
database: d1({ binding: "DB" }),
storage: r2({ binding: "MEDIA" }),
plugins: [libraryPlugin()],
toolbar: false,
}),
lukurauhaShelf({ customCss: ["./src/styles/custom.css"] }),
],
});

Remove the unused sqlite and local imports.

Follow the EmDash Cloudflare deployment guide to configure your D1 and R2 bindings.