Shopware 6.7 marks a pivotal evolution in the eCommerce landscape, delivering enhanced performance, robust security features, and developer-centric improvements. At the heart of this efficiency lies the Command Line Interface (CLI) ecosystem. For developers and system administrators, mastering the installation and configuration of Shopware 6.7 CLI tools is no longer optional—it is essential for streamlined deployment, automated workflows, and rapid local development.

This guide provides a comprehensive walkthrough on installing Shopware 6.7 CLI tools, focusing on best practices, security protocols introduced in version 6.7, and ensuring your environment is primed for maximum productivity.

Why CLI Tools Matter in Shopware 6.7

In previous versions, interacting with Shopware often required navigating through the Administration UI or relying solely on the bin/console script within a web-installed context. Shopware 6.7 introduces a more modular approach to tooling. The introduction of dedicated CLI packages allows for:

  • Headless Management: Manage store configurations, extensions, and data without launching a browser.
  • CI/CD Integration: Automate builds, migrations, and health checks in continuous integration pipelines.
  • Decoupled Workflows: Run administrative commands independently of the web server execution context, reducing resource contention.

Shopware 6.7 also tightens security boundaries. The CLI tools now align with stricter permission models and require explicit configuration for HTTP endpoints to prevent unintended access during automated processes.

Prerequisites for Installation

Before diving into installation, ensure your environment meets the rigorous demands of Shopware 6.7. Version 6.7 enforces modern standards to guarantee stability and performance.

  1. PHP Version: Shopware 6.7 requires PHP 8.2 or higher (PHP 8.3 is highly recommended). Verify your version with php -v.
  2. Composer: You must use Composer 2.0 or later. Check via composer --version.
  3. System Dependencies: Ensure extensions like pdo_mysql, mbstring, intl, and zip are enabled. Shopware 6.7 may impose stricter checks on these for CLI operations.
  4. Permissions: Avoid running commands as root. Use a dedicated www-data or shopware user with appropriate file ownership to adhere to 6.7's security posture.

Step-by-Step Installation Guide

The most recommended way to install Shopware 6.7 CLI tools is via Composer. This ensures you get the exact version compatible with your core installation and maintains dependency consistency.

Method 1: Installing as a Local Dependency

If you are working within a project directory or need tools for specific tasks, add the tool package to your composer.json.

Open your terminal and navigate to your project root:

cd /path/to/shopware/project

Install the CLI tools as a development dependency. This is ideal for local development environments where you might need to fetch administration updates or run helper scripts without committing the executable to production.

composer require shopware/tool --dev

Once installed, the tools become available in your vendor/bin directory. You can invoke them using:

./vendor/bin/shopware --help

Method 2: Global Installation for Power Users

For developers managing multiple Shopware instances or setting up server-side automation, a global installation is often preferred. This places the shopware binary in your system's PATH, making it accessible from any directory.

composer global require shopware/tool

Ensure your Composer global bin directory is in your system's PATH. You can verify this by checking:

composer global config bin-dir --absolute

If the path is not in your $PATH, add it to your shell configuration file (e.g., ~/.bashrc or ~/.zshrc):

export PATH="$HOME/.composer/vendor/bin:$PATH"
source ~/.bashrc

Now, you can run shopware commands from anywhere.

Configuration and Environment Setup

Shopware 6.7 CLI tools require explicit configuration to function correctly, especially regarding connectivity to the administration endpoint. Unlike the web interface, the CLI does not rely on browser sessions for authentication; it uses system-level configurations or token-based access where applicable.

You must set environment variables to define the target store and administrative paths. Create a .env file in your project root or export variables in your shell session.

# .env file example
SHOPWARE_CLI_HTTP_HOST="http://localhost"
SHOPWARE_ADMIN_PATH="/administration"
SHOPWARE_CLI_SKIP_TLS_VERIFICATION=false

Key Variables Explained:

  • SHOPWARE_CLI_HTTP_HOST: The base URL of your Shopware instance. This is crucial for the CLI to communicate with the API endpoints required for administration tasks.
  • SHOPWARE_ADMIN_PATH: Specifies where the Administration bundle resides. Shopware 6.7 optimizes paths for better caching and asset delivery; ensure this matches your installation structure.
  • SHOPWARE_CLI_SKIP_TLS_VERIFICATION: Set to true only for local development with self-signed certificates. Production environments should always use valid TLS.

For advanced usage involving private administration assets, Shopware 6.7 supports the use of access tokens. You can generate a token via the Administration UI under Settings > Access Management and export it:

export SHOPWARE_ADMIN_ACCESS_TOKEN="your-secure-token-here"

Verification and Troubleshooting

After installation, verify that the tools are operational and compatible with your Shopware 6.7 core. Run the following command to check the version and connectivity:

shopware --version

You should see output indicating the CLI tool version and its compatibility matrix. If you encounter errors related to autoload failures, refresh Composer's autoloader:

composer dump-autoload -o

Shopware 6.7 introduces stricter memory management checks in the CLI. If commands fail due to memory limits, increase the PHP limit temporarily:

php -d memory_limit=1024M vendor/bin/shopware <command>

Common issues in 6.7 often stem from permission mismatches. Ensure the web server user owns the var/ and custom/plugins/ directories:

sudo chown -R www-data:www-data var custom/plugins
sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +

Best Practices for Shopware 6.7

  1. Lock Your Versions: Always use version constraints in composer.json to prevent unexpected breaking changes during updates. For example, shopware/tool: ^6.7.
  2. Automate Permissions: Integrate permission setting into your deployment scripts. Shopware 6.7 relies on consistent permissions for security; ad-hoc fixes can lead to silent failures.
  3. Monitor Deprecations: 6.7 is strict about deprecated features. Use the CLI's diagnostic commands regularly to identify and resolve issues before they impact production.
  4. Secure Your Secrets: Never commit environment variables containing tokens or credentials to version control. Use secret management tools compatible with your CI/CD provider.

Conclusion

Installing Shopware 6.7 CLI tools unlocks the true potential of the platform for developers and DevOps engineers. By following this guide, you ensure that your tooling is secure, compliant with 6.7 standards, and ready to support efficient workflows. Whether you are automating deployments, managing extensions, or developing custom integrations, the CLI ecosystem is your most powerful ally in the Shopware 6.7 era.

Keep your tools updated, respect permission boundaries, and leverage the power of automation to build robust eCommerce solutions with Shopware 6.7.