# Discourse Rebuild Fails During Bootstrap: Git HTTPS Timeout, Looking for a Clean SSH-Based Workaround

**URL:** https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047
**Category:** Support
**Tags:** install
**Created:** [June 11, 2026, 9:16am UTC](https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047 "2026-06-11T09:16:20Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![serkhelesheyi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/serkhelesheyi/32/497726_2.png) [@serkhelesheyi](https://meta.discourse.org/u/serkhelesheyi)
#### Post date: [June 11, 2026, 9:16am UTC](https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047/1 "2026-06-11T09:16:20Z")

</div>

Hello,

I am running a standard self-hosted Discourse installation on Ubuntu using the official `discourse_docker` setup.

## Environment

- Ubuntu Server
- Docker
- Official `discourse_docker`
- Single-container installation (`app.yml`)
- Rebuild performed using:

```bash
cd /var/discourse
./launcher rebuild app

```

## Problem

The rebuild process fails during the bootstrap phase when Discourse attempts to update the application source from GitHub.

The failure occurs at:

```plaintext
git fetch --tags --prune-tags --prune --force origin

```

and produces:

```plaintext
fatal: unable to access 'https://github.com/discourse/discourse.git/': SSL connection timeout

```

followed by:

```plaintext
FAILED
bootstrap failed with exit code 128

```

## Important Findings

### GitHub is reachable via HTTPS

On the host:

```bash
curl -I https://github.com

```

works correctly.

Also:

```bash
curl -I https://raw.githubusercontent.com

```

works correctly.

### Git over HTTPS is unreliable in my environment

Inside the Discourse environment:

```bash
git ls-remote https://github.com/discourse/discourse.git

```

fails with:

```plaintext
SSL connection timeout

```

From my investigation, this appears to be caused by issues with my Internet provider’s connectivity to GitHub over HTTPS. At the moment, I am not trying to solve that networking problem itself. Instead, I am looking for a way to perform Discourse rebuilds using SSH, since SSH connectivity to GitHub works correctly in my environment.

### GitHub SSH authentication works

I generated a new SSH key, added it to GitHub, and verified authentication:

```bash
ssh -T git@github.com

```

returns:

```plaintext
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.

```

Also:

```bash
git ls-remote git@github.com:discourse/discourse.git

```

works successfully from the host.

### Repository URLs

On the host, I changed `/var/discourse` to use SSH:

```plaintext
origin git@github.com:discourse/discourse_docker.git

```

and Git operations work.

However, inside the Discourse application container:

```bash
cd /var/www/discourse
git remote -v

```

shows:

```plaintext
origin https://github.com/discourse/discourse.git

```

So during bootstrap, Discourse still attempts to use HTTPS.

## What I Would Like To Achieve

My primary goal is to make Discourse rebuild reliably in an environment where GitHub HTTPS connections are unstable or frequently time out.

I would like to know:

1. Is there an officially supported way to make Discourse bootstrap and rebuild use GitHub over SSH instead of HTTPS?
2. If not, what is the recommended approach for environments where Git HTTPS is unreliable but SSH works correctly?
3. Is there a supported method to inject SSH credentials into the bootstrap/build phase?
4. Has anyone successfully configured `discourse_docker` to fetch Discourse source updates over SSH?

I would prefer a solution that survives future upgrades, but I am also interested in understanding whether SSH-based fetching during bootstrap is technically supported.

Any guidance would be greatly appreciated.

Thank you.

---

_[View the full topic](https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047)._
