# Install Central on Ubuntu 20.4 on AWS EC2 instance

**URL:** <https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890>\
**Category:** Support\
**Tags:** odk-central\
**Created:** [June 9, 2021, 8:15pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890 "2021-06-09T20:15:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Rafferty](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/tony_rafferty/32/15624_2.png) [@Tony\_Rafferty](https://forum.getodk.org/u/Tony_Rafferty)\
**Post date:** [June 9, 2021, 8:15pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/1 "2021-06-09T20:15:37Z")

</div>

**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.**

 ![image](https://getodk.b-cdn.net/uploads/default/original/2X/d/d47bc1a83d92283f18db77e557e023b9facfbeba.png)

---

<div class="post-metadata">

**Author:** ![danbjoseph](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/danbjoseph/32/21901_2.png) [@danbjoseph](https://forum.getodk.org/u/danbjoseph)\
**Post date:** [June 11, 2021, 1:05am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/2 "2021-06-11T01:05:48Z")

</div>

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](https://forum.getodk.org/t/-/6671). 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](https://docs.getodk.org/central-install-digital-ocean/#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.

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

```

---

<div class="post-metadata">

**Author:** ![Tony\_Rafferty](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/tony_rafferty/32/15624_2.png) [@Tony\_Rafferty](https://forum.getodk.org/u/Tony_Rafferty)\
**Post date:** [June 12, 2021, 3:22pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/3 "2021-06-12T15:22:55Z")

</div>

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.

 ![image](https://getodk.b-cdn.net/uploads/default/original/2X/c/c75ed0390b06fb659d453a62ce6ef1219b9bc3dd.png)

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 12, 2021, 8:21pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/4 "2021-06-12T20:21:36Z")

</div>

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?

```auto
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

```

```auto
$ 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
```

---

<div class="post-metadata">

**Author:** ![Tony\_Rafferty](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/tony_rafferty/32/15624_2.png) [@Tony\_Rafferty](https://forum.getodk.org/u/Tony_Rafferty)\
**Post date:** [June 12, 2021, 9:54pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/5 "2021-06-12T21:54:45Z")

</div>

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

 ![image](https://getodk.b-cdn.net/uploads/default/original/2X/2/252cb9795c66d19b715f5272f3f6a19109c61388.png)

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 12, 2021, 10:33pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/6 "2021-06-12T22:33:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tony\_Rafferty](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/tony_rafferty/32/15624_2.png) [@Tony\_Rafferty](https://forum.getodk.org/u/Tony_Rafferty)\
**Post date:** [June 14, 2021, 9:39am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/7 "2021-06-14T09:39:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 14, 2021, 12:54pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/8 "2021-06-14T12:54:33Z")

</div>

And what happens if you run these two commands?

- `which git`
- `sudo apt-get install git`

---

<div class="post-metadata">

**Author:** ![Saad](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/saad/32/4537_2.png) [@Saad](https://forum.getodk.org/u/Saad)\
**Post date:** [June 14, 2021, 8:23pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/9 "2021-06-14T20:23:09Z")

</div>

Hi @Tony_Rafferty,

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

---

<div class="post-metadata">

**Author:** ![Tony\_Rafferty](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/tony_rafferty/32/15624_2.png) [@Tony\_Rafferty](https://forum.getodk.org/u/Tony_Rafferty)\
**Post date:** [June 15, 2021, 9:12am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/10 "2021-06-15T09:12:36Z")

</div>

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](https://getodk.b-cdn.net/uploads/default/original/2X/6/6fee22e84b92e71d1aba1f308ba80d03459649d6.png)

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 17, 2021, 4:37pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/11 "2021-06-17T16:37:07Z")

</div>

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.

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

```

---

<div class="post-metadata">

**Author:** ![A.N.M\_AL-IMRAN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/a.n.m_al-imran/32/1610_2.png) [@A.N.M\_AL-IMRAN](https://forum.getodk.org/u/A.N.M_AL-IMRAN)\
**Post date:** [November 6, 2022, 11:41pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/12 "2022-11-06T23:41:03Z")

</div>

> [@yanokwa](#):
>
> docker-compose logs mail

Hi Yaw,

Hope you are doing well! After a long break glad to be here. Trying to install ODK central and I am experiencing the same issue as @Tony_Rafferty.

I followed all the command and all looks good apart from the last two commands:  
`docker-compose logs service` and `docker-compose logs mail` in the `~/central` folder.

 ![error](https://getodk.b-cdn.net/uploads/default/original/3X/e/3/e32e251e20d46a26edb48936dfed09d13975a661.png)

How to resolve this? I cannot see any solution in this post.  
Help will be truly appreciated.

Following the ODK documentation and [https://kags.me.ke/post/install-odk-central-on-ubuntu-20.04/](https://kags.me.ke/post/install-odk-central-on-ubuntu-20.04/)

All goes well till I reach to `git submodule update -i` and `mv .env.template .env` - at this step these commands return error:

 ![error2](https://getodk.b-cdn.net/uploads/default/original/3X/c/5/c5b3b6cf9439280ca50712feb6bf1a66e717e7c4.png)

Thank you in advance,  
Imran

---

<div class="post-metadata">

**Author:** ![iamnarendrasingh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/iamnarendrasingh/32/2593_2.png) [@iamnarendrasingh](https://forum.getodk.org/u/iamnarendrasingh)\
**Post date:** [November 7, 2022, 5:34am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/13 "2022-11-07T05:34:20Z")

</div>

try to use both of the above commands as the super user command should be like **sudo git submodule update -i**.

I hope this will work for you.

Best,  
@iamnarendrasingh

---

<div class="post-metadata">

**Author:** ![A.N.M\_AL-IMRAN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/a.n.m_al-imran/32/1610_2.png) [@A.N.M\_AL-IMRAN](https://forum.getodk.org/u/A.N.M_AL-IMRAN)\
**Post date:** [November 7, 2022, 1:19pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/14 "2022-11-07T13:19:13Z")

</div>

Hi @iamnarendrasingh ,

It is great to hear from you after a long time. Thanks so much for the support it worked perfectly. All installation processes went well till the end and checked the status of the ODK central and the service is up. However, cannot access central on the web browser. I even tried to access using the IP of my ODK central and no luck! any suggestion?

Thank you once again @iamnarendrasingh .  
Imran

---

<div class="post-metadata">

**Author:** ![iamnarendrasingh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/iamnarendrasingh/32/2593_2.png) [@iamnarendrasingh](https://forum.getodk.org/u/iamnarendrasingh)\
**Post date:** [November 8, 2022, 5:32am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/15 "2022-11-08T05:32:08Z")

</div>

Hey @A.N.M_AL-IMRAN , I hope you are doing well.  
Did you set up A records for your DNS? If not I would like to say please setup this up. Have a look at this [post](https://forum.getodk.org/t/having-trouble-setting-up-web-interface-of-odk-central/39427).  
I hope this will solve your issue.

Best,  
@iamnarendrasingh

---

<div class="post-metadata">

**Author:** ![Saad](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/saad/32/4537_2.png) [@Saad](https://forum.getodk.org/u/Saad)\
**Post date:** [November 8, 2022, 6:33am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/16 "2022-11-08T06:33:43Z")

</div>

Have you opened both ports 80 and 443 on firewall? What error do you get on the browser?

ODK Central won't work on IP. You need a domain name for it, and mention it into config files so that letsencrypt could get SSL certificate for your domain. Hope you have done this.

---

<div class="post-metadata">

**Author:** ![A.N.M\_AL-IMRAN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/a.n.m_al-imran/32/1610_2.png) [@A.N.M\_AL-IMRAN](https://forum.getodk.org/u/A.N.M_AL-IMRAN)\
**Post date:** [November 8, 2022, 3:12pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/17 "2022-11-08T15:12:31Z")

</div>

Hi @iamnarendrasingh and @Saad,

Thanks for all your suggestions! @iamnarendrasingh DNS records are perfectly configured and I am using a proper domain name as I have some unused domains. I created A record.

@Saad thanks, I noticed that my 443 port was not open.

I have a question as I am trying to install it on AWS lightsail on Ubuntu 20.04. Since the documentation does not cover AWS installation sequentially I am following [this instruction](https://kags.me.ke/post/install-odk-central-on-ubuntu-20.04/) and one thing I found completely different in this instruction from the ODK documentation, which is

 ![data-root-folder](https://getodk.b-cdn.net/uploads/default/original/3X/4/4/44982b06dc4ad97b0330ce5ade7a9fd520f25050.png)  
I did not notice that in ODK documentation. Is this step mandatory? In fact, this instruction ODK was installed inside the data directory.

I am quite lost. Need help, friends, to get out of this. If could get a good step-by-step guide to walk through this installation process will be very helpful. There are too many mismatches between instructions in documents to install in docker and ODK central.

Thanks so much for all the support and thanks in advance for future support.

Imran

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [November 8, 2022, 5:15pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/18 "2022-11-08T17:15:57Z")

</div>

@A.N.M_AL-IMRAN In general, the only instructions we recommend are the ones on the docs site because those are the only instructions we verify and keep up-to-date. I hear you that we don't have the complete AWS instructions and that's something that we'll be improving soon.

As to configuring the Docker data root folder, that is typically not necessary. Or rather, you only need to do that if your boot volume is tiny and you'd like that data on another volume.

I agree with @Saad and @iamnarendrasingh that you must have ports 80 and 443 open with your security group.

Once you have that, try a rebuild and [read your container logs](https://docs.getodk.org/central-troubleshooting/#reading-container-logs) for hints of what has gone wrong.

---

<div class="post-metadata">

**Author:** ![A.N.M\_AL-IMRAN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/a.n.m_al-imran/32/1610_2.png) [@A.N.M\_AL-IMRAN](https://forum.getodk.org/u/A.N.M_AL-IMRAN)\
**Post date:** [November 8, 2022, 11:45pm UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/19 "2022-11-08T23:45:14Z")

</div>

Hi @yanokwa,

Thank you so much for the suggestions. All steps went well till I reached the command `docker-compose build`.

I installed docker and compose successfully.

Edited .env template and added my domain and email address.

Please see attached:  
[log.txt](https://forum.getodk.org/uploads/short-url/nyI6pJZgjVmkkj16gugYpZnu3MB.txt) (3.5 KB)

I need to install central on AWS, which is my requirement, I am completely clueless and this time I followed exactly as per the ODK guideline.

Your support will be highly appreciated.

Thank you in advance,  
Imran

---

<div class="post-metadata">

**Author:** ![iamnarendrasingh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/iamnarendrasingh/32/2593_2.png) [@iamnarendrasingh](https://forum.getodk.org/u/iamnarendrasingh)\
**Post date:** [November 9, 2022, 4:49am UTC](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890/20 "2022-11-09T04:49:43Z")

</div>

Hi @A.N.M_AL-IMRAN ,

I have gone through with logs and find out that you are facing issue in postgreSQL setup. Please have a look on this [post](https://forum.getodk.org/t/central-service-image-build-fails-due-to-missing-stretch-pgdg-repository/39528/7). I am sure this will solve your issue.

Best,  
@iamnarendrasingh

[Next page](https://forum.getodk.org/t/install-central-on-ubuntu-20-4-on-aws-ec2-instance/33890.md?page=2)
