Skip to main content
The temporal-server render-config command renders the server configuration template with environment variable substitution and outputs the final configuration.

Synopsis

temporal-server render-config [flags]

Description

Renders the server configuration by:
  1. Loading the configuration from files or embedded defaults
  2. Applying environment variable substitution
  3. Rendering the final configuration as YAML
  4. Outputting to stdout
This command is useful for:
  • Debugging configuration issues
  • Verifying environment variable substitution
  • Understanding the final merged configuration
  • Generating configuration for documentation

Options

—config, -c

Config directory path relative to root (deprecated).
  • Type: String
  • Default: config
  • Environment variable: TEMPORAL_CONFIG_DIR

—env, -e

Runtime environment for configuration selection (deprecated).
  • Type: String
  • Default: development
  • Environment variable: TEMPORAL_ENVIRONMENT

—zone, —az

Availability zone for configuration (deprecated).
  • Type: String
  • Default: None
  • Environment variable: TEMPORAL_AVAILABILITY_ZONE

—root, -r

Root directory of execution environment (deprecated).
  • Type: String
  • Default: .
  • Environment variable: TEMPORAL_ROOT
Note: These flags are deprecated. For new deployments, use --config-file with the start command.

Output

The command outputs the rendered configuration in YAML format to stdout.

Examples

Render Default Configuration

temporal-server render-config
Output:
global:
  membership:
    maxJoinDuration: 10s
  pprof:
    port: 0
  metrics:
    prometheus:
      listenAddress: "127.0.0.1:8000"
persistence:
  defaultStore: default
  visibilityStore: visibility
  numHistoryShards: 4
  datastores:
    default:
      sql:
        pluginName: sqlite
        databaseName: default.db
        connectAddr: localhost
        connectProtocol: tcp
        connectAttributes:
          mode: memory
          cache: shared
# ... (more configuration)

Render with Environment Variables

export DB_HOST=postgres.example.com
export DB_PORT=5432
export DB_NAME=temporal_prod

temporal-server render-config --env production

Save Rendered Config to File

temporal-server render-config > /tmp/temporal-config-rendered.yaml

Verify Configuration Changes

# Before making changes
temporal-server render-config > /tmp/before.yaml

# Make configuration changes
# ...

# After changes
temporal-server render-config > /tmp/after.yaml

# Compare
diff /tmp/before.yaml /tmp/after.yaml

Extract Specific Configuration

Using yq to extract specific sections:
# Get persistence configuration
temporal-server render-config | yq '.persistence'

# Get frontend service config
temporal-server render-config | yq '.services.frontend'

# Get database connection string
temporal-server render-config | yq '.persistence.datastores.default.sql.connectAddr'

Use Cases

Debugging Configuration

Verify that environment variables are substituted correctly:
export DB_PASSWORD=secret123
temporal-server render-config | grep -A 5 "password:"

Configuration Documentation

Generate documentation showing actual deployed configuration:
# Production
temporal-server render-config --env production > docs/config-production.yaml

# Staging
temporal-server render-config --env staging > docs/config-staging.yaml

Validate Before Deploy

Check configuration before starting the server:
# Render and validate structure
temporal-server render-config | yq '.' > /dev/null

if [ $? -eq 0 ]; then
  echo "Configuration is valid YAML"
else
  echo "Configuration has syntax errors"
  exit 1
fi

Template Verification

Verify template syntax without starting the server:
temporal-server render-config 2>&1 | grep -i error

if [ $? -eq 0 ]; then
  echo "Template errors found"
  exit 1
fi

Configuration Merging

When using the legacy config directory approach, configurations are merged in this order:
  1. base.yaml - Base configuration
  2. {environment}.yaml - Environment-specific config
  3. {environment}_{zone}.yaml - Zone-specific overrides
  4. Environment variables
# Example directory structure
config/
├── base.yaml
├── development.yaml
├── production.yaml
└── production_us-east-1.yaml

# Renders: base.yaml + production.yaml + production_us-east-1.yaml
temporal-server render-config --env production --zone us-east-1

Sensitive Data Handling

Warning: The rendered configuration may contain sensitive data like passwords and API keys. Take precautions:
# DON'T: Write to shared location
temporal-server render-config > /tmp/config.yaml  # Bad: /tmp is world-readable

# DO: Use secure temporary file
temporal-server render-config > ~/config.yaml
chmod 600 ~/config.yaml

# DO: Redact sensitive fields
temporal-server render-config | \
  yq '.persistence.datastores.default.sql.password = "[REDACTED]"'

Troubleshooting

Template Syntax Error

$ temporal-server render-config
Unable to load configuration: template: base.yaml:10: unexpected "}" in operand
Fix template syntax in the configuration files.

Environment Variable Not Substituted

# Config file has:
connectAddr: "${DB_HOST}:${DB_PORT}"

# But renders as:
connectAddr: ":5432"
Ensure the environment variable is exported:
export DB_HOST=localhost
temporal-server render-config | grep connectAddr

Missing Configuration File

$ temporal-server render-config --env production
Unable to load configuration: open config/production.yaml: no such file or directory
Verify the configuration file exists at the expected path.

Invalid YAML Output

$ temporal-server render-config | yq '.'
yaml: line 42: mapping values are not allowed in this context
Check for template errors or invalid YAML in source files.

CI/CD Integration

Verify Configuration in CI

# .github/workflows/verify-config.yml
name: Verify Configuration

on: [push, pull_request]

jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup Temporal
        run: |
          curl -sSf https://temporal.download/cli.sh | sh
          
      - name: Render Development Config
        run: |
          temporal-server render-config --env development > /tmp/dev-config.yaml
          yq '.' /tmp/dev-config.yaml > /dev/null
          
      - name: Render Production Config  
        env:
          DB_HOST: ${{ secrets.PROD_DB_HOST }}
          DB_PASSWORD: ${{ secrets.PROD_DB_PASSWORD }}
        run: |
          temporal-server render-config --env production > /tmp/prod-config.yaml
          yq '.' /tmp/prod-config.yaml > /dev/null

Best Practices

  1. Never Commit Rendered Config: Add *-rendered.yaml to .gitignore
  2. Redact Secrets: Remove sensitive data before sharing rendered config
  3. Use in Testing: Render config in tests to verify template correctness
  4. Document Differences: Document why different environments have different configs
  5. Version Templates: Keep configuration templates in version control

See Also

Build docs developers (and LLMs) love