How to install magento 2.4.7 using composer

Step:1 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.7 mg247
//Folder name is mg247

Step:2 php bin/magento setup:install --base-url="http://test.mgpwa.com" --backend-frontname="admin" --session-save="files" --db-host="localhost" --db-name="xxxxxx" --db-user="xxxxxx" --db-password='xxxxxx' --admin-firstname="xxxxxx" --admin-lastname="xxxxxx" --admin-email="xxxxxx" --admin-user="xxxxxx" --admin-password="xxxxxx" --language=en_US --search-engine=elasticsearch7 --elasticsearch-host="localhost" --elasticsearch-port=9200 --use-rewrites=1

Step:3 php bin/magento setup:upgrade

Step:4 php bin/magento setup:di:compile

Step:5 php bin/magento setup:static-content:deploy -f

Step:6 php bin/magento c:cphp bin/magento c:f

Step:7 php bin/magento indexer:reindex

Step:8 sudo chmod -R 777 var

Step:9 sudo chmod -R 777 pub