> ## Documentation Index
> Fetch the complete documentation index at: https://docs.minestorecms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Third-Party Templates

> You can install third-party templates to customize the appearance of your webstore after purchasing them from the marketplace.

## Introduction

You can install **third-party templates** to customize the appearance of your webstore after purchasing them from the marketplace. These templates are created by third-party developers and can be installed on your webstore to change the look and feel of your webstore.

<Warning>
  Before installing a third-party template, make sure to **backup** your current theme settings. If you have made any customizations to your current theme, they will be lost when you install a new template.
</Warning>

## Install Third-Party Template

To install a **third-party template**:

1. **Purchase** a third-party template from the **[Marketplace](https://minestorecms.com/marketplace)**.
2. Make a **backup** of your current theme settings by using **SFTP** or **File Manager**. You can also press "Create a Theme" button to make a backup of your current theme settings.
3. Go to your admin panel and click on the **Themes** tab.
4. Click on the **"Install Theme"** button.
5. Wait for the theme to be installed.

<Note>
  After installing a third-party template, you can customize the appearance of your webstore by **editing the theme settings**.

  Keep in mind that some third-party templates may require additional setup steps. Make sure to read the **documentation** provided by the template developer.
</Note>

## How the Install Runs

Theme installation is **asynchronous** — the request returns immediately and a background job carries out the work. A **progress modal** in the admin shows the current stage in real time, and the page does not need to stay open for the install to complete.

The job runs through these stages in order:

| **Stage**        | **What happens**                                                                                          |
| ---------------- | --------------------------------------------------------------------------------------------------------- |
| **Downloading**  | Fetches the theme archive from the marketplace using your license key.                                    |
| **Validating**   | Validates the ZIP for size, path traversal, file types, and free disk space (requires \~3× archive size). |
| **Backing Up**   | Snapshots the current theme (`frontend/` + `public/assets/`) before any file is touched.                  |
| **Extracting**   | Replaces the live frontend with the new theme's files.                                                    |
| **Configuring**  | Writes the frontend `.env` (API URL, store URL) for the new theme.                                        |
| **Restarting**   | Restarts the frontend process so the new theme is served.                                                 |
| **Health Check** | Waits for the frontend to respond as healthy before marking the install as completed.                     |

## Automatic Backup and Rollback

<Check>
  Every install **automatically backs up the current theme** before any files are replaced. You do not need to make a manual backup unless you want an extra off-server copy.
</Check>

If any stage fails (download error, invalid archive, not enough disk space, broken theme files, frontend not coming back up):

1. The job is marked as **failed** with the exact error in the progress modal.
2. The previous theme is **automatically rolled back** from the backup taken in the **Backing Up** stage.
3. Your store keeps running on the previous theme — there is no broken in-between state.

## Archive Validation

The platform pre-validates the theme archive before extracting anything to prevent broken or malicious uploads:

* **Size limit** — archives over the configured maximum are rejected.
* **Path traversal protection** — entries with `..` or absolute paths are rejected.
* **File type allow-list** — only theme-relevant file types are allowed inside the archive.
* **Disk space check** — the install is refused if the host does not have at least 3× the archive size free.

<Warning>
  A failing validation **aborts the install before any files are written**. The previous theme remains untouched — no rollback is needed.
</Warning>

## Logs and Install History

Every install attempt is recorded in `Themes > Logs`, including:

* The theme ID and triggering admin.
* The final status (completed / failed) and the failure reason if any.
* Per-stage messages with timestamps, useful for diagnosing issues with a specific theme.

The logs view supports **auto-refresh** and **level filters** so you can watch a long install live.

## Third-Party Templates Features

Keep in mind that some third-party templates may not include all the features of the default theme. Make sure to check the **features** of the template before purchasing it.

<Check>
  MineStoreCMS provides a **default theme** that includes all the features of the platform. You can use the default theme if you want to have access to all the features of the platform.
</Check>
