# How to install Discourse in the AWS EC2 Instances(Ubuntu Server LTS)?

**URL:** https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406
**Category:** Self-hosting
**Created:** [23 maart 2019 om 12:33 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406 "2019-03-23T12:33:34Z")
**Posts on this page:** 17
**Page:** 2

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [26 maart 2019 om 10:48 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/27 "2019-03-26T10:48:01Z")

</div>

I tried to visit Instances’s `IPv4 Public IP`, and it displayed that:

 ![chrome-error___chromewebdata_(Laptop%20with%20HiDPI%20screen)%20(1)](https://global.discourse-cdn.com/meta/original/3X/6/1/61d6fab41e0c679df58eb27009e96fc358143c7d.png)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [26 maart 2019 om 14:55 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/28 "2019-03-26T14:55:45Z")

</div>

You need to use the name you’ve configured in DNS to access your instance, not the IP.

Accessing discourse via IP address isn’t supported.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [26 maart 2019 om 15:21 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/29 "2019-03-26T15:21:52Z")

</div>

@Stephen Umm, I tried to visit the FQDN I input in `./discourse-setup` , but:

> [@Lee533](#):
>
> Page displayed `This site can’t be reached`
> 
> ![chrome-error___chromewebdata_(Laptop with HiDPI screen).png](https://global.discourse-cdn.com/meta/original/3X/2/0/20faa964c665e613bfcc826ad238b78d670302f8.png)

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [28 maart 2019 om 01:44 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/30 "2019-03-28T01:44:42Z")

</div>

- What have you done?  
I have bought a domain on NameSilo, registered a AWS account, and launch a Instance, [connected to the Instance from Windows using PuTTY](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html), follow [Set up Discourse in the cloud in under 30 minutes](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) from [`Install Docker / Git`](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md#install-docker--git) step, finished [`Edit Discourse Configuration`](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md#edit-discourse-configuration) and changed AWS EC2 Security Group like [this](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html#sg-rules-web-server). I enter my FQDN I input in `./discourse-setup` , but it displayed: `This site can’t be reached`(because of its server IP address could not be found.)

- What have you not done?  
I just bought a domain on NameSilo, but I **don’t** change any settings…

- What do you expect to happen?  
Continue to follow [Set up Discourse in the cloud in under 30 minutes](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)‘ [`Start Discourse`](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md#start-discourse) step, to register.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [28 maart 2019 om 01:52 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/31 "2019-03-28T01:52:28Z")

</div>

So you’ve not done anything to tell NameSilo about your EC2 server at Amazon?

The way DNS works is that you tell the DNS server about the resources you’re trying to publish under that domain name. You need to configure an ‘a’ record at NameSilo for your Discourse instance, linked to the IP at Amazon.

Your screenshot shows `discourse.example.com` - I’m assuming that’s not the domain you’ve trying to work with. It might help if you give us more information about the specific configuration so that we can advise on which records to create.

NameSilo and/or Amazon aren’t psychic, they have no knowledge of one another, it’s up to you to create the necessary DNS entries so that one refers to the other.

Once DNS is correctly configured you will need to wait for the records to propagate, then rebuild your app (./launcher rebuild app) so that Let’s Encrypt can enroll the certificate.

---

<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: [28 maart 2019 om 01:53 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/32 "2019-03-28T01:53:20Z")

</div>

> [@Lee533](#):
>
> What have you not done?  
> I just bought a domain on NameSilo, but I **don’t** change any settings…

You need to go to NameSilo and create an A record that connects your FQDN to your site.

You might also need to make sure that ports 80 and 443 are not blocked.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [28 maart 2019 om 01:59 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/33 "2019-03-28T01:59:05Z")

</div>

Thanks, I have

> [@Lee533](#):
>
> changed AWS EC2 Security Group like [this](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html#sg-rules-web-server)

so, don’t need to check ports 80 and 443 are not blocked, right?

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [28 maart 2019 om 02:03 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/34 "2019-03-28T02:03:08Z")

</div>

Thanks, the FQDN is [discourse.tircklehub.com](http://discourse.tircklehub.com). But why I need to rebuild my app again?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [28 maart 2019 om 02:04 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/35 "2019-03-28T02:04:21Z")

</div>

If you’re using Let’s Encrypt then once DNS is configured it needs to generate a certificate, which is done when the container is built.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [28 maart 2019 om 10:51 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/37 "2019-03-28T10:51:05Z")

</div>

I’m using Let’s Encrypt. I rebooted Instance and without rebuild app, but the page loaded successfully. Why did it happened?

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [29 maart 2019 om 02:20 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/38 "2019-03-29T02:20:14Z")

</div>

Isn’t I need to generate a certificate again when I rebooted Instance?

---

<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: [29 maart 2019 om 04:21 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/39 "2019-03-29T04:21:42Z")

</div>

According to my browser, that domain doesn’t resolve.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [29 maart 2019 om 04:36 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/40 "2019-03-29T04:36:51Z")

</div>

Because I stopped the Instance(AWS only provide 750 hours EC2 Instance free tire.). But when I rebooted Instance and without rebuild app again, the page can load successfully.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [29 maart 2019 om 08:18 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/41 "2019-03-29T08:18:50Z")

</div>

Now I start the Instance without `./launcher rebuild app`. I can visit is successfully. What about you?

 ![com_(Laptop%20with%20HiDPI%20screen)%20(1)](https://global.discourse-cdn.com/meta/original/3X/2/f/2f03d51b5dce76739e9ff9aed752d8d496538dce.jpeg)  
So why @Stephen said [that](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/35)?

> [@Stephen](#):
>
> If you’re using Let’s Encrypt then once DNS is configured it needs to generate a certificate, which is done when the container is built.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [30 maart 2019 om 00:41 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/42 "2019-03-30T00:41:01Z")

</div>

First question, [at]Stephen told me, I need to:

> [@Stephen](#):
>
> rebuild your app (./launcher rebuild app) so that Let’s Encrypt can enroll the certificate.

because of I’m using Let’s Encrypt, and the reason is:

> [@Stephen](#):
>
> once DNS is configured it needs to generate a certificate, which is done when the container is built.

But, I rebooted Instance, configured DNS and without run command `./launcher rebuild app`, [the welcome page](https://discourse.tricklehub.com/) loaded successfully. So the question is how did it happened?

* * *

Second questions, how to auto renew Let’s Encrypt certificate?  
Should I

> [@Set up HTTPS support with Let's Encrypt](https://meta.discourse.org/t/set-up-https-support-with-lets-encrypt/40709/1):
>
> editing the `app.yml`

like this [Topic](https://meta.discourse.org/t/setting-up-https-support-with-lets-encrypt/40709) said(I’ve already using `./discourse-setup` to enable Let’s Encrypt)?

---

<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: [30 maart 2019 om 04:16 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/43 "2019-03-30T04:16:22Z")

</div>

It will auto renew. You’re all set.

---

<div class="post-metadata">

### Author: ![Lee533](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee533/32/134468_2.png) [@Lee533](https://meta.discourse.org/u/Lee533)
#### Post date: [30 maart 2019 om 04:23 UTC](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406/44 "2019-03-30T04:23:33Z")

</div>

So you mean it will auto renew **and** generate certificate automatically?

[Vorige pagina](https://meta.discourse.org/t/how-to-install-discourse-in-the-aws-ec2-instances-ubuntu-server-lts/112406.md?page=1)
