Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nickdavies07's avatar

Adding Multiple Github Accounts to Forge

Is it possible to add multiple Github accounts to Laravel Forge?

I have an additional account I'd like to set up to pull repositories from separate to my own account that is already connected to Forge.

I have tried the following:-

  1. Create new SSH key on server
  2. Copy SSH public key to Github
  3. Create new site on Forge
  4. Choose 'Custom' source control
  5. Enter [email protected]:user/repo.git

However I get the following error message:-

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Any help is greatly appreciated!

0 likes
4 replies
Screenbeetle's avatar

@nickdavies07 - I'm going to help bump this as I've been having the same issue this week on Forge / Digital Ocean. I've tried all that suggestions that come up in searches - as you seem to have - but nothing gives .. I get the same error as you.

My work around at the moment is just to ssh into the server and do a https based git clone to set up the repo and then git pull to deploy. That works but it's a hassle

1 like
nickdavies07's avatar

@SCREENBEETLE - I didn’t unfortunately. I re-tried the steps I mentioned above and got it to work but it seemed to work sporadically. Our end solution was to just create a single GitHub account for our workplace and use that. Would have loved a solution to this though.

emilianotisato's avatar

For anyone still interested, I did get it working with the following steps. First explain what forge does when you connect your source control account (being github, bitbucket, etc).

I'll use github here as a demo. This is what forge does when you activate "Quick deploy" in a forge site:

  1. Forge set up your server ssh public key in your github user, so your server has access to do pull request

  2. Forge put a webhook in your github project with a specific forge URL that has a token, and that allow forge to run your deployment script when someone hit that url (that is github when detect a new commit)

So you need to manually do those 2 steps:

  1. Log in through ssh into your serve using your forge user.
  2. Get your public server ssh key with this command cat ~/.ssh/id_rsa.pub (your public key may be in other place if you do not create the server through forge, but that is a standard place)
  3. In your new github account go and load that key as a deploy key in your repo config, or better as a user level key if you have more than one project in that server.

That cover the first point, now for the second:

  1. In your forge app project page (site) you'll have a "Deployment Trigger URL" section, ignore all the url but copy only the token in it. Add that token to this new url format https://forge.laravel.com/github/push/ in sach a way that you end up with this webhook url https://forge.laravel.com/github/push/your_token_goes_here
  2. In your github repo config page, go to "webhook" section and add one with the following setup:
  • Payload URL => your full push URL from last step
  • Content type => application/json
  • Secret => leve it empty
  • SSL verification => enabled
  • "Which events would you like to trigger this webhook?" => Just the push event.

Finally check the "Active" checkbox and create the webook

Test it by commiting something

1 like

Please or to participate in this conversation.