Is there a problem that needs an urgent fix?Urgent fix?Get emergency help →
Blog

Practical Magento 2 guides on upgrades, security, speed and migration, written by the MageBooster team.

Magento installation: how to install Magento 2.4.9 step by step

Step-by-step Magento installation guide for 2.4.9: requirements, Composer keys, setup:install with OpenSearch, permissions, cron and production mode.
Developer writing Magento code in an office

In short

A Magento 2.4.9 installation needs PHP 8.5, Composer 2.10, MariaDB 12.3 or MySQL 8.4, and OpenSearch 3, according to Adobe’s tested requirements. You download the code with composer create-project from repo.magento.com using your access keys, set file permissions, run bin/magento setup:install with your database and OpenSearch details, then install cron and switch to production mode.

This guide walks through a Magento installation for version 2.4.9 on a Linux server, step by step. Every requirement and command below comes from Adobe’s official installation guide on Experience League. If you have asked yourself “Magento, how to install it properly?”, this is the order we follow on client servers.

It assumes you have SSH access, root or sudo rights, and a domain pointing to the server. For a local test install, the same steps work inside a container or VM.

Magento installation requirements for 2.4.9

Magento Open Source and Adobe Commerce 2.4.9 were released on May 12, 2026. Adobe only supports the exact service combinations it has tested. For on-premises 2.4.9, the system requirements table lists:

ServiceTested version for 2.4.9
PHP8.5
Composer2.10
MariaDB / MySQLMariaDB 12.3 or MySQL 8.4
Search engineOpenSearch 3
Cache / sessionsValkey 9
Message queueRabbitMQ 4.3 (ActiveMQ Artemis 2 also listed)
Full-page cacheVarnish 8
Web servernginx 1.30

Adobe notes that its support team may ask you to align with a listed combination before investigating issues. For a production store, stay within this table.

PHP extensions and settings

Magento Open Source requires these PHP extensions: bcmath, ctype, curl, dom, fileinfo, filter, ftp, gd, hash, iconv, intl, json, libxml, mbstring, openssl, pcre, pdo_mysql, reflection, simplexml, soap, sockets, sodium, tokenizer, xmlwriter, xsl, zip and zlib. Check what you have with:

php -v
php -m

In php.ini, set date.timezone, raise memory_limit (Adobe’s example uses 2G), and set the realpath cache:

memory_limit = 2G
realpath_cache_size = 10M
realpath_cache_ttl = 7200

Step 1: Prepare the database and OpenSearch

Create an empty database and a dedicated user:

mysql -u root -p
CREATE DATABASE magento;
CREATE USER 'magento'@'localhost' IDENTIFIED BY 'a-strong-password';
GRANT ALL ON magento.* TO 'magento'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Since Magento 2.4, every installation must use Elasticsearch or OpenSearch for catalog search, and the search engine must be running before you install. For 2.4.9 that means OpenSearch 3. Confirm it responds before moving on:

curl -X GET "http://localhost:9200/"

If OpenSearch runs on a different host, Adobe recommends putting it behind a TLS reverse proxy with HTTP Basic authentication instead of exposing port 9200.

Step 2: Get your access keys

Magento is installed from Adobe’s Composer repository at repo.magento.com. You need a pair of access keys:

  1. Log in to the Commerce Marketplace.
  2. Open My Profile > Access Keys and create a new pair.
  3. When Composer asks for a username, use the public key. For the password, use the private key.

If you store the keys in Composer’s auth.json, you won’t be prompted.

Step 3: Download Magento 2.4.9 with Composer

Switch to the file system owner (the user that owns the web root, not root), go to your web root, and create the project. To install Magento 2 Open Source at a specific version:

cd /var/www
composer create-project --repository-url=https://repo.magento.com/ \
  magento/project-community-edition=2.4.9 magento2

For Adobe Commerce, use magento/project-enterprise-edition instead. If you see “Could not find package” errors, check the command for typos and confirm your keys have access to that edition.

Step 4: Set file permissions

The web server group needs write access to a few directories before installation. Adobe’s quick-start guide uses these commands (Ubuntu example with www-data):

cd /var/www/magento2
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data .
chmod u+x bin/magento

Do not use chmod 777. It is a common shortcut in tutorials and a real security risk on a live server.

Step 5: Run setup:install

This is the core of the Magento 2.4.9 install. Run it from the Magento root:

