If you want to insall Magento 2 version using composer then follow these three simple steps. You must install the composer first then follow these simple steps to install Magento, otherwise first insall the composer.

Let’s start

Step 01:
To install magento 2 open source (community) version:
[code]composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition "install-directory-name" [/code]

To install magento 2 commerce version:
[code]composer create-project –repository-url=https://repo.magento.com/ magento/project-enterprise-edition "install-directory-name" [/code]

To install latest magento 2 open source (community) version:
[code] composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition . [/code]

To install spacific version of magento 2 open source (community) version:
[code] composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.3[/code]

Step 02:
Create database
[code]echo "CREATE DATABASE magento2_db" | mysql -u[mysql-user-name] -p[/code]

Step 03:

php bin/magento setup:install
–base-url=”http://magento-domain-name.com/”
–db-host=”localhost”
–db-name=”magento2_db”
–db-user=”db-user-name”
–db-password=”db-password”
–admin-firstname=”admin”
–admin-lastname=”admin”
–admin-email=”[email protected]
–admin-user=”admin”
–admin-password=”password123″
–language=”en_US”
–currency=”USD”
–timezone=”America/Chicago”
–use-rewrites=”1″
–backend-frontname=”admin”