LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • wheels generate app
        • wheels generate app-wizard
        • wheels generate controller
        • wheels generate model
        • wheels generate view
        • wheels generate property
        • wheels generate route
        • wheels generate resource
        • wheels generate api-resource
        • wheels generate frontend
        • wheels generate test
        • wheels generate snippets
        • wheels scaffold
      • Database Commands
        • wheels dbmigrate info
        • wheels dbmigrate latest
        • wheels dbmigrate up
        • wheels dbmigrate down
        • wheels dbmigrate reset
        • wheels dbmigrate exec
        • wheels dbmigrate create blank
        • wheels dbmigrate create table
        • wheels dbmigrate create column
        • wheels dbmigrate remove table
        • wheels db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • wheels deploy
        • wheels deploy audit
        • wheels deploy exec
        • wheels deploy hooks
        • wheels deploy init
        • wheels deploy lock
        • wheels deploy logs
        • wheels deploy proxy
        • wheels deploy push
        • wheels deploy rollback
        • wheels deploy secrets
        • wheels deploy setup
        • wheels deploy status
        • wheels deploy stop
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Synopsis
  • Description
  • Options
  • Examples
  • Basic setup
  • AWS setup with options
  • Docker setup
  • Preview setup
  • Setup Process
  • Provider-Specific Setup
  • AWS Setup
  • Docker Setup
  • Traditional Server Setup
  • Configuration Files
  • Environment configuration
  • Database configuration
  • Use Cases
  • Multi-environment setup
  • High-availability setup
  • Development environment
  • Post-Setup Tasks
  • Security Considerations
  • Monitoring Setup
  • Best Practices
  • Troubleshooting
  • Setup failures
  • Permission issues
  • Network issues
  • See Also

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Deployment Commands

wheels deploy setup

Setup and configure deployment environment for your CFWheels application.

Synopsis

wheels deploy setup [environment] [options]

Description

The wheels deploy setup command initializes and configures deployment environments for your CFWheels application. It sets up necessary infrastructure, configurations, and dependencies required for successful deployments.

Options

  • --provider - Deployment provider (aws, azure, gcp, docker, traditional)

  • --region - Cloud region for deployment

  • --instance-type - Server instance type/size

  • --database - Database configuration (type, size, replicas)

  • --ssl - Enable SSL/TLS configuration

  • --domain - Domain name for the application

  • --monitoring - Enable monitoring and alerting

  • --backup - Configure automated backups

  • --scaling - Auto-scaling configuration

  • --dry-run - Preview setup without making changes

Examples

Basic setup

wheels deploy setup production

AWS setup with options

wheels deploy setup production \
  --provider aws \
  --region us-east-1 \
  --instance-type t3.medium \
  --ssl --monitoring

Docker setup

wheels deploy setup staging \
  --provider docker \
  --ssl --domain staging.example.com

Preview setup

wheels deploy setup production --dry-run

Setup Process

The setup command performs the following steps:

  1. Environment validation: Checks prerequisites and permissions

  2. Infrastructure provisioning: Creates servers, networks, storage

  3. Security configuration: Sets up firewalls, SSL, access controls

  4. Application setup: Installs dependencies, configures services

  5. Database setup: Creates and configures database

  6. Monitoring setup: Configures logging and monitoring

  7. Backup configuration: Sets up automated backups

  8. Validation: Runs health checks on setup

Provider-Specific Setup

AWS Setup

wheels deploy setup production \
  --provider aws \
  --region us-west-2 \
  --instance-type t3.large \
  --database "rds:postgres:db.t3.small" \
  --ssl --monitoring

Creates:

  • EC2 instances

  • RDS database

  • Load balancer

  • Security groups

  • S3 buckets

  • CloudWatch monitoring

Docker Setup

wheels deploy setup production \
  --provider docker \
  --registry docker.io/myapp \
  --compose-file docker-compose.prod.yml

Creates:

  • Docker containers

  • Networks

  • Volumes

  • Container registry

  • Orchestration setup

Traditional Server Setup

wheels deploy setup production \
  --provider traditional \
  --server prod-server-01.example.com \
  --ssh-key ~/.ssh/id_rsa

Configures:

  • Web server (Apache/Nginx)

  • Application server

  • Database connections

  • File permissions

  • Service management

Configuration Files

Environment configuration

The setup creates environment-specific configuration:

# Generated: config/environments/production.yml
environment:
  name: production
  provider: aws
  region: us-east-1
  instances:
    web:
      type: t3.medium
      count: 2
      auto_scaling: true
  database:
    type: postgres
    instance: db.t3.small
    backup: daily
  ssl:
    enabled: true
    certificate: auto
  monitoring:
    enabled: true
    alerts: true

Database configuration

# Generated: config/database.production.yml
database:
  adapter: postgresql
  host: prod-db.region.rds.amazonaws.com
  port: 5432
  database: myapp_production
  pool: 25
  replica:
    host: prod-db-read.region.rds.amazonaws.com

Use Cases

Multi-environment setup

# Setup all environments
for env in development staging production; do
  wheels deploy setup $env --provider docker
done

High-availability setup

wheels deploy setup production \
  --provider aws \
  --instance-type t3.large \
  --scaling "min:2,max:10,target-cpu:70" \
  --database "rds:postgres:db.t3.large:multi-az" \
  --monitoring --backup

Development environment

wheels deploy setup development \
  --provider docker \
  --minimal \
  --skip-monitoring \
  --skip-backup

Post-Setup Tasks

After setup completes, you should:

  1. Verify configuration

    wheels deploy status --environment production
  2. Test deployment

    wheels deploy push --dry-run
  3. Configure secrets

    wheels deploy secrets set DATABASE_PASSWORD=xxx
  4. Run initial deployment

    wheels deploy exec

Security Considerations

The setup command implements security best practices:

  • Encrypted connections (SSL/TLS)

  • Firewall rules (minimal exposed ports)

  • Access control (IAM/RBAC)

  • Secrets management

  • Network isolation

  • Regular security updates

Monitoring Setup

Monitoring configuration includes:

  • Application metrics

  • Server metrics

  • Database metrics

  • Error tracking

  • Performance monitoring

  • Alerting rules

  • Log aggregation

Best Practices

  1. Use version control: Commit generated configuration files

  2. Test in staging: Always setup staging before production

  3. Document customizations: Keep notes on manual changes

  4. Regular updates: Keep infrastructure updated

  5. Monitor costs: Track cloud spending

  6. Backup configuration: Store setup configuration securely

  7. Automate setup: Use infrastructure as code

Troubleshooting

Setup failures

# Check detailed logs
wheels deploy setup production --verbose

# Retry with specific step
wheels deploy setup production --step database

Permission issues

# Verify credentials
wheels deploy setup production --validate-credentials

# Use specific profile
wheels deploy setup production --aws-profile prod-deploy

Network issues

# Test connectivity
wheels deploy setup production --test-connectivity

# Use specific VPC
wheels deploy setup production --vpc vpc-12345

See Also

Previouswheels deploy secretsNextwheels deploy status

Last updated 2 days ago

Was this helpful?

- Initialize deployment configuration

- Execute deployment

- Check deployment status

deploy init
deploy exec
deploy status