CLI Commands Reference
This page documents all available FTL CLI commands, their flags, and usage patterns.
Commands Overview
ftl setup
- Initialize server with required dependenciesftl build
- Build and prepare application imagesftl deploy
- Deploy application to configured serversftl logs
- Retrieve and stream logs from servicesftl tunnels
- Create SSH tunnels to remote dependencies
Setup
Initializes a server with required dependencies and configurations.
ftl setup
Description
The setup command performs the following operations:
- Installs Docker and required system packages
- Configures firewall rules
- Sets up user permissions
- Initializes Docker networks
- Configures registry authentication if using registry-based deployment
Example
ftl setup
Build
Builds and prepares Docker images for deployment.
ftl build [flags]
Flags
Flag | Description |
---|---|
--skip-push | Skip pushing images to registry (only applies to registry-based deployment) |
Description
The build command handles image preparation based on your configuration:
For Direct SSH Transfer (Default)
- Builds images locally
- Uses custom layer caching
- Prepares images for direct transfer
For Registry-based Deployment
- Builds images locally
- Tags images according to configuration
- Pushes to specified registry (unless
--skip-push
is used)
Examples
# Build all services (using direct SSH transfer)
ftl build
# Build all services but skip registry push
ftl build --skip-push
Deploy
Deploys the application to configured servers.
ftl deploy
Description
The deploy command performs these operations:
- Connects to configured servers via SSH
- Pulls/transfers required Docker images
- Performs zero-downtime container replacement
- Configures Nginx reverse proxy
- Manages SSL/TLS certificates via ACME
- Runs health checks
- Cleans up unused resources
Example
ftl deploy
Logs
Retrieves logs from deployed services.
ftl logs [service] [flags]
Arguments
Argument | Description |
---|---|
service | (Optional) Name of the service to fetch logs from |
Flags
Flag | Description | Default |
---|---|---|
-f , --follow | Stream logs in real-time | false |
-n , --tail <lines> | Number of lines to show from the end | 100 (if -f is used) |
Examples
# Fetch logs from all services
ftl logs
# Stream logs from a specific service
ftl logs my-app -f
# Fetch last 50 lines from all services
ftl logs -n 50
# Fetch logs from specific service with custom tail size
ftl logs my-app -n 150
Tunnels
Creates SSH tunnels to remote dependencies.
ftl tunnels [flags]
Flags
Flag | Description |
---|---|
-s , --server <server> | (Optional) Specify server name/index for multi-server setups |
Description
The tunnels command:
- Establishes SSH tunnels to dependency services
- Enables local access to remote services
- Maintains concurrent tunnel connections
- Supports multiple server configurations
Examples
# Establish tunnels to all dependency ports
ftl tunnels
# Connect to specific server
ftl tunnels --server my-project.example.com
Environment Variables
All commands respect environment variables defined in your ftl.yaml
configuration. Variables can be:
- Required:
${VAR_NAME}
- Optional with default:
${VAR_NAME:-default_value}
For detailed information about environment variable handling, see the Environment Variables reference.