Allow composer to install private Github repository

This article shows the step to setup composer to install private Github repository.


On Github

1) Go to settings -> Developer Settings -> Personal Access Tokens -> Fine-grained tokens

2) Clicks on the "Generate new token" button.

3) Select an expiry period

4) Select a specific repo.

5) Provide "Contents" read-only access.

6) Generate and copy the token.


On Target Machine

1) Setup composer auth config by using the following command.

php composer.phar config -g github-oauth.github.com <token>

 


AI Summary AI Summary
gpt-4.1-2025-04-14 2025-08-07 12:22:43
This article provides a step-by-step guide to configuring Composer to install packages from a private GitHub repository. It covers generating a personal access token with appropriate permissions on GitHub and setting up Composer authentication on your machine to securely access private repositories.
Chrome On-device AI 2025-08-07 12:22:44

Share Share this Post