Skip to content

Setup Wizard

The Setup Wizard is a comprehensive one-time configuration system that guides you through connecting PrintStudio to your infrastructure. Access it at http://localhost:4321/setup on first run.

The wizard walks through six steps:

  1. Welcome — overview of what will be configured
  2. Database & Queue — PostgreSQL and Redis connection strings
  3. Printer Discovery — auto-detect or manually add printers
  4. Integrations — n8n, FDM Monster, Obico, InvenTree, OpenClaw
  5. Commerce — Stripe keys and email provider
  6. Review & Launch — generate .env and restart services

No configuration here. The wizard checks your current .env state and shows which services are already configured. If you have a partial .env, previously configured sections will be pre-filled.

Enter your connection strings:

Terminal window
DATABASE_URL=postgresql://postgres:password@localhost:5432/printstudio
REDIS_URL=redis://localhost:6379

The wizard tests both connections before allowing you to proceed. A green checkmark means the service is reachable and accepting connections.

The wizard auto-scans localhost and your local /24 subnet for:

  • OctoPrint instances (port 80, 443, 5000)
  • Moonraker instances (port 7125)
  • Bambu Lab printers (MQTT + LAN API)

Discovered printers appear in a list. Click a printer to test the connection and enter credentials if required.

You can also add printers manually:

FieldDescription
NameDisplay name (e.g., “Voron 2.4 #1”)
Typemoonraker, octoprint, or bambu
URLBase URL including port
API KeyOptional for Moonraker; required for OctoPrint

Configure optional ecosystem services:

IntegrationPurposeRequired?
n8nWorkflow automation (order emails, alerts)No
FDM MonsterPrint farm management UINo
ObicoAI print failure detectionNo
Home AssistantSmart home / sensor integrationNo
InvenTreeParts & inventory managementNo
OpenClawAI agent gateway (WhatsApp/Telegram ops)No

For each integration, the wizard tests the connection URL and API key before saving.

Terminal window
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
# Email — choose one provider
RESEND_API_KEY=re_...
# OR
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=noreply@example.com
SMTP_PASS=...

The wizard shows a summary of all configured services and generates a .env file at the project root. It uses packages/core/src/setup/env-generator.ts internally.

After saving, restart the API for changes to take effect:

Terminal window
# If running with Docker
docker compose restart api
# If running with Bun directly
# Restart your `bun dev` process

The Setup Wizard backend is at apps/print-ops-api/src/routes/setup.ts:

EndpointDescription
GET /api/setup/statusCurrent configuration state
POST /api/setup/test-connectionTest a service connection
POST /api/setup/discoverTrigger network discovery
POST /api/setup/saveSave config and generate .env
GET /api/setup/healthHealth check all configured services

Discovery finds nothing — The scanner only checks localhost and the first 10 IPs in your subnet for speed. Add printers manually if they’re outside that range.

“Connection refused” on Postgres — Ensure Docker containers are running: docker compose ps. The default port is 5432.

Stripe webhook fails — Use the Stripe CLI to forward webhooks locally: stripe listen --forward-to localhost:8787/webhooks/stripe