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

I’m editing a guide of install Discourse in the AWS EC2 Instances(Ubuntu Server LTS) in Chinese Simplified. I’m also a newbie of Rails, Linux shell and Web Development. This is the part I have already edited.
Is there are any errors? Thanks.

I especially don’t know want should I do after the part of Edit Discourse Configuration and before Register New Account and Become Admin.

After Edit Discourse Configuration, I can’t visit the hostname of Discourse. What should I do?

EC2 servers aren’t available externally by default, have you configured access?

I checked EC2 support documentation, but I still don’t know how to do that.

If you can SSH to the instance but cannot reach the web site, that suggests your security group is not permitting the necessary ports (80/443) or that nothing is listening on those ports.

Expand on this part.

  • What are you doing?
  • What do you expect to happen?
  • What actually happens?
3 Likes

So you mean I need to change it like this?

The default SG allows all ports. If you are using a custom one, then you will have to permit them like that link shows.

3 Likes

As said above AWS behaves differently to other hosts.

DigitalOcean servers are available over the Internet by default.

AWS servers sit in private networks and aren’t available publicly by default.

You’ve not said anything in the above which suggests you’ve published your EC2 instance or that the FQDN is pointed to the external IP.

2 Likes

So after:

, what do I need to do?

I haven’t changed any Ssettings of EC2 Security Groups.

So how are you expecting traffic on ports 80 or 443 to reach your server?

Access to EC2 instances is denied by default.

1 Like

Thanks a lot. But because of my poor English reading comprehension and writing ability(I’m a 16 years old Chinese student), I don’t know which post were you reply.

The screenshot shows “discourse.example.com”. Don’t enter that into the configuration or the browser, it’s just a placeholder for the actual hostname you want.

1 Like

I know that, In fact I don’t have enter discourse.example.com , it just a example. So, what should I do next?

Have you checked the security group which is applied to the instance?

Did you start the instance with with the AWS web console? Because it will by default run a wizard and attach a custom SG to the instance, usually named something like launch-wizard-1.

What AWS region is it running in?

3 Likes
  1. Yes, I checked it.
  2. Yes.
  3. Asia Pacific (Seoul).

Next level down the stack that could be stopping it would be a firewall. Does iptables -nvL output anything?

Past that is the discourse container actually running? Does it appear in a docker ps?

2 Likes

I entered the command, here is the output:

Chain INPUT (policy ACCEPT 9 packets, 648 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 
16012  108M DOCKER-USER  all  --  *      *       0.0.0.0/0            0.0.0.0/0 
16012  108M DOCKER-ISOLATION-STAGE-1  all  --  *      *       0.0.0.0/0            0.0.0.0/0
 7953  107M ACCEPT     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
   86  4460 DOCKER     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0  
 7973  807K ACCEPT     all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  docker0 docker0  0.0.0.0/0            0.0.0.0/0 

Chain OUTPUT (policy ACCEPT 8 packets, 600 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain DOCKER (1 references)
 pkts bytes target     prot opt in     out     source               destination 
    0     0 ACCEPT     tcp  --  !docker0 docker0  0.0.0.0/0            172.17.0.2           tcp dpt:443
   15   780 ACCEPT     tcp  --  !docker0 docker0  0.0.0.0/0            172.17.0.2           tcp dpt:80

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
 pkts bytes target     prot opt in     out     source               destination 
 7973  807K DOCKER-ISOLATION-STAGE-2  all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
16012  108M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0   

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
 pkts bytes target     prot opt in     out     source               destination 
    0     0 DROP       all  --  *      docker0  0.0.0.0/0            0.0.0.0/0  
 7973  807K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0   

Chain DOCKER-USER (1 references)
 pkts bytes target     prot opt in     out     source               destination 
16012  108M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0   
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                      NAMES
1ddff40f95d2        local_discourse/app   "/sbin/boot"        4 minutes ago       Up 4 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   app