🚀 The Fastest Way to Spin Up Magento + Warden + Hyvä on macOS & Linux (Introducing mage-mirror)

Published: (December 11, 2025 at 10:11 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

If you’ve ever tried setting up a fresh Magento 2 environment — or cloning a production store to debug something locally — you know the pain:

  • Long install times
  • Packages failing during Composer setup
  • OpenSearch errors
  • Warden mismatches
  • Missing PHP extensions
  • Admin login issues
  • Slow upgrade rehearsals

After years of repeating the same environment‑setup steps, I created mage‑mirror – a one‑command Magento + Warden + Hyvä installer.

GitHub:

In under 2 minutes, mage‑mirror sets up a complete Magento environment with:

  • Magento 2.4.x
  • Warden (Docker) stack
  • Hyvä theme (optional)
  • Sample data (optional)
  • Multi‑store routing
  • Composer configuration
  • OpenSearch auto‑fix
  • Admin auto‑creation
  • Remote sync & cloning
  • Upgrade mode

Running it is as simple as:

./_mage-mirror.sh

…and bam — Magento is ready.

A quick gif showing _mage-mirror.sh in action and the results of the local Hyva theme installed

Why Magento Local Development Is Still Too Hard

Magento is powerful… but heavy. Local setup often involves:

  • Installing PHP + Composer + MySQL manually
  • Dealing with permission issues
  • Fixing OpenSearch
  • Waiting 20–40 minutes for Composer to finish
  • Reindexing
  • Troubleshooting crypt keys
  • Patching configs
  • Creating stores and scopes

If you work with Magento professionally, the wasted hours add up fast. Hyvä makes frontend development dramatically faster, but the backend environment setup still bottlenecks teams. I wanted a tool that solved this cleanly.

What mage-mirror Automates

mage‑mirror is built for speed, repeatability, and zero frustration.

1. One Command = Full Magento Environment

./_mage-mirror.sh

The script:

  • Installs Warden (if missing)
  • Creates a project via Composer
  • Sets up Magento 2.4.x
  • Configures URLs and scopes
  • Creates an admin user
  • Deploys static assets
  • Compiles DI
  • Fixes file permissions
  • Loads sample data (optional)

Everything you need with zero manual steps.

2. Hyvä Theme Auto‑Setup (Optional)

Set the environment variable:

INSTALL_HYVA=yes

mage‑mirror imports the Hyvä theme (via OSS Composer mirrors), installs it, and activates it as the storefront.

3. Clone Existing Magento Projects (Local or Remote)

You can clone a production store, staging environment, client site, or QA snapshot using rsync, tar, remote mysqldump, or local SQL dumps.

USE_RSYNC_MAGENTO=yes
USE_REMOTE_DB_DUMP=yes

The store runs locally in minutes — not hours.

4. Magento Upgrade Mode

To test an upgrade from 2.4.x → 2.4.y:

UPGRADE_MAGENTO=yes
UPGRADE_MAGENTO_VERSION=2.4.*

mage‑mirror will:

  • Import your existing store
  • Adjust Composer version constraints
  • Run a full Composer update
  • Execute setup:upgrade
  • Reindex, compile, deploy, and patch configs as needed

A game‑changer for maintenance work.

5. Multi‑Store Routing (Preconfigured)

If enabled, mage‑mirror automatically maps:

mage.test      → Website A
app.mage.test  → Website B

It updates /etc/hosts, patches pub/index.php to set MAGE_RUN_CODE, sets base URLs, and configures scopes—no manual steps required.

6. OpenSearch Auto‑Fix (No More “No alive nodes found”)

Common error:

Could not validate a connection to OpenSearch. No alive nodes found.

mage‑mirror configures OpenSearch automatically:

catalog/search/engine = opensearch
hostname = opensearch
port = 9200
prefix = magento2

Then triggers a full reindex, eliminating the error.

Quick Start

git clone https://github.com/j-scriptz/mage-mirror
cd mage-mirror
chmod +x _mage-mirror.sh
./_mage-mirror.sh

You’ll have Magento running at:

  • (if multi‑store enabled)

Example Configurations

All settings live in _mage-mirror.config.

Quick Hyvä install

INSTALL_HYVA=yes
WITH_SAMPLE_DATA=no
USE_EXISTING_DB=no

Clone production store

USE_RSYNC_MAGENTO=yes
USE_REMOTE_DB_DUMP=yes
REMOTE_HOST=myserver
REMOTE_PATH=/var/www/magento

Upgrade mode

UPGRADE_MAGENTO=yes
UPGRADE_MAGENTO_VERSION=2.4.*

Who Should Use mage-mirror?

  • Magento agencies
  • Freelancers
  • Hyvä developers
  • Magento upgrade specialists
  • Contributors
  • Junior devs who need a one‑click setup
  • Teams seeking standardized local environments

If you touch Magento regularly, mage‑mirror saves you hours every week.

Bonus: Free Hyvä‑Compatible Subcategory Cards

During setup, you can auto‑install the Jscriptz Subcats module:

Great for storefront UX and Hyvä builds.

Want to Support the Project?

If mage‑mirror saved you time, the best ways to support it are:

  • Star the GitHub repo
  • Submit issues or PRs
  • Help spread the word in the Magento community

GitHub:

Final Thoughts

Magento development is complex — but local environments don’t have to be. mage‑mirror eliminates the recurring pain points and makes spinning up or cloning a Magento store as easy as running:

./_mage-mirror.sh
Back to Blog

Related posts

Read more »