# Self-Hosting LearnHouse

> Self-host LearnHouse on your own server with the LearnHouse CLI. Install it with one command, then configure, update, back up and monitor it.

LearnHouse can be self-hosted on your own infrastructure using the **LearnHouse CLI**. The CLI handles everything from initial setup to ongoing maintenance, including Docker Compose generation, environment file management, service orchestration, backups, and health checks.

## Quick Start

Make sure you have **Docker** with the Compose v2 plugin and **Node.js 22+** installed (see [Requirements](https://docs.learnhouse.app/self-hosting/installation/requirements)), then run:

```bash
npx learnhouse@latest setup
```

The interactive setup wizard walks you through domain configuration, database settings, admin credentials, and optional features. At the end it offers to start LearnHouse and waits until it is ready. If you skipped that, start it with:

```bash
npx learnhouse start
```

LearnHouse is available at **http://localhost** (or your configured domain). Log in with the admin credentials you provided during setup. [Quick Install](https://docs.learnhouse.app/self-hosting/installation/quick-install) covers the one-line installers, non-interactive setup and checks.

> The CLI generates `docker-compose.yml`, `.env`, and reverse proxy configuration for you. You do not need to write or maintain these files manually.

### Verify the installation

```bash
npx learnhouse doctor
```

### Common management commands

```bash
npx learnhouse stop       # Stop all services
npx learnhouse start      # Start all services
npx learnhouse logs       # Stream container logs
npx learnhouse config     # View current configuration
npx learnhouse backup     # Back up the database, .env and uploaded content
npx learnhouse update     # Update to the latest version
npx learnhouse doctor     # Diagnose issues
```

## Frequently asked questions

### Can I self-host LearnHouse for free?

Yes. LearnHouse is an open-source LMS under the AGPL-3.0 license. The Community Edition is free to self-host;
Enterprise features such as SSO, SCORM and LTI need an [Enterprise Edition](https://docs.learnhouse.app/enterprise) license.

### What do I need to self-host LearnHouse?

A server with Docker and Compose v2, at least 2 GB of RAM (4 GB recommended), 10 GB of disk and one CPU core. See
[Requirements](https://docs.learnhouse.app/self-hosting/installation/requirements).

### How do I install it?

Run `npx learnhouse@latest setup` on the server. The setup wizard writes the configuration and starts LearnHouse with
Docker. See [Quick Install](https://docs.learnhouse.app/self-hosting/installation/quick-install).

### Can I build on a self-hosted instance with the API and React components?

Yes. The REST API, `@learnhouse/sdk`, `@learnhouse/react` and `@learnhouse/vue` work with self-hosted instances the
same way they work with LearnHouse Cloud. Point them at your own domain. See [Developers](https://docs.learnhouse.app/developers).

## Documentation

### [Installation](https://docs.learnhouse.app/self-hosting/installation)

System requirements and quick install steps. Every CLI command and flag is in the [CLI reference](https://docs.learnhouse.app/cli/commands).

### [Configuration](https://docs.learnhouse.app/self-hosting/configuration)

Environment variables, AI features, email delivery, content storage, and SSL/domain setup.

### [Maintenance](https://docs.learnhouse.app/self-hosting/maintenance)

Updates, backups, monitoring, and troubleshooting guides.
