Magento 2 uses the Composer dependency manager to install and manage its dependencies. Composer allows Magento 2 and its extensions to declare their dependencies, and then downloads and installs what is needed automatically. Magento 2 projects contain a composer.json file that lists the project dependencies, and Composer uses this file to install Magento 2 and all required third-party libraries in the vendor directory.