This is a beta release of documentation for Magento 2.4, published for previewing soon-to-be-released functionality. Content in this version is subject to change. Links to the v2.4 code base may not properly resolve until the code is officially released.
You must install Elasticsearch before installing Magento Commerce or Magento Open Source 2.4.0. See Elasticsearch for details.

Prerequisites

Before you begin

Before you install Magento, you must do all of the following:

  • Set up one or more hosts that meet the Magento system requirements.
  • If you are setting up more than one web node with load balancing, set up and test that part of your system before you install Magento.
  • Make sure you can back up your entire system at various points during the installation so you can roll back in the event of issues.

We assume you’re installing the Magento 2 software in a development environment, which means you have root user access to the machine and that the machine does not need to be highly secure. If you are setting up a more secure machine, we strongly recommend you consult a network administrator for additional assistance.

We strongly recommend you update and upgrade your operating system software. These upgrades can provide security and software fixes that might prevent future problems. Do not know what any of this means? Check out our installation overview page.

Enter the following commands as a user with root privileges:

  • Ubuntu

    1
    
    apt-get update
    
    1
    
    apt-get upgrade
    
  • CentOS

    1
    
    yum -y update
    
    1
    
    yum -y upgrade
    

Prerequisite check

To check your system for prerequisites, enter the following commands:

Apache

CentOS: httpd -v

Ubuntu: apache2 -v

Magento supports Apache version 2.4 as the following result indicates:

1
2
Server version: Apache/2.4.0 (Unix)
Server built:   Jul 23 2017 14:17:29

To install or upgrade Apache, see Apache.

PHP

Magento 2.4 supports PHP 7.3, but we recommend using PHP 7.4.

1
php -v

Supported PHP versions:

You must run PHP version 7.3 or 7.4:

1
2
3
PHP 7.3.0 (cli) (built: Aug 14 2019 16:42:46) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.6, Copyright (c) 1999-2018, by Zend Technologies

See [PHP][] for info on PHP requirements.

MySQL

1
mysql -u <database root user or database owner name> -p

For example:

1
mysql -u magento -p

You must run MySQL version 5.7.9 or later as the following result indicates:

1
2
3
4
5
6
7
8
9
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 871
Server version: 5.7.9 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

Enter exit at the mysql> prompt to exit.

To install or upgrade MySQL, see MySQL.

Elasticsearch

1
curl -XGET '<elasticsearch-hostname>:<elasticsearch-port>'

For example:

1
curl -XGET 'localhost:9200'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "name" : "Z0S2B05",
  "cluster_name" : "elasticsearch_myname",
  "cluster_uuid" : "V-kpikRJQHudN-Wzdt-IrQ",
  "version" : {
    "number" : "6.8.7",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "c63e621",
    "build_date" : "2020-02-26T14:38:01.193138Z",
    "build_snapshot" : false,
    "lucene_version" : "7.7.2",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"

Next step

Choose how to install the Magento software

Related topics