# How to update a MAG box

> Update MAG box firmware automatically, with the remote, or from a USB drive.

Sometimes the best way to fix an issue is to update the [MAG box](https://iptvfiesta.sx/help-center/article/how-to-setup-iptv-on-mag-box) to the latest firmware. This guide shows how to update the firmware automatically and how to update it from a USB drive.

## Update the firmware automatically

1. Disconnect the MAG box from the internet.
2. Reset the MAG box.
3. Wait until **Page Loading Error** appears on the screen.
4. Plug the internet cable back into the box.
5. Select **Embedded Portal**. The box updates to the latest version.

If the automatic update does not start:

1. Press **SET** on the remote.
2. Select **Software update**.
3. Press **OK**.
4. Press **F1**.

![MAG remote with the F1 button highlighted](https://iptvfiesta.sx/api/help-center/media/2021-08-MAG-remote.jpg)

## Update the firmware from a USB drive

Some MAG devices lose their portal settings after a system software update. They then cannot add portal addresses. You can update the system software from a USB drive.

Before you start, make sure the USB drive meets the [software update requirements](https://wiki.infomir.eu/eng/set-top-box/stb-linux-webkit/mag322-324-349-351/software-update-mag322-324-349-351#SoftwareUpdateMAG322/324/349/351-requirements). Download the `imageupdate` file for your model. The latest factory software image is on the manufacturer's server at `http://update.infomir.com/mag/MODEL/imageupdate`, where `MODEL` is the STB model number. See [the Infomir software page](https://wiki.infomir.eu/eng/set-top-box/stb-linux-webkit/stb-software). For example, the MAG322 file is `http://update.infomir.com/mag/322/imageupdate`.

1. Create a directory named `mag` plus your model number in the root of the USB drive. For a MAG322, the directory is `mag322`.

2. Write the `imageupdate` file to this directory. For a MAG322, the directory name is `mag322`.

   ![File manager showing a mag322 folder and the imageupdate file](https://iptvfiesta.sx/api/help-center/media/2021-08-How-to-update-MAG-1.png)

3. Connect the USB drive to any USB port on the box, front or rear.

4. Open **Settings**.

5. Select **System settings**.

6. Select **Software update**.

7. Set **Update method** to **USB**. The **Disk** and **Path** fields appear.

   ![Software update window with USB selected as the update method and the file path shown](https://iptvfiesta.sx/api/help-center/media/2021-08-How-to-update-MAG-2.jpg)

8. Select **Verify (OK)** to check that the box detects the `imageupdate` file.

9. Wait for the **Software update** window. It appears if the file is detected and readable.

   ![Software update window comparing the current and new firmware versions](https://iptvfiesta.sx/api/help-center/media/2021-08-How-to-update-MAG-3.jpg)

10. Compare the **Current version** and **New version**.

11. Choose an action:
    - To reject the update, press **Exit**.
    - To start the update, press **Update (F1)**.

12. Watch the progress bar.

    ![Software update progress bar at 5 percent](https://iptvfiesta.sx/api/help-center/media/2021-08-How-to-update-MAG-4.jpg)

    To view the update log, press **Show log** (**Info** on the remote).

13. Wait until the update finishes. The box restarts automatically. Do not turn off the box or unplug the USB drive until the update is complete.
