Skip to content
WP Cloud
WP Cloud
    • For Hosts
    • For Agencies
    • For Registrars
    • For Native Hosting
    • Performance
    • Security
    • Real-Time Automated Failover
    • Vertical Scaling and Bursting
    • WordPress Management
    • PanelAlpha Integration: White-Label WordPress Control Panel for Hosts
    • EasyEngine Panel Integration: Visual WordPress Management for WP Cloud
    • FAQs
    • WP Cloud API
    • Partner Portal
    • Documentation
    • New Partner Guide
    • Pressable
    • Convesio
    • Porkbun
    • PanelAlpha
    • Ivapix
    • UNC Greensboro
    • Impressive Hosting
    • Blog
    • Performance Benchmarks
  • Connect With Us
  • Login ↗
Start Here ↗
  • Solutions

    • For Hosts
    • For Agencies
    • For Registrars
    • For Native Hosting
    • Featured Partners

    Features

    • Performance
    • Security
    • Real-Time Automated Failover
    • Vertical Scaling and Bursting
    • WordPress Management

    Integrations

    • PanelAlpha Integration
    • Easy Engine Panel Integration

    Resources

    • Documentation
    • WP Cloud API
    • FAQs
    • Partner Portal
    • New Partner Guide
    • Announcements
    • Changelog
  • Case Studies
    • PressableA case study about how WP Cloud supports Pressable to power millions of page views daily.
    • Convesio
    • Porkbun
    • PanelAlpha
    • Ivapix
    • UNC Greensboro
    • Newspack
    • Inverse Paradox
  • Insights
    • Podcast
    • BlogWP Cloud blog page with latest news and updates about the platform.
    • Performance Benchmarks
  • Connect With Us
  • Login ↗
Start Here ↗

Browse

    • WP Cloud platform overview
    • Onboard and launch with WP Cloud
    • WP Cloud Partner Portal
    • Get support from WP Cloud
    • WP Cloud glossary
    • API Documentation
    • Manage and secure API keys
    • Client SSH
    • WP Cloud API quick start
    • Webhooks
    • Run bulk tasks across sites
      • Manage site domains and aliases
      • Domain verification records
      • TLS certificates
      • Manage custom TLS certificates
      • Cloudflare and WP Cloud
    • Clone a site
    • Configure resources, site type, and billing with site meta
    • Delete a site
    • Persistent data
    • Staging sites
    • Migrate a site to WP Cloud
      • SSH and SFTP access models
      • Client SSH
      • User SSH and SFTP access
      • Database credentials
      • phpMyAdmin
      • ABSPATH
      • Default wp-config.php
      • Site constants
      • Configure redirects and headers with custom-redirects.php
      • Akismet and Jetpack
      • Blocked and unsupported plugins
      • PHP lifecycle and supported versions
      • Symlinks and managed software
      • WordPress versions
      • Install Composer and WP-CLI packages
      • Manage platform software with WP-CLI
      • Useful WP-CLI commands
    • Transactional email
    • WordPress multisite
    • Cron scheduling
    • Decoupled and headless WordPress
      • Edge Cache preload
      • WooCommerce cart caching
      • Page Cache
      • Edge Cache
      • Object Cache
      • Image transformation
      • Offload image sub-sizes
    • Configure lightweight 404s for static files
      • Edge Rules overview
      • Edge Rule types
      • Edge Rule conditions
      • Verify Edge Rules
      • Edge Cache preload
      • WooCommerce cart caching
      • Edge Cache
    • Edge request logs
      • DDoS protection
      • Defensive Mode
      • Rate limiting
      • Network and web application firewalls
      • Bot protection
      • Password protection
      • HTTP and security headers
      • PHP filesystem access permissions
      • Scan a site for malware
    • Backups overview
    • Create an on-demand backup
    • Restore a backup
    • Jetpack backups
      • Error logs
      • Web server logs
      • Edge request logs
    • Usage reporting
    • Metrics
    • Application performance monitoring
    • Automated failover
    • IP ranges
    • Origin and edge servers
    • Server specifications and settings
    • EasyEngine integration
    • PanelAlpha integration
      • White labelling and co-marketing WP Cloud
      • WP Cloud logos
      • Terms of Service & Compliance
      • Prohibited content
      • Copyright infringement and takedown notifications
    • WP Cloud billing
    • WP Cloud for agencies and site networks
    • WP Cloud partner support options
    • Troubleshoot Page and Edge Cache
    • Troubleshoot HTTP 429 and 599 errors
    • WP Cloud HTTP status codes
    • Troubleshoot site performance
    • Cache slow database queries
    • Troubleshoot duplicate core files, wp-config.php, and wp-admin 403 errors
    • Troubleshoot email delivery
    • Repair Yoast indexables
    • Troubleshoot PDF thumbnail generation
    • Troubleshoot TLS certificate provisioning

