# Installing a theme from a private Git repository

**URL:** https://meta.discourse.org/t/installing-a-theme-from-a-private-git-repository/82584
**Category:** Site Management
**Tags:** how-to, customization
**Created:** [March 9, 2018, 5:56am UTC](https://meta.discourse.org/t/installing-a-theme-from-a-private-git-repository/82584 "2018-03-09T05:56:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [March 9, 2018, 5:56am UTC](https://meta.discourse.org/t/installing-a-theme-from-a-private-git-repository/82584/1 "2018-03-09T05:56:01Z")

</div>

> 🔖 This guide explains how to install a Discourse theme or theme component from a private GitHub repository.
> 
> 🙋 Required user level: Administrator

## Summary

This documentation covers the process of installing a Discourse theme or theme component from a private GitHub repository. It includes steps for generating and using SSH keys for secure access. You will need to have administrator access to both your Discourse instance and the GitHub repository you are installing. This is how you can use your own private themes and theme components on your forum.

## Prerequisites

Before you begin, ensure you have:

- Administrator access to your Discourse instance
- A private Git repository containing your theme or component
- Access to add deploy keys to your Git repository (admin/owner level)

## Step-by-step guide

1. Go to your private GitHub repository and copy the SSH address from the Clone SSH tab.

 ![Screenshot 2024-09-13 at 6.36.50 PM](https://global.discourse-cdn.com/meta/original/4X/d/1/a/d1ada13de150bd1040a7cc55964e699c8c3bf239.png)  
  
2. Navigate to your Discourse admin panel.   
  
3. In the admin sidebar, go to `Appearance` \> `Themes and components`, then select the `Themes` or `Components` tab (depending on which you are installing).   
  
4. Click on `Install` and then select `From a git repository`.

 ![The image shows a graphical user interface with a dark theme, displaying an installation dialog for a repository containing theme. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/c/c/ecc1b0274a48c19b8f1a372359a6ac7836d63ba0.png)   
  
5. Paste the SSH address you copied from the private repository in step 1. It should be in the format: `git@github.com:USERNAME/REPO-NAME.git`.

> ⚠ Make sure to use the **clone with SSH** link, not the one that starts with `https`

  
6. An SSH key is automatically generated and displayed in a new text box.

 ![Screenshot 2024-09-13 at 6.37.57 PM](https://global.discourse-cdn.com/meta/original/4X/4/0/4/4048f2cd710d5ee0c458f50aa288e4c9b855ff99.png)   
  
7. Click the copy icon in the top right corner of that box to copy the new SSH key. **Do not click install or close this modal yet.**   
  
8. Now go to your private GitHub repository settings (e.g., on GitHub, go to `Settings` \> `Deploy keys`)

 ![Screenshot 2024-09-13 at 6.43.12 PM](https://global.discourse-cdn.com/meta/original/4X/b/b/a/bba6f4f26e185f7aa1813499e0d39bb9eb3b45ac.png)   
  
9. Add a new deploy key. You will have to give it an appropriate title. Paste the SSH key you copied from Discourse into the deploy key field.

 ![This image shows a computer screen displaying a user interface for adding new deployment keys. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/9/d/9/9d9beda76fc3313ffeacb2736e887a48c4bb20b1.png)   
  
10. Click `Add key` to save the deploy key in your Git repository settings.

 ![The image shows a screenshot of a computer interface with the title "Deploy keys" and an option to add more keys. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/a/b/eabcb9dcab366dddf2dfa15b835a9702ce5c1748.png)   
  
11. Return to the Discourse theme installation modal and click the `Install` button. You should now see your new theme or component settings page.

 ![Screenshot 2024-09-13 at 6.39.18 PM](https://global.discourse-cdn.com/meta/original/4X/b/7/6/b7686e1acfacb605071e2adf87898e2d7325b533.png)

* * *

## Best practices

- Always use the SSH URL for your repository, not the HTTPS URL.
- Keep your deploy keys secure and don’t share them publicly.
- Regularly update your theme or components to ensure you have the latest features and security updates.

## FAQs

**Q: Can I use this method with Git providers other than GitHub?**  
A: Yes, this method should work with any Git provider that supports deploy keys or SSH authentication.

**Q: Will Discourse remember the SSH key for future updates?**  
A: Yes, Discourse will store the generated private key and use it for future access to the Git repository.

**Q: Can I change the private repository later?**  
A: Yes, you can update the repository URL in the theme settings if needed.

## Additional resources

- [Managing deploy keys - GitHub Docs](https://docs.github.com/en/developers/overview/managing-deploy-keys)

\*_SSH keys used in this topic were only generated for this documentation_

> Last edited by @Lilly 2025-01-30T20:00:09Z
> 
> Last checked by @Lilly 2025-02-26T15:02:26Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 18, 2024, 6:16am UTC](https://meta.discourse.org/t/installing-a-theme-from-a-private-git-repository/82584/20 "2024-06-18T06:16:47Z")

</div>

3 posts were split to a new topic: [Why is the ‘private repository’ option not showing up?](https://meta.discourse.org/t/why-is-the-private-repository-option-not-showing-up/312494)
