logo
Install and configureInstallation
Install and configure

Installation

How the SlugBase monorepo is organized, what to install, and how production builds map to the running server.

What you need

  • Git and Node.js (Dockerfile and CI use Node 20).
  • Network access to run npm install at the repository root (npm workspaces pull backend, frontend, packages/core, and apps/selfhosted).

This repository is an npm workspace monorepo. Day-to-day commands run from the root package.json; production serving for self-hosting uses the slugbase-selfhosted workspace via npm run start.

Steps

Clone the repository

git clone https://github.com/mdg-labs/slugbase.git
cd slugbase

Install workspace dependencies

npm install

This installs dependencies for all workspaces declared in the root package.json.

Choose how you will run SlugBase

  • Local development: npm run dev runs the backend and Vite frontend together (see Quick start).
  • Production on bare metal or a VM: npm run build then npm run start after you configure environment variables (see Configuration).
  • Production in Docker: build or use a container from the root Dockerfile (see Docker and Docker Compose).

Build for production (when not using Docker)

npm run build

The root build script builds the backend, frontend, core embed assets, and copies outputs needed by the self-hosted app.

Start production server

npm run start

This runs npm run start in the slugbase-selfhosted workspace—the combined API and static UI for self-hosted deployments.

Verify

  • After npm run build, the tree under apps/selfhosted and packaged public assets should exist without build errors.
  • After npm run start, GET /api/health on your server port should return success (default port 5000 unless you set PORT).

A backend-only image is also available as Dockerfile.backend for API-only deployments (for example serverless or split frontends). Most self-hosters use the full Dockerfile that bundles the built SPA under public.

Troubleshooting