Skip to main content

Primary Command

lightfold deploy

Full deployment orchestration (recommended for most users).
Flags:
  • --target - Deploy to named target
  • --builder - Force builder choice (native, nixpacks, dockerfile)
  • --force - Rerun all steps regardless of state
  • --dry-run - Preview execution plan without running
What it does:
  1. Detects framework
  2. Creates infrastructure (if needed)
  3. Configures server (if needed)
  4. Deploys code changes

Advanced Commands

lightfold create

Create infrastructure only.
Flags:
  • --target - Target name (required)
  • --provider - Provider choice (digitalocean, vultr, hetzner, byos)
  • --region - Cloud provider region (for auto-provision)
  • --size - Server size (for auto-provision)
  • --ip - Server IP (for BYOS)
  • --user - SSH username (for BYOS)
  • --ssh-key - SSH key path (for BYOS)

lightfold configure

Configure server only.
Flags:
  • --target - Target name
  • --force - Reconfigure even if already configured
What it does:
  • Installs runtime dependencies
  • Sets up systemd services
  • Configures nginx
  • Creates deployment directory structure

lightfold push

Deploy code changes only.
Flags:
  • --target - Target name
  • --force - Deploy even if commit unchanged
What it does:
  • Checks git commit changes
  • Creates timestamped release
  • Uploads and builds code
  • Blue/green deployment with health checks

Management Commands

lightfold status

View deployment status and server health.
Flags:
  • --target - Target name
  • --json - Output in JSON format

lightfold logs

View application logs.
Flags:
  • --target - Target name
  • --tail - Stream logs in real-time
  • --lines - Number of lines to show (default: 100)

lightfold rollback

Rollback to previous release.
Flags:
  • --target - Target name
  • --force - Skip confirmation prompt

lightfold sync

Sync local state/config with actual server state (drift recovery).
Flags:
  • --target - Target name
Use cases:
  • Local state files corrupted or deleted
  • Server IP changed
  • Recovering from bad state
  • After manual server changes

lightfold ssh

SSH into deployment target.
Flags:
  • --target - Target name (required)

lightfold destroy

Destroy VM and remove local configuration.
Flags:
  • --target - Target name (required)
Warning: This will permanently delete your server and all data.

Configuration Commands

lightfold config

Manage targets and API tokens.

lightfold domain

Manage custom domains and SSL.
Flags:
  • --domain - Domain name (for add command)
  • --target - Target name

Utility Commands

lightfold detect

Detect framework only (no deployment).
Flags:
  • --json - Output in JSON format

lightfold keygen

Generate SSH keypair.

Invocation Patterns

All commands support three invocation patterns:
  1. Current directory (default):
  2. Specific path:
  3. Named target: