How do I manage custom modules? I have planned to use Composer to manage Drupal core and third-party modules instead of pushing everything to Git and I am using drupal-composer/drupal-project to achieve it.

After running composer create-project drupal-composer/drupal-project:7.x-dev d7 --stability dev --no-interaction, a d7 directory is created with some other directories, including the following ones.


vendor 
web (It contains the Drupal core files.)


Its composer.json file is enough to install the same dependencies in another server, but if I use composer install in my server, how can I checkout my custom modules?

If I add custom modules and the composer.json file only in my repository, where do the custom modules go when I run during composer install? Do they go in sites/all/custom or the root directory?

Is there any other option available to manage my custom modules with Composer?
The contributed modules are in web/sites/all/modules/contrib/.

So, the suggested directory for the custom modules is web/sites/all/modules/custom/.

The other way to manage custom modules is to separate repository for the custom modules.

You can add your custom repositories to your composer.json in project root directory. Composer will look in all your repositories to find the packages your project requires. See Use PHP composer to clone git repo. Add your repositories under default Drupal.

After you add your repository to composer.json you have to tell Composer to install your custom modules to web/sites/all/modules/custom/. Add this line to installer-paths

"web/sites/all/modules/custom/{$name}/": ["type:drupal-custom-module"],


When you create your custom module, you must set type of your custom module in composer.json  to drupal-custom-module.