X
    Categories: Drupal 8 Tutorials, Tips and GuidesDrupal Tutorials, Tips and Guides

How to Install Drupal Commerce Using Composer

Drupal Commerce is one of the best solutions you can find for your ecommerce needs. With the release of Drupal Commerce 2.x, it only gets better. What better way to celebrate this milestone than educating the users about setting it up. So in this guide, I’ll show you how to install Drupal Commerce using Composer on your Cloudways server.

Note: Cloudways has Composer and Drush preinstalled on all its servers.

Here are the steps involved in the installation process:

  1. Launch Server
  2. Launch Drupal 8 Application
  3. Delete the database
  4. Launch SSH terminal
  5. Update Composer
  6. Install Drupal Commerce
  7. Setup store details

Launch Server

Login to your Cloudways account and launch a server of your choice. (Skip this step if you already have a server on Cloudways).

Launch Application

When your server is done setting up, go to the Applications tab and click the Add Application button, located in the top right corner.

Select Drupal 8.x.x from the drop-down list. Enter the details and then wait a few minutes for the application to finish the setup process.

Delete the database

Now, you will need to remove the existing database in order to make way for the new website’s database. You can do this by navigating to your Application’s dashboard and clicking the Launch Database Manager button.

Once inside, select all tables, scroll down to the bottom and click the Drop button.

Launch SSH Terminal

Next, go to your server’s dashboard and click the Launch SSH Terminal button.

Once logged-in, navigate to your application’s directory.

Update Composer

Before proceeding with the installation of Drupal Commerce, you will need to make sure that the Composer version is up to date. You can do this by simply going to the SSH terminal and typing in the following command:

composer update

Install Drupal Commerce

Now, I will demonstrate how you could install Drupal Commerce. If you thought this would be manual (and hectic) task, here’s a surprise for you: You can install Drupal Commerce along with the Drupal core by simply typing the following command in the terminal:

composer create-project drupalcommerce/project-base mystore --stability dev

This will now install everything automatically, including all the libraries and dependencies required by Drupal Commerce.

Setup Store Details

Now, go to the application’s dashboard and click the Launch Website button.

You will now be brought to the standard Drupal installation screen.

Proceed as you normally would with a standard Drupal installation. Upon completion, you will be brought to your brand new Drupal Commerce website.

Conclusion

That’s it! It was that easy. You’ve successfully setup Drupal Commerce on Cloudways using Composer. If you have any questions please leave me a comment and I’d be happy to help.

If you are a fan of Drupal Commerce, have a look at our list of, Top Drupal Commerce Themes.

Hamza Zia: Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.