bin/magento setup:install \
  --base-url=https://www.example.com/ \
  --db-host=localhost \
  --db-name=magento \
  --db-user=magento \
  --db-password='a-strong-password' \
  --admin-firstname=Jane \
  --admin-lastname=Doe \
  [email protected] \
  --admin-user=jane.admin \
  --admin-password='Use-a-long-passphrase-1' \
  --language=en_US \
  --currency=USD \
  --timezone=America/Chicago \
  --use-rewrites=1 \
  --search-engine=opensearch \
  --opensearch-host=localhost \
  --opensearch-port=9200 \
  --opensearch-index-prefix=magento2 \
  --opensearch-timeout=15

A few options worth understanding:

  • –base-url needs the scheme and a trailing slash.
  • –admin-password must be at least 7 characters with letters and numbers. Use something much longer and wrap it in single quotes.
  • –backend-frontname sets the admin path. Adobe recommends leaving it out so the installer generates a random one. The admin URL is printed at the end, and you can show it later with bin/magento info:adminuri.
  • –use-secure=1, –base-url-secure and –use-secure-admin=1 enable HTTPS for the storefront and admin. All three are needed.
  • bin/magento info:language:list, info:currency:list and info:timezone:list show valid values.

The installer can be run again to correct mistakes or add SSL settings later. For the full list of options, run bin/magento help setup:install.

Step 6: Install cron

Magento depends on cron for indexing, emails, sitemaps, currency rates and more. Install the Magento crontab as the file system owner:

bin/magento cron:install
crontab -l

The command writes its entries between #~ MAGENTO START and #~ MAGENTO END markers and leaves your other cron jobs alone. Use --force to rewrite an existing Magento block.

Step 7: Switch to production mode

A fresh install runs in default mode. For a live store, switch to production mode, which compiles code and deploys static files:

bin/magento deploy:mode:set production
bin/magento deploy:mode:show

Use developer mode on local and staging environments where you are actively changing code.

Step 8: Magento installation checklist after setup

  • Point your nginx virtual host at pub/ as the document root, using the sample nginx.conf.sample shipped with Magento.
  • Configure Valkey for cache and sessions, and Varnish for full-page cache.
  • Set up outgoing email so admin two-factor authentication and customer emails work.
  • Run bin/magento indexer:reindex and bin/magento cache:flush, then load the storefront and admin.
  • Set up backups and monitoring before you import products.

Prefer to watch it done? Our free Magento video tutorials cover installation and setup. If you would rather not manage PHP 8.5, OpenSearch, Valkey and Varnish yourself, our managed Magento hosting delivers a ready, tuned 2.4.9 environment.

Common Magento installation errors

  • Could not find package. Usually a typo in the package name or version, or access keys that are not entitled to that edition. Check the command and your keys in the Commerce Marketplace.
  • Search engine connection errors during setup:install. OpenSearch is not running, or the host, port or credentials are wrong. Test it with curl from the web server before re-running the installer.
  • Permission denied on var, generated or pub/static. The commands were run as root, or the web server group does not own the files. Re-apply the permissions from Step 4 as the file system owner.
  • Missing PHP extension. Composer or the installer names the missing extension. Install it with your package manager, restart PHP-FPM and confirm with php -m.

Because the installer can be run multiple times, you can fix the cause and run setup:install again. By default it does not overwrite an existing database; the --cleanup-database option changes that.

Frequently asked questions

Can I install Magento 2.4.9 on shared hosting?

Usually not. You need SSH, Composer, PHP 8.5 with specific extensions, and a running OpenSearch service. Most shared hosting plans do not offer that combination.

Is Elasticsearch still supported?

Adobe’s search engine guide says installations must use Elasticsearch or OpenSearch, but the 2.4.9 requirements table lists only OpenSearch 3. Use OpenSearch for new 2.4.9 installs.

Can I use Apache instead of nginx?

The 2.4.9 requirements table lists nginx 1.30 and does not list Apache. Apache may still work, but nginx is the tested and supported option.

What is the difference between installing Open Source and Adobe Commerce?

The steps are the same. The difference is the metapackage (project-community-edition or project-enterprise-edition) and whether your access keys are licensed for Adobe Commerce.

Installed, but not sure it’s production-ready?

We will check your stack versions, security settings, caching and cron setup against Adobe’s 2.4.9 requirements.

Get a free Magento store audit

Sources

Free Site Audit

Send your store details. We check speed, security and extensions, then reply with three quick wins within 3 working days.

Let's talk

Get a quote

Tell us about your store and we’ll reply within one working day. Prefer to chat? Say hello from WhatsApp