How to source a theme from a private git repository

(Sam Saffron) #1

In some setups you may prefer that your site’s themes are in a private git repository.

To do so:

Use the clone with SSH link, not the one that starts with https


Select theme is in a private git repository:

Paste in the public key into your git repo so it is the used as a “deploy key”

Click “Import” and you are done :confetti_ball:

Discourse will remember the private key it generated and use it to access the git repo.

502 error while importing private theme
(Jean Christophe “Jice” Lavocat) #7

Hi @sam,
This is an awesome feature.
Can it work with any repository on Git?

I tried with, but Discourse returns a

Error cloning git repository, access is denied or repository is not found

I guess it comes from somewhere in my setup, but I just wanted to be sure that gitlab was ok.

(Vinoth Kannan) #8

Yes, it should work with any Git repo. But you must use the SSH clone URL like Also try by pulling the latest version of Discourse.

(Jean Christophe “Jice” Lavocat) #9

I just updated my Discourse (yet was just one commit behind).
I still get the error message.

Vinoth, let me know if I should open a new discussion, I’m probably polluting here… not sure. Tell me and I’ll delete my messages from here to repost them in a correct section.

(Vinoth Kannan) #10

Can you try it GitHub. If it worked then it must be GitLab specific issue.

Configuring custom private repo of discourse through docker
(Jean Christophe “Jice” Lavocat) #11

I have no private Github repo.
However, I face the same issue with Bitbucket private repo.

(Joe Buhlig) #12

I just ran into the same issue @tanzaho mentioned but with a private GitHub repo. I haven’t nailed down exactly what’s going on yet. I was able to install successfully on a local instance but it fails on production. @vinothkannans, there aren’t any relevant logs that I can find.

(Vinoth Kannan) #13

Now I am able to reproduce the issue in try using GitHub private repo itself. Let us check the issue.

(Vinoth Kannan) #14

@tanzaho @joebuhlig It is fixed as per commit