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
- Verifies you are in a git repository
- Prompts for server connection details (host, port, user, SSH key)
- Prompts for application settings (name, domain, port, branch)
- Tests SSH connection to your server
- Runs prerequisite checks (Docker, Compose, Git, disk space)
- Creates server directories:
/home/git/<app>.gitand/home/deploy/<app> - Initializes a bare git repository with a
post-receivehook - Sets up Traefik with Let's Encrypt (if domain provided)
- Creates
.lift.jsonand adds it to.gitignore - Adds a
liftgit remote - Optionally installs a pre-push hook for auto-deploy
Options
| Flag | Description | Default |
|---|---|---|
--force | Overwrite existing .lift.json without prompting | |
--app <name> | Application name (non-interactive mode) | |
--host <address> | Server IP or hostname (non-interactive mode) | |
--port <number> | SSH port | 22 |
--user <name> | SSH user | onelift |
--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 container | 3000 |
--branch <name> | Branch to deploy | main |
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