lift init

Initialize Lift for your project with an interactive setup wizard that configures SSH, server, Traefik, and git remote.

lift init

Initialize Lift for your current project. Runs an interactive setup wizard that configures SSH, tests the server connection, creates a bare git repository, sets up deploy directories, installs Traefik for HTTPS, and adds a git remote.

What it does

  1. Verifies you are in a git repository
  2. Prompts for server connection details (host, port, user, SSH key)
  3. Prompts for application settings (name, domain, port, branch)
  4. Tests SSH connection to your server
  5. Runs prerequisite checks (Docker, Compose, Git, disk space)
  6. Creates server directories: /home/git/<app>.git and /home/deploy/<app>
  7. Initializes a bare git repository with a post-receive hook
  8. Sets up Traefik with Let's Encrypt (if domain provided)
  9. Creates .lift.json and adds it to .gitignore
  10. Adds a lift git remote
  11. Optionally installs a pre-push hook for auto-deploy

Options

FlagDescriptionDefault
--forceOverwrite existing .lift.json without prompting
--app <name>Application name (non-interactive mode)
--host <address>Server IP or hostname (non-interactive mode)
--port <number>SSH port22
--user <name>SSH useronelift
--key <path>SSH private key path
--domain <domain>Domain for HTTPS (enables Traefik with Let's Encrypt)
--acme-email <email>Email for SSL certificate (Let's Encrypt). Required with --domain in non-interactive mode to install Traefik
--app-port <number>Application port inside container3000
--branch <name>Branch to deploymain

Non-Interactive Mode

Use --output jsonl with flags for CI/CD or scripted setups:

# Minimal setup (no domain)
lift init --output jsonl --app my-api --host 1.2.3.4 --key ~/.ssh/id_rsa

# With domain + SSL (installs Traefik with Let's Encrypt)
lift init --output jsonl --app my-api --host 1.2.3.4 --key ~/.ssh/id_rsa --domain api.example.com --acme-email [email protected]

# Custom user, port and branch
lift init --output jsonl --app my-api --host 1.2.3.4 --user root --app-port 8080 --branch production

Interactive Example

$ lift init
? App name: my-api
? Server IP or hostname: 168.119.60.42
? SSH port: 22
? SSH user: onelift
? Domain (optional): api.example.com
? App port: 3000
? Using SSH key: ~/.ssh/id_ed25519
? Docker network for reverse proxy: onelift
? Email for SSL certificate: [email protected]
? Branch to deploy: main
 Connected to server
 Docker 27.1.1 ..... ok
 Docker Compose v2.29 ..... ok
 Git 2.43.0 ..... ok
 Server setup complete
 Traefik with Let's Encrypt ready
✓ Created .lift.json
✓ Added .lift.json to .gitignore
✓ Added git remote "lift"
✓ Initialization complete!
Push to deploy: git push lift main
  • lift push -- Deploy your application after init
  • lift hook -- Auto-deploy on every git push
  • lift env -- Set environment variables before first deploy