Choosing the right theme for your store is one of the first steps you take when creating an eCommerce website. It should not only represent your brand using custom layouts and templates but be user-friendly, fast and SEO-optimized.
The variety of Magento 2 themes on the market is growing. It allows you to find any theme you want on Magento Marketplace or Theme Forest. And once you make up your mind and choose the best Magento 2 Theme, you need to know how to install and apply it to your store.
Post Contents [hide]
Since Magento has deprecated the WebSetup Wizard starting from Magento v2.3.6, you can now install Magento 2 theme only in the command line: via composer or archive. In the first case theme files will be located under vendor and, using the archive, you can find the theme files under app/design.
Install Magento 2 Theme via Composer
Before you install a theme in Magento 2, it is recommended to switch to developer mode.
1. Navigate to your Magento 2 root directory, using "cd" and run the following command:
composer require <vendor>/<name>
e.g. composer require magefan/theme-frontend-optimized
Since authentication is required you will be asked to use your Magento authentication keys. Once you run the command, a composer will update all the dependencies.
2. Run the following CLI commands:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
Note: if you don't want your website to be down during deployment, try these zero downtime deployment commands for Magento 2.
Install Magento 2 Theme via Archive
- Download the ZIP archive of your theme from the Magento Marketplace or any other marketplace.
- Extract files. You'll get directories like app, pub or lib depending on a theme.
- Copy folders from the archive to your Magento 2 root directory.
- Navigate to your Magento 2 root directory, using "cd" and run the following commands:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
Enable New Magento Theme
Once you install Magento 2 theme, the next step is to apply it to your store.
1. Navigate to Content > Design Configuration and click Edit near the website you'd like to apply a new theme to.
2. Select your theme from the Applied Theme dropdown and Save the configuration.
You can now go and check what your theme looks like on the frontend. You might need to tweak a few settings and skim through your theme documentation to learn how to edit colours, add new items to the menu or change banners.
However, as simple as the installation of the Magento 2 theme is, it's best to follow the installation guide that comes with your theme. Each vendor may offer unique theme installation guides, just like we offer one on how to install our Optimized Magento 2 Theme.