This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

📣 Join the live AMA session with Adam Silverstein on open source and WordPress core! Register Now →

Install A Drupal Bootstrap Theme Using Composer

Updated on November 15, 2017

2 Min Read

In a previous tutorial, I have already covered the process of creating a Drupal 8 Bootstrap theme. While installing a theme through the Admin UI is pretty simple, installing it via Composer requires a bit of work. In this guide, I will show you how to install a Drupal Bootstrap Theme using Composer.

install-drupal-bootstrap-theme-using-composer

First Things First!

Before getting started, one important thing to understand is that not every Drupal package is available via composer.JSON right out of the box. Hence if you try to install the theme via the command composer require drupal/bootstrap or composer require twbs/bootstrap before making appropriate changes to the composer.JSON file, the theme won’t appear in the Admin UI.

Stop Wasting Time on Servers

Cloudways handle server management for you so you can focus on creating great apps and keeping your clients happy.

Add Appropriate Repositories

So what you need to do now is to add the appropriate Drupal repositories to the composer.JSON file. You need to look for a package name for Bootstrap for Drupal, here. After finding out the package name, simply edit the composer.JSON file using your text editor. Add the following lines before the line starting with “extra”:

"repositories": { "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" } }

Make Appropriate Changes via Composer

Now, if you previously tried adding the theme via the composer require twbs/bootstrap command, you must first remove it first. You can do this by executing the following command:

composer remove twbs/bootstrap

Now, run the following command to install the theme successfully on your Drupal site:

composer require drupal/bootstrap

Conclusion

That’s it! You’ve successfully installed the Drupal Bootstrap Theme using Composer. The only problem that might pop up is that Composer doesn’t include the required repositories by default. Hopefully, these will be added in the future releases. Until then, you can follow this guide in order to install any module or theme that has a repository for Composer.

Share your opinion in the comment section. COMMENT NOW

Share This Article

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.

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour

CYBER WEEK SAVINGS

  • 0

    Days

  • 0

    Hours

  • 0

    Mints

  • 0

    Sec

GET OFFER

For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now