# Updating Magento

> Keep your Magento store secure and current by updating it with the Magento command-line tool or, for older stores, Softaculous.

Source: https://helpcenter.ruachost.com/apps/magento/updating-magento/

Keeping your Magento installation up to date is critical for **security, stability, and access to new features**. On **ruachost.com**, you can update Magento using either **Softaculous** (for Magento 1.x only) or the **Magento Command-Line Interface (CLI)** (for Magento 2.x).

## Why Update Magento?

- **Security** → Updates patch vulnerabilities and protect customer data.
- **Stability** → Bug fixes improve site reliability.
- **Features** → Gain access to new Magento functionality.

## Methods to Update Magento

### Method 1: Softaculous (Magento 1.x only)

If you installed Magento 1.x using **Softaculous**, you can also update it through Softaculous:

1. Log in to your **ruachost.com CPanel**.
2. Go to **Softaculous Apps Installer → Magento**.
3. Select your installation.
4. Click **Upgrade**. ⚠️ Note: This method does **not** apply to Magento 2.x.

### Method 2: Manual Update via CLI (Magento 2.x)

For Magento 2.x, updates must be done using the **command line**:

1. Log in to your hosting account via **SSH**.
2. Navigate to your Magento installation directory:

   ```
   cd ~/public_html
   ```
3. Run the upgrade command:

   ```bash
   php bin/magento setup:upgrade
   ```

   ```
   ```
4. Clear caches:

   ```bash
   php bin/magento cache:flush
   ```
5. Recompile code (if necessary):

   ```bash
   php bin/magento setup:di:compile
   ```
6. Deploy static content:

   ```bash
   php bin/magento setup:static-content:deploy
   ```

✅ Your Magento installation is now updated.

## Important Notes

- Always **back up your site and database** before updating.
- Test updates in a **staging environment** before applying to production.
- Some updates may require **composer** if Magento was installed via Composer.
- If you encounter errors, disable custom extensions temporarily and retry.
