Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Composer install private repositories



I have project which require in composer my private package from bitbucket.


I have following pipeline in my bitbucket-pipeline yml file


- step:
- apt-get -y install openssh-server
- echo $PRIVATE_KEY > ~/.ssh/id_rsa.tmp
- base64 -d ~/.ssh/id_rsa.tmp > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- base64 ~/.ssh/id_rsa
- chmod 600 ~/.ssh/config
- chmod 700 ~/.ssh
- apt-get install git -y
- apt-get install -y php7.1-cgi
- apt-get install -y php7.1-json
- composer install
- sh bin/cli/


But in time of installation my private repository by composer I get following error:



 Failed to execute git clone --no-checkout ''
'/opt/atlassian/pipelines/agent/build/vendor/krajcik/cms-banner-module' && cd '/opt/atlassian/pipelines/agent/build/vendor/krajcik/cms-banner-module' && git remote add composer '' && git fetch composer
Cloning into '/opt/atlassian/pipelines/agent/build/vendor/krajcik/cms-banner-module'... Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.  


In my environment variables in butbucket I have variable PRIVATE_KEY with ssh key in base64. Key was generated without passphrase.


When I execute:

composer install

 on my computer with same ssh key then everything execute successfully but in bitbucket throw error.


Can you help we with my issue?


Thank you very much :-)

1 answer

0 votes
Linette Atlassian Team Oct 07, 2018

You could add your SSH key to pipelines specifically following this guide:


The section at the bottom about multiple keys looks quite like what you are already doing, and so, if you expand that section, check through that you've done each step, especially step 5...

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,897 views 68 21
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you