# Discourse setup on aws ec2 doesn't work with default IPv4 DNS

**URL:** https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789
**Category:** Self-hosting
**Tags:** hosting
**Created:** [July 11, 2021, 7:10pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789 "2021-07-11T19:10:26Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ys2843](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ys2843/32/227274_2.png) [@ys2843](https://meta.discourse.org/u/ys2843)
#### Post date: [July 11, 2021, 7:10pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/1 "2021-07-11T19:10:26Z")

</div>

Hi discourse community,

I am new to discourse and just testing the setup of discourse on an AWS ec2 instance following [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md). However, I wasn’t able to spin it up. Here is problem I am having:

Before purchasing all the resources, I wanted to try out the website without a domain name, so I used Public IPv4 DNS of that instance as the hostname of discourse and to access the site, e.g. https://ec2\_ip\_address.us-west-1.compute.amazonaws.com/.  
I opened up the port 80, 443 on the instance via the security group, and verified these ports are accessible from public network (tested with python simple server).  
But I get “This site can’t be reached” in browser after starting the discourse server with `./discourse-setup` or `./launcher rebuild app`.

I tried the discourse doctor, and it returns

```plaintext
Discourse version at ec2-ip_address.us-west-1.compute.amazonaws.com: NOT FOUND
Discourse version at localhost NOT FOUND

```

I am not 100% sure if email setup is working, but I assume site accessibility is a separate problem with email.

Can anyone point me what is missing or how can I debug this issue?

thanks a lot!

---

<div class="post-metadata">

### Author: ![griffin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/griffin/32/223139_2.png) [@griffin](https://meta.discourse.org/u/griffin)
#### Post date: [July 12, 2021, 1:45am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/2 "2021-07-12T01:45:46Z")

</div>

Welcome to the Meta Discourse Community 🙂

It may be unrelated, but I’m noticing an inconsistency here:

> [@ys2843](#):
>
> ec2 **\_** ip\_address.us-west-1.compute.amazonaws.com

> [@ys2843](#):
>
> ec2 **-** ip\_address.us-west-1.compute.amazonaws.com

---

<div class="post-metadata">

### Author: ![ys2843](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ys2843/32/227274_2.png) [@ys2843](https://meta.discourse.org/u/ys2843)
#### Post date: [July 12, 2021, 5:57am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/3 "2021-07-12T05:57:23Z")

</div>

Hi Jonathan,

Thanks for checking. I omitted the ip address here, the url should be correct.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [July 12, 2021, 6:11am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/4 "2021-07-12T06:11:18Z")

</div>

The `Not found` status on your hostname is most probably due to the site not being live. You’ll have to share more from your discourse-doctor log.

Does the rebuild/bootstrap complete successfully?

If the EC2 instance is underpowered then there is a chance that discourse would take some time (~3-5 mins in some cases)

What you should be looking at is if your build completes successfully then with `docker ps` verify that the container is running and listening on 80 & 443. Once that’s verified, the problem is with the AWS security group and not the install itself.

---

<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: [July 13, 2021, 12:09am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/5 "2021-07-13T00:09:57Z")

</div>

> [@ys2843](#):
>
> I opened up the port 80, 443 on the instance via the security group, and verified these ports are accessible from public network (tested with python simple server).

Can you verify that your can access the server via the hostname?

---

<div class="post-metadata">

### Author: ![ys2843](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ys2843/32/227274_2.png) [@ys2843](https://meta.discourse.org/u/ys2843)
#### Post date: [July 13, 2021, 1:01am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/6 "2021-07-13T01:01:43Z")

</div>

> The `Not found` status on your hostname is most probably due to the site not being live. You’ll have to share more from your discourse-doctor log.

Agreed. I will pay attention to the build log and see if there is something wrong. How can I debug if there is error in the log?

> Can you verify that your can access the server via the hostname?

Yes, I verified the hostname and the ports are accessible in browser. both 80 and 443. I created a python http server simply serving some files, and I can see response in the browser

---

<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: [July 13, 2021, 10:05am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/7 "2021-07-13T10:05:24Z")

</div>

Do you see anything in the logs? Something like

/var/discourse/shared/standalone/logs/var-log/nginx/error.log

There should be an issue with let’s encrypt and aws. Even if it were your own domain, if you rebuilt a bunch of times you could have used to your quota.

---

<div class="post-metadata">

### Author: ![griffin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/griffin/32/223139_2.png) [@griffin](https://meta.discourse.org/u/griffin)
#### Post date: [July 13, 2021, 11:35am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/8 "2021-07-13T11:35:51Z")

</div>

> [@pfaffman](#):
>
> There should be an issue with **let’s encrypt** and aws.

Funny you should mention that. 🙂 It’s what initially drew me to this topic. I help a lot of people over at [https://community.letsencrypt.org](https://community.letsencrypt.org) and thought this topic might be in my wheelhouse to assist. To apply any of my tools I would need to know the real domain names.

---

<div class="post-metadata">

### Author: ![srinivas\_chilukuri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/srinivas_chilukuri/32/218881_2.png) [@srinivas\_chilukuri](https://meta.discourse.org/u/srinivas_chilukuri)
#### Post date: [September 1, 2021, 6:49pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/9 "2021-09-01T18:49:14Z")

</div>

@ys2843

- Can U update what happened later , I am stuck with the exact same issue .

---

<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: [September 3, 2021, 5:09am UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/10 "2021-09-03T05:09:25Z")

</div>

Are you trying to use an aws domain name? Don’t. Use your own.

Did you look at the logs?

If you did a bunch of rebuilds you’ll also hit let’s encrypt rate limits.

---

<div class="post-metadata">

### Author: ![srinivas\_chilukuri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/srinivas_chilukuri/32/218881_2.png) [@srinivas\_chilukuri](https://meta.discourse.org/u/srinivas_chilukuri)
#### Post date: [September 3, 2021, 1:29pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/11 "2021-09-03T13:29:28Z")

</div>

@pfaffman

> Background : Setting up a minimal discourse forum as a proof of concept on aws, trying to minimize the cost

- Is there any way to use AWS provided domain name  
Heuristic example : ec2-ip\_address.us-west-1.compute.amazonaws.com

- I don’t have a domain name purchased , is there any way to avoid this .

- [Warning in setup documentation : Discourse will not work from an IP address, you must own a domain name such as example.com to proceed.](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#domain-name)

---

<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: [September 3, 2021, 1:43pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/12 "2021-09-03T13:43:06Z")

</div>

You can register a domain name for $3 at godaddy. If your time is worth more than $3/hour you should register a domain. And if you don’t have $3 to register a domain, you can’t afford an ec2 either.

---

<div class="post-metadata">

### Author: ![srinivas\_chilukuri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/srinivas_chilukuri/32/218881_2.png) [@srinivas\_chilukuri](https://meta.discourse.org/u/srinivas_chilukuri)
#### Post date: [September 3, 2021, 2:41pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/13 "2021-09-03T14:41:34Z")

</div>

@pfaffman

> [@pfaffman](#):
>
> can register a domain name for $3 at godaddy. If your time is worth more than $3/hour you should register a domain. And if you don’t have $3 to register a domain

- Agree with U on the Pricing issue perspective .
- From a technical perspective is there any work-around ???

---

<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: [September 3, 2021, 2:44pm UTC](https://meta.discourse.org/t/discourse-setup-on-aws-ec2-doesnt-work-with-default-ipv4-dns/196789/14 "2021-09-03T14:44:08Z")

</div>

Sure! See that one one else who uses an `.amazonaws.com` domain name uses Let’s Encrypt and then wait a week. If you don’t want to register a domain, that would be the next thing that I’d try.
