Install Central on Ubuntu 20.4 on AWS EC2 instance

1. What is the problem? Be very detailed.
I am following the Digital Ocean instructions to install Central and I am at the point of installing Central on it on my server. For some reason commands such as 'git submodule update -i' and 'mv .env.template .env' are both saying command not found. - I am using the root account. I am a newbie to linux and ODK

2. What app or server are you using and on what device and operating system? Include version numbers.
AWS EC2 instance running Ubuntu 20.4.2. I have installed Docker engine and compose.

3. What you have you tried to fix the problem?
Looking for alternative instructions but most seem to suggest the same thing.

4. What steps can we take to reproduce the problem?

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Welcome to the ODK forum, @Tony_Rafferty! We're glad you're here. When you get a chance, please introduce yourself on this forum thread. I'd also encourage you to add a picture as your avatar because it helps build community!

You need to follow the complete instructions for Getting and Setting Up Central. Before running git submodule update -i you need to run git clone https://github.com/getodk/central and then cd central. The last line in your screenshot should show the below after you the run the cd central command.

root@ip-10-0-0-12:/home/ubuntu/central#

Hi Dan,

I did run that command previously and am now trying again. Sadly, I am getting the same issue where the command does not work. I don't understand why. This worked smoothly with my Digital Ocean installation but in EC2 I keep having this issue. Could it possibly be because of an issue with Docker Engine or Docker Compose? I have followed the instructions to install them but as you can see I am having this issue.

Generally when you type a command like command arg1 arg2 and something goes wrong, you should get an error message about command, not command arg1 arg2.

The No such file or directory suggests that there is something broken about your EC2 install or PATH or your shell environment. I'm surprised that you were able to install Docker.

What happens if you echo $PATH or run env? Do you get the output below?

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
$ env
SHELL=/bin/bash
SUDO_GID=1000
SUDO_COMMAND=/bin/bash
SUDO_USER=ubuntu
PWD=/tmp
LOGNAME=root
HOME=/root
LANG=C.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LC_TERMINAL=iTerm2
LESSCLOSE=/usr/bin/lesspipe %s %s
TERM=screen
LESSOPEN=| /usr/bin/lesspipe %s
USER=root
LC_TERMINAL_VERSION=3.4.4
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
SUDO_UID=1000
MAIL=/var/mail/root
OLDPWD=/home/ubuntu
_=/usr/bin/env

Hi Yaw,

Thanks for your response. I didn't install Docker. I chose an AMI with Docker on Ubuntu 20. I have tried running it twice from scratch and have the same results. Perhaps it is defective in some way?! I may try one without Docker to see what happens. Here is a screenshot of what happens when I run your commands. Thanks. Tony

Try a plain old Ubuntu AMI with no Docker, then install Docker from scratch.

1 Like

Hi Yaw

I have setup an Ubuntu AMI with no docker. Installed Docker Engine and Compose but yet I still have the same issue installing central with no such file or directory error. Is there another way I can install it that you know of?

Thanks
Tony

And what happens if you run these two commands?

  • which git
  • sudo apt-get install git

Hi @Tony_Rafferty,

Just wondering if you are running both commands from inside central folder?

Hi @Saad @yanokwa I started again and for whatever reason it is now working. I am online and can browse to the webpage and login as myself.

Where I am struggling now is with creating a web user. I have added my AWS SES details into the config file and I know the details are correct and working because I am using them elsewhere. For some reason I am seeing error 500 code. Do you know if it possible to see in the logs why this is not working? Outbound traffic on the EC2 instance is open as default.

image

In your ~/central folder, run docker-compose logs service and docker-compose logs mail and see what it says.

My guess is that either you didn't get the formatting right in the JSON file or the credentials themselves are incorrect. It should like something like this.

"email": {
 "serviceAccount": "no-reply@${DOMAIN}",
 "transport": "smtp",
 "transportOpts": {
   "host": "email-smtp.us-west-2.amazonaws.com",
   "port": 587,
   "auth": {
     "user": "ANVGGCSWYFTQYPDLEH2Q56S7U3G8A5",
     "pass": "0IFIVZ4CUnU2klftRzroL8OLUCxBt8anVGanVGGCSWyft"
   }
 }