# 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:** 4
**Page:** 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.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 15, 2026, 4:40pm UTC](https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047/2 "2026-06-15T16:40:12Z")

</div>

> [@serkhelesheyi](#):
>
> fails with:
> 
> ```plaintext
> SSL connection timeout
> 
> ```

Is outbound https blocked somehow?

> [@serkhelesheyi](#):
>
> 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

It won’t be easy to rewrite all of the stuff that expects to be able to use https. I’m afraid having reliable networking is what you need to solve.

---

<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 18, 2026, 10:50am UTC](https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047/3 "2026-06-18T10:50:46Z")

</div>

Thanks for the clarification, Jay.

After additional diagnostics, it appears that outbound HTTPS is not blocked on the host itself — direct `curl` requests to GitHub and `raw.githubusercontent.com` succeed consistently. The issue only manifests inside the bootstrap container, where `git ls-remote` over HTTPS intermittently hits SSL timeouts. SSH-based access to GitHub remains fully reliable, which is why I initially explored whether a clean SSH path during bootstrap might be viable.

Your point about the difficulty of rewriting all components that assume HTTPS is well taken. Given that the HTTPS failures are tied to instability in my ISP’s route to GitHub rather than a local firewall or Docker networking issue, I’ll focus on stabilizing the upstream network path instead of trying to modify the bootstrap process.

Thanks again for the guidance and for clarifying the constraints around HTTPS usage in the build pipeline.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 18, 2026, 12:22pm UTC](https://meta.discourse.org/t/discourse-rebuild-fails-during-bootstrap-git-https-timeout-looking-for-a-clean-ssh-based-workaround/405047/4 "2026-06-18T12:22:12Z")

</div>

I think there’s a way to specify a proxy, so maybe you could point to a proxy that avoids using your isp network. It seems easier to find another isp, but life often isn’t as easy as we would like.
