Skip to Content
Edit on GitHub

CLI Reference

Complete reference for all LearnHouse CLI commands. The CLI is published as learnhouse on npm and is typically run via npx learnhouse@latest.

Setup and Configuration

learnhouse setup

Run the interactive setup wizard. This command generates docker-compose.yml, .env, learnhouse.config.json, and nginx or Caddy configuration files based on your choices.

learnhouse setup

Flags: --ci, --name, --domain, --port, --admin-email, --admin-password, --channel <stable|dev>, --no-start.

You can re-run this command at any time to reconfigure your instance. Existing configuration will be preserved as defaults in the prompts.

learnhouse config

View the current configuration.

learnhouse config

learnhouse env

Interactively edit environment variables in your .env file (Domain & Hosting, Database & Redis, Security, AI, Email (Resend), S3 Storage, OAuth).

learnhouse env

The env command edits a curated set of variables only. SMTP credentials (LEARNHOUSE_SMTP_*) are not editable through this command — edit .env directly if you need them.

Service Management

learnhouse start

Start all LearnHouse services. On first run, this pulls the required Docker images before starting containers.

learnhouse start

learnhouse stop

Stop all running LearnHouse services. Data is preserved in Docker volumes.

learnhouse stop

learnhouse status

Show the status of each LearnHouse service.

learnhouse status

learnhouse logs

Stream container logs for all services.

learnhouse logs

learnhouse update

Update LearnHouse to the latest release or a specific version. Pulls the target image, rewrites docker-compose.yml, restarts services, and prompts for database migrations.

learnhouse update
learnhouse update --version 1.4.2
learnhouse update --migrate       # auto-apply migrations
learnhouse update --no-migrate    # skip migrations

learnhouse dev

Start a full development environment (PostgreSQL + Redis in Docker, API + web + collab run locally).

learnhouse dev

Diagnostics

learnhouse doctor

Run diagnostics on your LearnHouse installation. Checks Docker availability, container health, port conflicts, DNS resolution, and disk space.

learnhouse doctor

learnhouse health

Run the CLI’s health checks (PostgreSQL connection, Redis ping, HTTP health endpoint, disk, resources).

learnhouse health

learnhouse shell

Open an interactive shell inside a running container for debugging.

learnhouse shell

Infrastructure

learnhouse deployments

Manage deployments and scale memory limits for your LearnHouse containers.

learnhouse deployments

Backup and Restore

learnhouse backup

Create a PostgreSQL dump archive of your instance’s database (plus a copy of .env). Archives are written to <installDir>/backups/.

learnhouse backup

learnhouse restore

Restore a database from a backup archive.

learnhouse restore <path/to/learnhouse-backup-<timestamp>.tar.gz>

Command Summary

CommandDescription
learnhouse setupInteractive setup wizard, generates docker-compose.yml, .env, and config files
learnhouse startStart all services
learnhouse stopStop all services
learnhouse updateUpdate to latest or a specific version
learnhouse statusShow service status
learnhouse healthRun health checks
learnhouse logsStream container logs
learnhouse configView current configuration
learnhouse envEdit environment variables
learnhouse backupCreate a database backup archive
learnhouse restoreRestore the database from an archive
learnhouse doctorDiagnose Docker, containers, ports, DNS, and disk
learnhouse shellOpen a shell in a running container
learnhouse deploymentsManage deployments and memory limits
learnhouse devStart full development environment