AutoHost logoAutoHost

Command Palette

Search for a command to run...

CLI

Configuration

Configure the AutoHost CLI using environment variables and the agent config file.

Environment Variables

The CLI respects the following environment variables for customizing paths:

VariableDefaultDescription
AUTOHOST_HOME~/.autohostBase directory for AutoHost data and configuration
AUTOHOST_CADDY_DIR/etc/caddy (or ~/.autohost/caddy)Caddy configuration directory
AUTOHOST_COREDNS_DIR~/.autohost/corednsCoreDNS configuration directory

Agent Configuration File

The agent configuration is stored at /etc/autohost/config.yaml with permissions 600:

/etc/autohost/config.yaml
api_url: "https://api.autohst.dev"    # Cloud API URL (HTTP)
ws_url: ""                            # Reserved for future use
grpc_address: "api.autohst.dev:9090"  # Cloud API gRPC address
agent_token: "autohost-node_xxxx"     # Node token (from enrollment)
node_id: "my-server"                  # Unique node identifier
tags: ["production", "web"]           # Optional tags for categorization

Auto-generated

This file is generated automatically by autohost up or autohost enroll link. Manual editing is rarely needed.

Application Data

Installed applications store their Docker Compose files and data under ~/.autohost/apps/<app-name>/.

Custom Commands

Custom command scripts are stored in /var/lib/autohost/commands/. They are owned by root with group autohost (permissions 750) so the agent can execute them.

AutoHost can be configured through configuration files, environment variables, or command-line flags.

Configuration File

The global configuration file is located at ~/.autohost/config.yaml:

~/.autohost/config.yaml
api_url: https://api.autohost.cloud
default_region: us-east-1
output_format: table
telemetry: true

auth:
  token: <your-api-token>
  
defaults:
  timeout: 30s
  retries: 3

Environment Variables

bash
export AUTOHOST_API_URL=https://api.autohost.cloud
export AUTOHOST_TOKEN=your-api-token
export AUTOHOST_REGION=us-east-1
export AUTOHOST_DEBUG=true

Project Configuration

Each project has an autohost.yaml file in its root directory:

autohost.yaml
name: my-project
version: "1.0"
region: us-east-1

services:
  api:
    image: myapp/api:latest
    replicas: 3
    ports:
      - "8080:8080"
    env:
      - DATABASE_URL=${DATABASE_URL}
    resources:
      cpu: 500m
      memory: 512Mi