Skip to content

Install Legend

Legend runs as a Docker container with minimal resource requirements, and ships with an optional update agent container that powers in-app “Check for Updates”. Choose the installation method that matches your comfort level and infrastructure.

Before installing, ensure you have:

  • Operating system: Linux, macOS, or Windows with Docker support
  • Docker: Version 20.10 or later (the install script handles this on Linux)
  • Docker Compose: Version 2.0 or later (the install script handles this on Linux)
  • Resources: 512MB RAM, 512MB disk space, 1 CPU core
  • Network: Port 3000 available (or choose a different port during setup)
  • Outbound connectivity: Required for license validation

The install script is the recommended method for Linux users. It handles Docker installation, configuration, and deployment automatically.

Terminal window
curl -fsSL https://mylegend.io/install-legend.sh | bash
  1. Check requirements: The script verifies curl, openssl, Docker, and Docker Compose are available. If Docker is missing, it offers to install it.
  2. Interactive configuration: You are prompted for installation directory (default /opt/legend), host port (default 3000), optional domain or FQDN, storage type, and backup settings.
  3. Generate secrets: A secure 64-character session secret is created using openssl rand -hex 32.
  4. Create configuration: The script writes .env and docker-compose.yml files with your settings.
  5. Pull and start: The Legend Docker image is pulled and the container starts.
  6. Deploy the update agent: A small companion container is started alongside Legend to power in-app “Check for Updates”. It communicates with the Legend app over a shared Unix socket.
  7. Health check: The script verifies the container is running and displays the access URL.

During installation, you choose between two storage configurations:

Single directory (recommended for most users): All data, including the SQLite database and YAML catalog, is stored in one location. This is simplest to manage and back up.

Separate storage: The YAML catalog is stored on an NFS or SMB mount, while the SQLite database remains on local SSD. This provides better performance for the database while allowing the catalog to be shared or version controlled.

For automated deployments, set environment variables before running the script:

Terminal window
export LEGEND_INSTALL_DIR=/opt/legend
export LEGEND_HOST_PORT=3000
export LEGEND_DOMAIN=legend.example.com
export LEGEND_STORAGE_TYPE=single
export LEGEND_ENABLE_BACKUPS=true
curl -fsSL https://mylegend.io/install-legend.sh | bash

Available environment variables:

  • LEGEND_INSTALL_DIR: Installation directory (default: /opt/legend)
  • LEGEND_HOST_PORT: Host port to expose (default: 3000)
  • LEGEND_DOMAIN: Optional domain or FQDN
  • LEGEND_STORAGE_TYPE: single or separate (default: single)
  • LEGEND_DATA_DIR: Path for YAML catalog (used with separate storage)
  • LEGEND_DB_DIR: Path for SQLite database (used with separate storage)
  • LEGEND_ENABLE_BACKUPS: Enable automated backups (default: true)
  • LEGEND_UPDATE_AGENT_IMAGE: Update agent image reference (default: legendapp/legend-update-agent:latest)

All installation methods use the same environment variables. Here is what each one does:

Variable Required Default Description
LEGEND_SESSION_SECRET Yes None 64-character hex string for JWT signing and encryption. Generate with openssl rand -hex 32.
LEGEND_PUBLIC_APP_URL No http://localhost:3000 The URL where Legend is accessible. Used for links and redirects.
LEGEND_DATA_DIR No /app/data Path inside the container for YAML catalog, documentation, and branding.
LEGEND_DB_DIR No /app/data Path inside the container for the SQLite database. Separate from LEGEND_DATA_DIR for performance.
LEGEND_DB_FILENAME No legend.db SQLite database filename.
LEGEND_PUBLIC_ENABLE_BACKUPS No true Enable automated daily backups at 2 AM.
LEGEND_BACKUP_MAX_AGE_DAYS No 30 Delete backups older than this many days.
LEGEND_BACKUP_MIN_BACKUPS No 5 Always keep at least this many backups, even if older than max age.
LEGEND_BACKUP_MAX_BACKUPS No 100 Maximum number of backups to retain.
LEGEND_LICENSE_SERVER_URL No https://mylegend.io License server URL. Only change if using a custom license server.
LEGEND_UPDATE_AGENT_IMAGE No legendapp/legend-update-agent:latest Update agent image reference used by the install script. Only change if you mirror the agent image.

After installation, verify Legend is running:

  1. Check the container:

    Terminal window
    docker ps | grep legend

    You should see the Legend container running.

  2. Access the web interface: Open your browser and navigate to http://localhost:3000 (or your configured domain).

  3. Complete the setup wizard: On first visit, you are redirected to the setup wizard where you create the initial administrator account.

To update Legend to the latest version, use the methods below. See Updates and Version Management for the complete update guide, including managed hosting behavior.

If you deployed the update agent (install script does this automatically), use the Check for Updates button in the Admin panel. Legend asks the update agent to pull the latest image, recreate the container preserving your configuration, and verify health. If the update fails, the agent rolls back to the previous image automatically.

Terminal window
cd /opt/legend
docker compose pull
docker compose up -d

Your data is persisted in the mounted volume, so updates do not affect your configuration or entities.