Operating Systems:
- Linux x86-64
- CentOS
- Ubuntu
- Debian
Note: Magento is not supported on Microsoft Windows and macOS
Memory
2GB or more of RAM
Web Service
- Apache 2.4 (must enable ‘mod_rewrite’ & ‘mod_version’ modules)
- Nginx 1.x
Database
- MySQL 8.0
PHP Version
- 7.4.0
PHP Extensions
- ext-bcmath
- ext-ctype
- ext-curl
- ext-dom
- ext-gd
- ext-hash
- ext-iconv
- ext-intl
- ext-mbstring
- ext-openssl
- ext-pdo_mysql
- ext-simplexml
- ext-soap
- ext-xsl
- ext-zip
Required system dependencies
Magento requires the following system tools for some of its operations:
Elasticsearch
As of Magento 2.4.0, MySQL is no longer used for search. You must use Elasticsearch. Magento supports Elasticsearch 7.6.x.
SSL
- A valid security certificate is required for HTTPS.
- Self-signed SSL certificates are not supported.
- Transport Layer Security (TLS) requirement – PayPal and repo.magento.com both require TLS 1.2 or later
Mail Server
- MTA (mail transfer agent)
- SMTP server
Other Packages
- Composer (Latest Version)
- Php_xdebug 2.2.0+
- PHPUnit 4.1+
Magento 2 Installation Via Composer
Follow the below step-by-step guide to Install Magento 2 using Composer, You can also find the official documentation here.
Steps to Install Magento 2 with Composer
- Install Composer
- Download Magento 2
- Set Up Permissions for Magento
- Create the Database
- Install Magento 2
Install Composer
You can skip this step if you’ve already installed the Composer. (Windows users can use Installer)
1 2 |
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer |
Download Magento 2
Run the following Command in the root directory of the project:
1 |
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition . |
Note: You’ll need Authentication Keys to Download Magento 2 via Composer. Follow the steps from Official Documentation to get you Authentication Keys.
Set Up Permissions for Magento
Now, you should set the correct permissions on the entire Magento 2 installation directory
1 2 3 4 5 6 7 8 |
cd < your Magento install dir > find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; find ./pub/media -type d -exec chmod 777 {} \; find ./pub/static -type d -exec chmod 777 {} \; chmod 777 ./var chmod 777 ./generated chmod 777 ./app/etc |
Create the Database
It is assumed that you already have a MySQL user with the correct permissions. You can also use an existing blank database in the installation process.
1 |
echo "CREATE DATABASE magento2" | mysql -u[mysqluser] -p |
Install Magento 2
Use below command to install Magento 2 after changing the base URL and database credentials
1 |
php bin/magento setup:install --base-url="http://yourdomain.com/" --db-host="localhost" --db-name="database-name" --db-user="database-user" --db-password="database-password" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user@example.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" |
Please Note: Magento no longer supports Installation via Web