Magento Developer Insights
May 29, 2024

How to Check the Magento Version?

By Liam Ashley
Magento is a well-known platform for e-commerce, the most popularly used in the world. It has grown to be the synonym of an eCommerce solution.  Magento has been updated over time, and users have to stay updated with the changes in the latest versions. So, it is very important to keep a check of your Magento version.…

Magento is a well-known platform for e-commerce, the most popularly used in the world. It has grown to be the synonym of an eCommerce solution. 

Magento has been updated over time, and users have to stay updated with the changes in the latest versions. So, it is very important to keep a check of your Magento version.

Here, we’ve listed eight ways to check your Magento version.

Check Magento Admin Dashboard

It is a simple method to check the Magento version without leaving the site. Simply log in to your Admin Panel and scroll down to the bottom to check the Magento version.

You can find the installed Magento version as shown below:

Magento 1:

Magento 2:

In Magento V2, if you’ve reformed the dashboard, go to System > Web Setup Wizard > System Upgrade. Enter the private and public keys to check your Magento version.

Check composer.json file ( Only for Magento 2)

You can check your Magento 2 version in the root composer.json file, as shown in line #5 in the example

Example,

{
    "name": "magento/magento2ce",
    "description": "Magento 2 (Open Source)",
    "type": "project",
    "version": "2.2.6-dev",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],

    …

Check Composer.lock file ( Only for Magento 2)

You can check your Magento 2 version in the root composer.json file, as shown in line #3 in the example

Example,

{
  "name": "magento/magento2-base",
  "version": "2.3.1",
  "dist": {
    "type": "zip",
    "url": "https://repo.magento.com/archives/magento/magento2-base/magento-magento2-base-2.3.1.0.zip",
    "reference": null,
    "shasum": "7877828bb63a7cfca5c62c6c6caf6a9c05ab154b"
  }
}

Check via Command line( Only for Magento 2)

Run the below command to check the Magento version:

php bin/Magento --version

Run the below command to check if your Magento version is enterprise or community edition:

composer licenses | grep Name:

Use the Chrome extension

You can use two extensions to check your Magento version in chrome.

Wappalyzer: Check if your store is on Magento 1 or Magento 2

Version check for Magento: This one is a paid tool for checking your Magento version.

Check using PHP code

For version 1

Mage::getVersion() //will return the magento version

For version 2.0.X

echo \Magento\Framework\AppInterface::VERSION;

For version 2.1.x to 2.3.x

  1. Using DI
public function __construct( \Magento\Framework\App\ProductMetadataInterface $productMetadata ) { 
    $this->productMetadata = $productMetadata; 
} 
public function getMagentoVersion() { 
    return $this->productMetadata->getVersion(); 
}
  1. Using Object Manager
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); 
$productMetadata = $objectManager->get('Magento\Framework\App\ProductMetadataInterface'); 
echo $productMetadata->getVersion();

Using Online tools to check Magento Version

Magento Version Checking Tool: Use this tool to check your Magento Version using URL

Check from the URL

Simply add /magento_version after your store URL to check your Magento Version.

It is very important to keep updating your Magento version as it comes with security updates and the latest features to help you grow your E-Commerce store. 

We hope these methods will help you check your latest Magento versions.

Stay in the loop
Now you can update. Receive product updates, new and successful versions from Magstack customers directly in my mailbox.