What is Magento ?
Magento is opensource e-commerce platform, which provides online merchants with a flexible shopping cart system. Magento offers powerful marketing, search engine optimization, and catalog-management tools.
Basic system requirment of Magento 2.4.6
- Composer 2.x (view more about install composer in ubuntu)
- Elasticsearch 7.x or 8.x (view more about install elasticsearch in ubuntu)
- MySQL 8.0 & MariaDB 10.x (view more about install mysql in ubuntu)
- PHP 8.1 or PHP 8.2 (view more about install php in ubuntu)
- Apache 2.4 or Nginx 1.18 (view more about install apache in ubuntu)
- Minimum 2 GB RAM
Require these 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
- ext-sockets
- ext-xml
- ext-xmlreader
- ext-xmlwriter
- lib-libxml (DOMDocument)
Require Magento access keys
Magento access keys you can get from your account.
Magento Account > My profile > Marketplace >Access Keys
Download opensource Magento using composer
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .
Download Magento commerce using composer
composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition .
Install any specific Magento version
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.4.2
Give require permission to directory
We need to give correct permission to Magento directories by this below commands:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod -Rf 777 var
chmod -Rf 777 pub/static
chmod -Rf 777 pub/media
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod -Rf 775 bin
Create new database for Magento
We need to create empty database for new Magento setup.
mysql> CREATE DATABASE mag24;
Install Magento 2 using command
Before install we need to check elasticsearch is running and check MySQL server is running. Run the following lines in Command Line to install your Magento 2:
php bin/magento setup:install
--base-url="http://local.magento24.com/"
--db-host="localhost"
--db-name="mag24"
--db-user="root"
--db-password="root"
--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"
That’s all for installing Magento 2 in ubuntu.