Installing the Magento 2 module

    Learn how to install, uninstall, and upgrade the Stripe Magento 2 module.

    Download the module

    Download the latest version of the Magento 2 module to get started with Stripe on your Magento site:

    Download now

    Install the module using Composer

    1. Start by downloading the module. (This is a slightly different package from the one provided on the Magento Marketplace.)
    2. Extract the downloaded archive into your Magento root directory using the command below. The module will be extracted to app/code/StripeIntegration/Payments/:
    tar -xvf stripe-magento2-x.x.x.tgz
    
    1. Set up the module by running the following commands:
    composer require stripe/stripe-php:^6
    php bin/magento setup:upgrade
    php bin/magento cache:flush
    php bin/magento cache:clean
    
    1. If you run Magento in production mode, you also must compile and deploy the module’s static files:
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    

    Install the module using the Magento Admin Panel

    Complete the following two steps before installing the Stripe module:

    • Magento relies on the cron command on your system. If you haven’t set up cron already, follow the official instructions from Magento before proceeding.

    • Ensure that your web server has full write access to the entire Magento directory using the official instructions. The simplest method is to change the ownership of the Magento directory to the same user that the web server is running under:

    chown –R <www-username> /magento_directory
    

    To install the module:

    1. Place an order for the module through the Magento Marketplace

    2. Navigate to the Setup Wizard located in System > Tools > Web Setup Wizard (also located at http://yourdomain.com/admin_xxxx/admin/backendapp/redirect/app/setup/).

    The Magento Setup Wizard

    1. From the Setup Wizard page, click the Extension Manager icon.
    1. You should now see all installed extensions. If you haven’t already done so, you will be asked to enter your Magento Marketplace authentication keys. You can find these on the Magento Marketplace.
    1. Within the Magento Marketplace Account, section, click Install under New Purchases and follow the instructions to install the module.
    1. The installation can take 5 minutes or more while cron runs a complete job that upgrades Magento, re-deploys the static assets, recompiles the code, and other tasks. You should allow the installation to finish without closing the window to ensure the module installs completely.

    Install the module manually

    1. Download the latest version of the module from Stripe.

    2. Extract the module in your Magento directory:

    tar -xvf stripe-magento2-x.x.x.tgz
    
    1. Install the Stripe PHP library:
    composer require stripe/stripe-php:^6
    
    1. Set up the module by running the following commands:
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento cache:flush
    
    1. If you run Magento in production mode, you also must compile and deploy the module’s static files:
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    

    Get your authentication keys

    If you don’t have Composer installed, follow these installation instructions. During installation, you may be asked for a username and password. Provide your [Magento 2 authentication keys](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html.

    You will also be asked to save your credentials. If you select Yes, Composer saves them in ~/.composer/auth.json.

    If you’ve saved your keys and see the error Invalid Credentials, update them by editing ~/.composer/auth.json directly, or delete the file and run the composer command again.

    Migrating from other Stripe modules

    From February 2018 to April 2019, Stripe provided another module on the Magento Marketplace. If you’re migrating from this legacy module, you must completely uninstall it first. Run the following command:

    composer remove stripeofficial/stripe-payments
    

    You also need to remove any existing webhooks configured on your Dashboard as these have changed.

    After you remove both the legacy module and its webhooks configuration, follow the steps outlined above to install the new module. Any existing orders with the legacy module are automatically migrated when the new modules is installed, so you can refund or capture those orders if needed.

    These instructions also apply to the Cryozonic Stripe modules. Uninstall the modules and remove any existing webhooks. Orders placed with the Cryozonic modules automatically migrate to the new module upon installation, and any associated customers in the database are copied into the new module’s database tables.

    Upgrade the module

    If you used the manual installation method

    You can always download the latest version of the module from Stripe’s website. When you have the latest version, uninstall the module and then reinstall the module.

    If you installed using the Magento Admin Panel

    Run the following commands from your command line:

    composer upgrade stripe/stripe-payments
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    php bin/magento cache:clean
    

    If you do not have SSH access, you can alternatively upgrade through the Magento admin area:

    1. Navigate to the Setup Wizard at http://yourdomain.com/admin_xxxx/admin/backendapp/redirect/app/setup/.
    2. Click the System Upgrade icon.
    3. In the Other Components section, select Yes.
    4. Select the version of the module you want to upgrade to and follow the instructions to complete the upgrade.

    Uninstall the module

    If you used the manual installation method

    From a terminal, run the following commands:

    php bin/magento module:disable --clear-static-content StripeIntegration_Payments
    composer remove stripe/stripe-php
    rm -rf app/code/StripeIntegration/Payments
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    php bin/magento cache:flush
    php bin/magento cache:clean
    

    If you installed using the Magento Admin Panel

    Run the following commands from your command line:

    composer remove stripe/stripe-payments
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    php bin/magento cache:clean
    

    Next steps

    You’ve now installed the Magento 2 module. Learn more about how to configure and use the module:

    Was this page helpful?

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page