Installing Magento 2 in 2026 is primarily a server and command-line task, not a simple web installer. Adobe now distributes current Adobe Commerce codebases through Composer, and Magento Open Source is also installed through Composer. Before starting, choose the exact supported Commerce release and match your PHP, database, search engine, web server, and other services to that release.
This guide focuses on a self-hosted installation. If you are using Adobe Commerce on Cloud, follow Adobe’s Cloud-specific deployment documentation instead because supported service versions and deployment steps differ.
Magento 2 installation at a glance
- Choose a supported Magento Open Source or Adobe Commerce release.
- Verify the server requirements for that exact release.
- Install PHP, the required PHP extensions, Composer, the database, OpenSearch or Elasticsearch where supported, and a web server.
- Create a dedicated Magento file-system owner and configure permissions.
- Obtain the required Composer authentication credentials for Adobe Commerce or the relevant package source.
- Create the Magento project with Composer.
- Create an empty database and database user.
- Run
bin/magento setup:install. - Configure HTTPS, cron, caching, email, backups, and production settings.
- Test the storefront, Admin, checkout, search, scheduled jobs, and deployment process.
1. Check the current Magento 2 system requirements
Do not copy a requirements list from an old Magento tutorial. Supported versions change, and Adobe only supports tested combinations of Commerce and its dependencies.
For the current 2.4.9 release line, Adobe’s 2026 documentation lists Composer 2.10, PHP 8.5, OpenSearch 3, MariaDB 12.3 for on-premises deployments, and other infrastructure components. Earlier supported release lines use different combinations. Verify the requirements for the exact version you intend to install before provisioning the server.
Typical requirements include:
- A supported Linux-based server environment for self-hosted production deployments.
- A PHP version supported by your selected Magento release.
- Required PHP extensions such as BCMath, cURL, DOM, GD, Intl, Mbstring, OpenSSL, PDO MySQL, SOAP, Sodium, XML, ZIP, and others listed by Adobe.
- MySQL or MariaDB in a version supported by the selected release.
- OpenSearch or Elasticsearch where supported by that Magento release. Magento 2.4 and later requires a dedicated search engine configuration.
- Composer in the version supported by the selected release.
- nginx or Apache configured for Magento.
- A working mail transport, cron service, and HTTPS certificate for production.
Important: Do not use the old requirements commonly found in legacy Magento 2 tutorials, such as PHP 5.x, Composer 1.x, or old Elasticsearch-only configurations.
2. Prepare the server and file-system owner
Magento should not be installed and operated as the Linux root user. Adobe recommends using a dedicated file-system owner for Magento commands and ensuring that the web-server process has the permissions it needs.
Create or identify the application user, configure the web-server group, and choose a secure application directory. Keep the Magento application outside publicly writable locations where practical, and configure the web server so that the site’s document root points to Magento’s pub directory.
3. Install Composer
Composer manages Magento’s PHP packages and dependencies. Confirm that the installed Composer version is supported by your selected Magento release.
composer --version
If Composer is not installed, use the official Composer installation instructions for your operating system rather than copying an old installer command from a third-party tutorial.
4. Get Magento through Composer
For Magento Open Source, Adobe’s current self-hosted installation documentation uses the Community Edition Composer project. Adobe Commerce uses the Enterprise Edition project and requires authentication keys for the Adobe Commerce Composer repository.
Example for Magento Open Source:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <install-directory-name>
Example for Adobe Commerce:
composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition <install-directory-name>
For a production installation, pin the project to the exact supported release or patch level you have selected rather than blindly installing whatever happens to be newest. Store Composer credentials securely using an appropriate auth.json configuration or environment-based secret management.
5. Create the Magento database
Create an empty database and a dedicated database user with the privileges required by Magento. Do not use a shared administrative database account for the application.
Record these values before installation:
- Database host
- Database name
- Database username
- Database password
- Optional table prefix
Make sure the database server version is one Adobe supports for your exact Magento release.
6. Configure file permissions
Magento needs specific directories to be writable by the appropriate web-server group. Adobe’s current installation documentation includes commands for setting group write permissions on directories such as var, generated, vendor, pub/static, pub/media, and app/etc.
Do not solve permission errors by making the entire Magento directory world-writable. Correct ownership and least-privilege permissions are safer and easier to maintain.
7. Install Magento with setup:install
Magento’s command-line installer creates the application configuration, connects the database, creates the Admin account, configures the store, and sets the search engine.
A simplified example is:
bin/magento setup:install \
--base-url=https://example.com/ \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password='REPLACE_WITH_SECURE_PASSWORD' \
--admin-firstname=Admin \
--admin-lastname=User \
[email protected] \
--admin-user=admin \
--admin-password='REPLACE_WITH_SECURE_PASSWORD' \
--language=en_US \
--currency=USD \
--timezone=America/New_York \
--use-rewrites=1 \
--search-engine=opensearch \
--opensearch-host=localhost \
--opensearch-port=9200
Use the search-engine options that match the search service supported by your selected Magento release. Do not copy the exact OpenSearch, Elasticsearch, PHP, or database version from another tutorial without checking Adobe’s current compatibility table.
Adobe also recommends allowing the installer to generate a random Admin URI instead of choosing a predictable backend path. Store the generated Admin URL securely.
8. Configure the web server correctly
Magento should be served through its pub directory rather than exposing the project root directly. Configure nginx or Apache according to Adobe’s official Magento web-server guidance, including URL rewriting and PHP handling.
For production, use HTTPS from the start. Confirm that the base URL, secure base URL, redirects, cookies, and any reverse proxy or CDN configuration are consistent.
9. Set up cron and background jobs
Magento relies on scheduled tasks for important background work. Configure cron for the Magento file-system owner and verify that jobs are running successfully.
After installation, check:
bin/magento cron:run
For production, also verify the server’s actual cron configuration and Magento’s scheduled job status rather than assuming that a successful command means cron is permanently configured.
10. Complete the post-install configuration
A successful installer run is only the beginning. Before launching the store, configure and test:
- HTTPS: Install and validate the TLS certificate and force secure storefront and Admin traffic.
- Search: Confirm product search, indexing, and search-service connectivity.
- Caching: Configure the appropriate Magento cache and production caching architecture.
- Admin security: Use strong credentials, appropriate Admin users, least privilege, and the generated Admin URI.
- Email: Configure a reliable transactional email service and test order, account, and password-reset messages.
- Backups: Back up both the database and required application/media data, and test restoration.
- Monitoring: Monitor application errors, PHP errors, database health, disk space, search service health, cron failures, and performance.
- Deployment: Keep application code and configuration under version control where appropriate and use a repeatable deployment process.
Common Magento 2 installation problems
| Problem | Likely area to check |
|---|---|
| Composer cannot download packages | Repository credentials, package name, version constraint, network access, or Composer compatibility. |
| PHP extension error | Compare installed PHP extensions with the requirements for the exact Magento release. |
| Database connection failure | Database host, credentials, permissions, firewall, and supported database version. |
| Search installation error | Search service availability, host/port, supported version, and Magento configuration. |
| Permission denied | File-system ownership and group permissions. Avoid making the entire application world-writable. |
| Admin or storefront returns 404 | Web-server document root, rewrite configuration, generated files, and cache. |
| Scheduled tasks do not run | Magento cron configuration, Linux cron, file-system owner, and cron logs. |
Magento 2 installation checklist
- Exact Magento release selected and supported.
- PHP and required extensions verified.
- Composer version verified.
- Database version verified.
- OpenSearch or Elasticsearch requirement verified.
- Dedicated application/file-system user configured.
- Composer authentication configured securely where required.
- Database and application credentials stored securely.
- Magento installed with
bin/magento setup:install. - Web server points to
pub. - HTTPS works correctly.
- Cron is configured and producing successful runs.
- Search, catalog, cart, checkout, customer accounts, email, and Admin have been tested.
- Backups and restoration procedures have been tested.
Should you install Magento 2 yourself?
Magento 2 is a capable enterprise ecommerce platform, but self-hosting requires more operational responsibility than a managed ecommerce service. If your team is comfortable with Linux, PHP, Composer, databases, search infrastructure, web servers, security, backups, and deployment, a self-hosted installation can provide significant control.
If you do not have that operational capability, consider a managed hosting or implementation partner that can own infrastructure, patching, monitoring, backups, and deployment. The right choice depends on your store’s traffic, integrations, customization, security requirements, internal skills, and operational budget.
Final thoughts
The biggest mistake with Magento installation guides is treating a five-year-old requirements list as if it were still valid. In 2026, the safer approach is to start with the exact Magento release, follow Adobe’s compatibility matrix, install through Composer, use least-privilege permissions, configure search and cron correctly, and test the complete ecommerce workflow before launch.
For the authoritative installation process and current compatibility information, use Adobe’s Quick Start on-Premises Installation documentation, System Requirements, and PHP Settings and Extensions.