Updates

  • Changelog
  • WP Cloud Status
  • Announcements
Documentation/WordPress on WP Cloud/WP-CLI/Install Composer and WP-CLI packages

Install Composer and WP-CLI packages

LAST UPDATED

5 months ago

    WP-CLI is already installed on WP Cloud sites. A partner developer or support engineer with Client SSH access can add Composer and optional WP-CLI packages for a site-scoped development or diagnostic workflow. An end user with User SSH and SFTP access can install them for the site as well.

    The steps below are examples. Profile behavior, package installation, command availability, and results can vary. Composer and third-party WP-CLI packages are outside WP Cloud’s support scope. WP Cloud does not guarantee their performance or security; the host partner or site owner is responsible for installing, maintaining, securing, and supporting them.

    Do not use a production WP Cloud site to compile projects such as themes. Composer-based compilation may not work as expected, and WP Cloud does not recommend using its hosting servers as build systems.

    Important: If .profile is deleted or corrupted, installed commands may not remain available in later SSH sessions. The commands can work immediately after installation but may need to be registered again after reconnecting.

    Install Composer and configure paths

    Connect to the site over SSH, then create the configuration directory:

    mkdir -p "$HOME/.config"Code language: JavaScript (javascript)

    Download the Composer installer:

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"Code language: JavaScript (javascript)

    For production use, follow Composer’s installer verification instructions before running the downloaded file.

    Add the Composer and WP-CLI package directories to .profile:

    printf '\n# Composer\nexport COMPOSER_HOME="$HOME/.config/composer"\n\n# WP-CLI\nexport WP_CLI_PACKAGES_DIR="$HOME/.config/wp-cli/packages"\n' >> "$HOME/.profile"Code language: JavaScript (javascript)

    Confirm that the profile contains:

    # Composer
    export COMPOSER_HOME="$HOME/.config/composer"
    
    # WP-CLI
    export WP_CLI_PACKAGES_DIR="$HOME/.config/wp-cli/packages"Code language: PHP (php)

    Load the profile and run the installer:

    source "$HOME/.profile"
    php composer-setup.phpCode language: JavaScript (javascript)

    If a later SSH session cannot find an installed package, confirm that .profile still contains the variables and is loaded for that session. These profile commands are examples and may need to be adapted to the user’s shell and session behavior.

    Install WP-CLI packages

    Use wp package after Composer and the package path are configured. Two packages useful for performance investigations are:

    wp package install wp-cli/doctor-command:@stable
    wp package install wp-cli/profile-command:@stable

    The Doctor command runs configurable site checks. The Profile command measures stages and hooks during a WordPress request. Use their output with the broader workflow in Troubleshoot site performance.

    When the newest package release requires a newer WP-CLI version than the site provides, install the last compatible release instead of @stable. For example:

    wp package install "wp-cli/profile-command:<2.1.7"Code language: JavaScript (javascript)

    Choose the version from the package’s release and compatibility information; the example is not a recommendation to pin every site to that release.

    Previous WordPress versions
    Next Manage platform software with WP-CLI

    Related Guides

    • Manage platform software with WP-CLI

      Switch eligible plugins and themes between managed symlinks and site-owned installations with WP-CLI.

      2 Min.

      READ

    • Useful WP-CLI commands

      Use common WordPress and WP Cloud WP-CLI commands for plugins, themes, cache, content, errors, and…

      5 Min.

      READ

    On this page

      Contact support

      Contact us with Support issues and questions related to WP Cloud, the WP Cloud Atomic API, API-key IP allow list changes, Station, and more.

      Check the FAQs

      Have questions? Please visit our FAQ to learn more.

      An Automattic venture

      Work With Us

      Press

      Privacy Policy

      © 2021-2026 Automattic Inc.

      Notifications