Skip to content

Installing from source

If you already run Node applications and manage your own PostgreSQL, this is the least surprising way to install Plugboard. One launcher script handles setup, migrations and starting every service.

  • Node.js 20.9 or later
  • pnpm (npm i -g pnpm, or corepack enable)
  • PostgreSQL 14 or later, reachable by connection string

Redis is optional and only used by the legacy people-sync and daily-digest worker. SLA checks, backups, reports and monitors all run in-process.

Terminal window
pnpm install
node scripts/plugboard.mjs setup

setup writes a .env containing strong random values for JWT_SECRET, SECRETS_MASTER_KEY and the rest. Open it and point the database at your server:

Terminal window
DATABASE_URL="postgresql://user:pass@localhost:5432/plugboard?schema=public"

Then start it:

Terminal window
node scripts/plugboard.mjs start

The launcher builds on the first run, applies pending migrations with prisma migrate deploy, and starts the API and the web process in one foreground process. Ctrl+C stops everything.

Open http://localhost:3000.

Same thing, less typing:

  • Windows: Plugboard.cmd setup once, then double-click Plugboard.cmd.
  • macOS and Linux: ./plugboard.sh setup once, then ./plugboard.sh.
  • Either: pnpm setup then pnpm start.

plugboard below means node scripts/plugboard.mjs.

CommandWhat it does
plugboard setupCreate .env with generated JWT_SECRET, SECRETS_MASTER_KEY and other secrets
plugboard migrateApply pending database migrations
plugboard seedLoad the fictional demo data. Optional, for evaluation
plugboard startMigrate, then start the API and web
FlagEffect
--skip-migrateDo not run migrations. Useful when a DBA applies them separately
--no-buildSkip the build. Use in production where the build already happened
--workerAlso start the Redis-backed worker

A production service definition normally uses start --no-build, so a restart is fast and cannot fail on a compilation error.

If you want PostgreSQL, Redis and MinIO without installing them:

Terminal window
corepack enable && corepack prepare [email protected] --activate
pnpm install
cp .env.example .env
pnpm infra:up # Postgres + Redis + MinIO, needs Docker
pnpm db:migrate && pnpm db:seed
pnpm dev # api :4000 · web :3000 · worker

pnpm dev runs everything with hot reload. This is the development setup, not a production one.

Run it under a process manager so it restarts on boot and after a crash.

systemd:

[Unit]
Description=Plugboard
After=network.target postgresql.service
[Service]
WorkingDirectory=/opt/plugboard
ExecStart=/usr/bin/node scripts/plugboard.mjs start --no-build
EnvironmentFile=/opt/plugboard/.env
Restart=always
RestartSec=5
User=plugboard
[Install]
WantedBy=multi-user.target

Windows: run Plugboard.cmd from Task Scheduler at system startup, or wrap it with NSSM. The service install page explains why a plain Node process cannot be a Windows Service and what to do about it.

pm2:

Terminal window
pm2 start scripts/plugboard.mjs --name plugboard -- start --no-build
pm2 save
pm2 startup
Terminal window
git fetch --tags
git checkout v0.2.0
pnpm install
node scripts/plugboard.mjs migrate

Then restart the service. Read the changelog first: releases marked with a migration warning change the schema and deserve a quiet window and a fresh backup.

Take a database dump before migrating. Migrations are forward-only, so there is no automatic way back.

The launcher serves plain HTTP on localhost. For anything a staff member reaches, terminate TLS at a reverse proxy or point the API at a certificate directly. See HTTPS and certificates.

Set both origins to the address people actually type:

Terminal window
API_URL="https://helpdesk.yourschool.org"
WEB_URL="https://helpdesk.yourschool.org"

WEB_URL is used in emailed tracking links, so it has to be the real one.

SECRETS_MASTER_KEY encrypts connector credentials and backups. Store a copy somewhere separate from the server.

The application takes its own encrypted, scheduled backups from Admin, Backups. Getting them off the machine is yours. See backups and restore.