# Discourse rebuild fails with port 443 in use

**URL:** https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615
**Category:** Support
**Tags:** unsupported-install
**Created:** [1 december 2016 om 05:44 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615 "2016-12-01T05:44:45Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [1 december 2016 om 05:44 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/1 "2016-12-01T05:44:45Z")

</div>

Yesterday discourse stopped working, when you try to run the command

`/var/discourse# ./launcher rebuild app` is an error.

` Error response from daemon: driver failed programming external connectivity on endpoint app (fc5fe43d9a3baadebc8c50fe62b740c08a65fe197697f6fb10e010541e390474): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use.`

[http://pastebin.com/TB8gzv5p](http://pastebin.com/TB8gzv5p)

My app.yml  
[http://pastebin.com/WNp5tMk7](http://pastebin.com/WNp5tMk7)

When trying to enter the site, I get the error “SEC\_ERROR\_EXPIRED\_CERTIFICATE”

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [1 december 2016 om 05:48 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/2 "2016-12-01T05:48:32Z")

</div>

Is it related to Let’s Encrypt issues?

---

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [1 december 2016 om 05:54 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/3 "2016-12-01T05:54:58Z")

</div>

> [@codinghorror](#):
>
> Is it related to Let’s Encrypt issues?

Yes, Let’s Encrypt said that the certificate is completed

Your certificate (or certificates) for the names listed below will expire in 9 days (on 29 Nov 16 04:54 +0000). Please make sure to renew your certificate before then, or visitors to your website will encounter errors.

I tried to update the team  
root@user:/var/discourse# rm -rf /var/discourse/shared/standalone/ssl  
root@user:/var/discourse# rm -rf /var/discourse/shared/standalone/letsencrypt  
root@user:/var/discourse# ./launcher rebuild app

I tried to update it with the command  
But it didn’t help(

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [1 december 2016 om 13:18 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/4 "2016-12-01T13:18:48Z")

</div>

You have something using the 443 port on the host. Please remove it and try again.

```plaintext
netstat -tulpn | grep 443

```

---

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [1 december 2016 om 14:10 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/5 "2016-12-01T14:10:45Z")

</div>

> [@Falco](#):
>
> netstat -tulpn | grep 443

Here’s the result  
 ![](https://global.discourse-cdn.com/meta/optimized/3X/a/d/ad70e4f81648a1ae6b3206486557d522d206464a_2_690x26.png)

How can I remove it?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [1 december 2016 om 14:11 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/6 "2016-12-01T14:11:46Z")

</div>

`sudo apt remove nginx`

Why did you install nginx on the host? If you installed it by accident it may be safe to remove.

---

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [1 december 2016 om 14:31 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/7 "2016-12-01T14:31:31Z")

</div>

![](https://global.discourse-cdn.com/meta/optimized/3X/f/2/f2e1f67a0250d59696efe9087ccb079eee34fe00_2_690x29.png)

Now here’s a line, but the site is not working.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [1 december 2016 om 14:32 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/8 "2016-12-01T14:32:43Z")

</div>

Did you rebuild after removing outside nginx?

---

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [1 december 2016 om 14:36 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/9 "2016-12-01T14:36:08Z")

</div>

First I removed nginx, then this command /var/discourse# ./launcher rebuild app  
discourse and not working(

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [1 december 2016 om 14:37 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/10 "2016-12-01T14:37:36Z")

</div>

First, like I said:

> If you installed it by accident it may be safe to remove.

Looking again trough your pastebin:

1. Your SMTP user & password is there, please remove

2. You were setting Discourse to a higher port, so you were using nginx to host anything else right? So you shouldn’t remove the outside nginx

3. IF you are running a reverse proxy outside the docker container, you can’t use the Let’s Encrypt template inside the docker container. You must get SSL in another way.

---

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [1 december 2016 om 15:57 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/11 "2016-12-01T15:57:14Z")

</div>

Thank You))) Understood))  
After removing Nginx  
in the yml file changed - “25654:80” # http 80:80

---

<div class="post-metadata">

### Author: ![littleviolette](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@littleviolette](https://meta.discourse.org/u/littleviolette)
#### Post date: [10 maart 2018 om 04:09 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/12 "2018-03-10T04:09:08Z")

</div>

@Falco I have been having issues with port 443 and Let’s Encrypt as well probably due to the fact that I unintentionally installed Discourse behind nginx following the instruction [here](https://www.digitalocean.com/community/tutorials/how-to-install-discourse-behind-nginx-on-ubuntu-14-04).

Is there a way to safely reverse this process? Sorry I am not a professional programmer. 😕

---

<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: [8 juni 2024 om 12:37 UTC](https://meta.discourse.org/t/discourse-rebuild-fails-with-port-443-in-use/53615/13 "2024-06-08T12:37:44Z")

</div>

This topic was automatically closed after 2746 days. New replies are no longer allowed.
