Skip to content

CLI Commands Reference

This page documents all available FTL CLI commands, their flags, and usage patterns.

Commands Overview

  • ftl setup - Initialize server with required dependencies
  • ftl build - Build and prepare application images
  • ftl deploy - Deploy application to configured servers
  • ftl logs - Retrieve and stream logs from services
  • ftl tunnels - Create SSH tunnels to remote dependencies

Setup

Initializes a server with required dependencies and configurations.

bash
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

bash
ftl setup

Build

Builds and prepares Docker images for deployment.

bash
ftl build [flags]

Flags

FlagDescription
--skip-pushSkip 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

bash
# 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.

bash
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

bash
ftl deploy

Logs

Retrieves logs from deployed services.

bash
ftl logs [service] [flags]

Arguments

ArgumentDescription
service(Optional) Name of the service to fetch logs from

Flags

FlagDescriptionDefault
-f, --followStream logs in real-timefalse
-n, --tail <lines>Number of lines to show from the end100 (if -f is used)

Examples

bash
# 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.

bash
ftl tunnels [flags]

Flags

FlagDescription
-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

bash
# 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.

Released under the MIT License.