# How to upgrade Magento

> Upgrading Magento 2 is done via Composer and the Magento CLI rather than a graphical manager.

Source: https://www.kualo.com/knowledgebase/magento-getting-started/how-to-upgrade-magento
Updated: 2026-06-04

---

Keeping your Magento store up to date is important for security, performance, and compatibility with extensions. Magento 2 upgrades are performed using Composer and the Magento command-line interface (CLI) over SSH.

:::warning
Always take a full backup of your files and database before upgrading. An upgrade cannot easily be reversed without one. You can generate a backup from **cPanel > Backup**.
:::

## Before you begin

- Confirm your server meets the system requirements for the target Magento version (PHP version, MySQL version, and so on). Check the official Magento documentation for the compatibility matrix.
- Put your store into maintenance mode so customers see a clean holding page during the upgrade.
- Ensure you have SSH access to your hosting account. Contact Kualo support if you are unsure.

## Step 1 - Enable maintenance mode

Connect to your account via SSH, then run:

```bash
php bin/magento maintenance:enable
```

## Step 2 - Update Magento via Composer

From your Magento root directory, run the following, replacing `2.4.x` with the version you are upgrading to:

```bash
composer require magento/product-community-edition 2.4.x --no-update
composer update
```

:::info
If you are on Magento Commerce (Adobe Commerce) rather than the open-source edition, the package name will differ. Refer to the Adobe Commerce upgrade documentation for the correct package.
:::

## Step 3 - Run the Magento upgrade commands

Once Composer has finished, run the upgrade and compile steps:

```bash
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
```

## Step 4 - Clear the cache

Flush the Magento cache to ensure the new version is served correctly:

```bash
php bin/magento cache:flush
```

## Step 5 - Disable maintenance mode

Once the upgrade has completed successfully, bring your store back online:

```bash
php bin/magento maintenance:disable
```

## Confirming the upgrade

You can confirm the installed version by running:

```bash
php bin/magento --version
```

The version number is also shown in the footer of your store's Admin panel.

## Need help?

If you run into any issues during the upgrade, open a support ticket from within your MyKualo client area and our team will be happy to assist.

---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/magento-getting-started/how-to-upgrade-magento · © Kualo Ltd._
