Installing ODK Central on Amazon EC2 Instance

Hello,

I've only just discovered the ODK "family" of tools and am excited to use it in future field research. Over the last couple of days, I have been trying to install ODK Central on an Amazon EC2 instance so that I could "play" and try things out. But unfortunately, I might have run into a problem that I was hoping the community might be able to shed light upon...

Thank you in advance to anyone that might be able to help!

1. What is the problem? Be very detailed.
I created an Amazon EC2 instance (t2.micro) with a Ubuntu Bionic 18.04 OS. I also obtained a static IP address for the instance (an Amazon Elastic IP) which I added to the DNS A record for a domain that I own. I also associated this static IP address with the EC2 instance. I do not have an SSL certificate.

I used ssh to connect to the EC2 instance and proceeded to install docker and docker-compose.

Next, I carefully followed the instructions that I found at this link:
https://docs.getodk.org/central-install-digital-ocean/
(starting from the section titled "Obtaining and Setting Up ODK Central").

When using nano to edit .env, I used my domain name for the DOMAIN variable.

Everything seems to proceed well, but when I reach the section "Starting up ODK Central" and type "docker-compose ps" I can see that all of the named items have the State of "Up" with the exception of the one named "secrets" which has the state "Exit 0". I don't know what this means or what it corresponds to - can anyone shed light on this for me? I thought perhaps that it is because I don't have an SSL certificate?

Ultimately, when I go to my domain's URL in a web browser, I don't reach anything. I'm not sure if this is just because the DNS settings may take a long time to register or whether it is as a result of "secrets" having state "Exit 0" as noted above. Can anyone comment on this? It has been several hours since I changed the DNS settings and I would have expected it to be fairly quick.

2. What app or server are you using and on what device and operating system? Include version numbers.
I am attempting to install ODK Central using Amazon EC2 with a t2.micro instance and Ubuntu Bionic 18.04 OS.

3. What you have you tried to fix the problem?
I have repeated this process a number of times using different SSL settings when editing the .env file in the instructions given in the URL mentioned above. I have had the same result for each of these attempts.

4. What steps can we take to reproduce the problem?
The problem can be reproduced by following the steps outlined above. I have essentially followed the instructions provided at the URL above but using an Ubuntu instance on Amazon EC2.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
In case it helps, I have copied and pasted some of the output from my terminal window below. Interestingly, the output seems to show that "secrets" successfully started but that it isn't in the "Up" state afterwards.

ubuntu@ip-172-31-2-12:~/central$ docker-compose up --no-start
Creating network "central_default" with the default driver
Creating volume "central_secrets" with default driver
Creating volume "central_transfer" with default driver
Creating volume "central_enketo_redis_main" with default driver
Creating volume "central_enketo_redis_cache" with default driver
Pulling postgres (postgres:9.6)...
9.6: Pulling from library/postgres
cbd31ae33279: Pull complete
0cf130beb85d: Pull complete
7834350bdbbd: Pull complete
094d0f760202: Pull complete
2037bc17ee04: Pull complete
7aaa063845bf: Pull complete
ac9a0b4aa30c: Pull complete
e13ca55ff349: Pull complete
24ece2e831f0: Pull complete
810aa5b83d76: Pull complete
2bfcde4af945: Pull complete
2930194d58a8: Pull complete
e20920535390: Pull complete
3d50aa4ef2a2: Pull complete
Digest: sha256:6ad3692e8987b039c11a2bca5af447acadbe00f91b230d9a6ac793870705df23
Status: Downloaded newer image for postgres:9.6
Pulling enketo_redis_cache (redis:5)...
5: Pulling from library/redis
6ec8c9369e08: Pull complete
efe6cceb88f8: Pull complete
cdb6bd1ce7c5: Pull complete
f3271809becb: Pull complete
62b6c0c5d763: Pull complete
663021ef8898: Pull complete
Digest: sha256:e345b40820cfb5a5e808f29e8807924f84cf57002bd5931bd1205a215e91b5cc
Status: Downloaded newer image for redis:5
Pulling pyxform (getodk/pyxform-http:v1.0.0)...
v1.0.0: Pulling from getodk/pyxform-http
cbdbe7a5bc2a: Pull complete
26ebcd19a4e3: Pull complete
35acdcbeccf1: Pull complete
647f327f91dd: Pull complete
9add0a120de2: Pull complete
b88be63e3d2f: Pull complete
30ae09e77a27: Pull complete
e665eb722ee4: Pull complete
97787e0086a4: Pull complete
Digest: sha256:9ced8ec6c1b095e4f5b69e79798423d3e40e97eff81464e9dd913ff820665b12
Status: Downloaded newer image for getodk/pyxform-http:v1.0.0
Pulling mail (itsissa/namshi-smtp:4.89-2.deb9u5)...
4.89-2.deb9u5: Pulling from itsissa/namshi-smtp
a4d8138d0f6b: Already exists
3d13ed72bc45: Pull complete
584d51be7b8e: Pull complete
a6cb4a7cdeb0: Pull complete
Creating enketo_redis_main ... done
Creating enketo ... done
Creating service ... done
Creating nginx ... done
Creating mail ... 
Creating enketo_redis_cache ... 
Creating central_postgres_1           ... 
Creating enketo_redis_main ... 
Creating pyxform ... 
Creating enketo ... 
Creating service ... 
Creating nginx ... 
ubuntu@ip-172-31-2-12:~/central$ docker-compose up -d
Starting secrets ... 
Starting mail ... 
Starting enketo_redis_cache ... 
Starting pyxform ... 
Starting enketo_redis_main ... 
Starting secrets ... done
Starting enketo ... done
Starting service ... done
Starting nginx ... done
ubuntu@ip-172-31-2-12:~/central$ docker-compose ps
       Name                     Command               State                     Ports                  
-------------------------------------------------------------------------------------------------------
central_postgres_1   docker-entrypoint.sh postgres    Up       5432/tcp                                
enketo               docker-entrypoint.sh /bin/ ...   Up       8005/tcp                                
enketo_redis_cache   docker-entrypoint.sh redis ...   Up       6379/tcp                                
enketo_redis_main    docker-entrypoint.sh redis ...   Up       6379/tcp                                
mail                 /bin/entrypoint.sh exim -b ...   Up       25/tcp                                  
nginx                /bin/bash /scripts/odk-set ...   Up       0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
pyxform              waitress-serve --port=80 - ...   Up                                               
secrets              docker-entrypoint.sh ./gen ...   Exit 0                                           
service              docker-entrypoint.sh ./wai ...   Up       8383/tcp
'''

If Amazon EC2 instance (t2.micro) has only Ubuntu 18.04 OS but not docker preinstalled, you might meed to allow 2375 and 2376 ports for docker. Look at this comment, Step 3. Configuring firewall for Docker.
Maybe that could help.

2 Likes