# Installing ODK Central: https fails

**URL:** <https://forum.getodk.org/t/installing-odk-central-https-fails/35323>\
**Category:** Support\
**Created:** [October 8, 2021, 3:05pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323 "2021-10-08T15:05:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 8, 2021, 3:05pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/1 "2021-10-08T15:05:12Z")

</div>

Hello!  
I've gone through the wonderfully-simple steps to install ODK Central on an Ubuntu 21.04 machine with a recently-assigned Internet name/address.  
Everything seems fine, including:

```auto
$ sudo docker-compose ps
            Name Command State Ports                                 
-----------------------------------------------------------------------------------------------------------------------------------------------------
central_enketo_1 docker-entrypoint.sh /bin/ ... Up 8005/tcp                                                              
central_enketo_redis_cache_1 docker-entrypoint.sh redis ... Up 6379/tcp                                                              
central_enketo_redis_main_1 docker-entrypoint.sh redis ... Up 6379/tcp                                                              
central_mail_1 /bin/entrypoint.sh exim -b ... Up 25/tcp                                                                
central_nginx_1 /bin/bash /scripts/odk-set ... Up (healthy) 0.0.0.0:443->443/tcp,:::443->443/tcp, 0.0.0.0:80->80/tcp,:::80->80/tcp
central_postgres_1 docker-entrypoint.sh postgres Up 5432/tcp                                                              
central_pyxform_1 gunicorn --bind 0.0.0.0:80 ... Up                                                                                   
central_secrets_1 docker-entrypoint.sh ./gen ... Exit 0                                                                               
central_service_1 docker-entrypoint.sh ./wai ... Up 8383/tcp            

```

However, visiting the server through a browser gives

> Secure Connection Failed
> 
> An error occurred during a connection to localhost. PR\_END\_OF\_FILE\_ERROR
> 
> ```
> The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
> Please contact the website owners to inform them of this problem.
> 
> ```

It seems http is strictly redirecting to https. I get the same problem browsing to localhost from the machine itself.

I assume the setup got letsencrypt certificates set up. I've no idea how to check, or what else to look for.

Thank you for ideas and help!

---

<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:** [October 8, 2021, 3:38pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/2 "2021-10-08T15:38:57Z")

</div>

Run `docker-compose logs nginx` and see what the logs say. My guess is that your domain name to IP mapping is broken or hasn't had enough time to propagate to your DNS.

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 8, 2021, 3:46pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/3 "2021-10-08T15:46:05Z")

</div>

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

Thank you!  
I get:

```auto
$ sudo docker-compose logs nginx 
Attaching to central_nginx_1
nginx_1 | WARNING: no logs are available with the 'local' log driver

```

even after I've tried browsing `https://localhost/` again.

Oh, weird. Even though the DNS name works from nearby (e.g. for ssh), I actualy get a "connection refused" from, e.g. `links myodkdomain.net`

I'm happy to wait another 12 hours or so but not sure why localhost doesn't work. Or maybe https never works for localhost, since the certificate is not for localhost!?

In that case my symptom is the refusal to connect, since my server does seem to have the DNS for its own FQDN.

---

<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:** [October 8, 2021, 4:18pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/4 "2021-10-08T16:18:15Z")

</div>

I'm assuming you have a recent version of Docker (e.g., 20.10.x), but it sounds like you may not have a recent version of docker-compose.

We have this information in the [upgrade](https://docs.getodk.org/central-upgrade/#upgrading-to-central-v1-3) docs, but not in the install docs. I'll update the docs in a moment, but for now, follow these steps.

```auto
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose;
sudo chmod +x /usr/local/bin/docker-compose;
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose;

```

Then re-run the build.

```auto
docker-compose build && docker-compose stop && docker-compose up -d;

```

Now look at the logs again...

```auto
docker-compose logs nginx;

```

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 8, 2021, 4:22pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/5 "2021-10-08T16:22:01Z")

</div>

Thank you! Okay, before I interfere with apt, can I confirm you think this is not new enough?

```auto
$ sudo apt policy docker-compose docker
docker-compose:
  Installed: 1.25.0-1
  Candidate: 1.25.0-1
  Version table:
 *** 1.25.0-1 500
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe i386 Packages
        100 /var/lib/dpkg/status
docker:
  Installed: 1.5-2
  Candidate: 1.5-2
  Version table:
 *** 1.5-2 500
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe i386 Packages
        100 /var/lib/dpkg/status

```

---

<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:** [October 8, 2021, 4:32pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/6 "2021-10-08T16:32:55Z")

</div>

Docker 1.5 is from 2015! It might work, but I'd be very surprised if it did.

Follow the instructions at [https://docs.docker.com/engine/install/ubuntu/](https://docs.docker.com/engine/install/ubuntu/) and [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) and it'll get you the same versions we use and recommend (Docker version 20.10.x and docker-compose version 1.29.x). And those instructions also work with apt so your upgrades will be seamless.

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 8, 2021, 5:09pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/7 "2021-10-08T17:09:08Z")

</div>

Thank you!!

I'm getting a bit confused about something. I thought the preferred installation OS for the instructions I used was Ubuntu. [Edit: I take that back; the instructions were more for Digital Ocean]. I'm running fresh updated install of Ubuntu 21.04.  
Did I screw up at the beginning somewhere? I'm after a simple installation script as much as I am after a working Central server.

It also seems like the second of the links you just gave is not using apt.  
In fact, after following those instructions it seems there are two version of docker-composed installed and in conflicting places.

```auto

$ docker-compose --version
docker-compose version 1.29.2, build 5becea4c
$ sudo apt policy docker-ce docker docker-compose
docker-ce:
  Installed: 5:20.10.9~3-0~ubuntu-hirsute
  Candidate: 5:20.10.9~3-0~ubuntu-hirsute
  Version table:
 *** 5:20.10.9~3-0~ubuntu-hirsute 500
        500 https://download.docker.com/linux/ubuntu hirsute/stable amd64 Packages
        100 /var/lib/dpkg/status
     5:20.10.8~3-0~ubuntu-hirsute 500
        500 https://download.docker.com/linux/ubuntu hirsute/stable amd64 Packages
     5:20.10.7~3-0~ubuntu-hirsute 500
        500 https://download.docker.com/linux/ubuntu hirsute/stable amd64 Packages
     5:20.10.6~3-0~ubuntu-hirsute 500
        500 https://download.docker.com/linux/ubuntu hirsute/stable amd64 Packages
docker:
  Installed: (none)
  Candidate: 1.5-2
  Version table:
     1.5-2 500
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe i386 Packages
docker-compose:
  Installed: 1.25.0-1
  Candidate: 1.25.0-1
  Version table:
 *** 1.25.0-1 500
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
        500 http://ca.archive.ubuntu.com/ubuntu hirsute/universe i386 Packages
        100 /var/lib/dpkg/status
$ l /usr/local/bin/docker-compose /usr/bin/docker-compose
-rwxr-xr-x 1 root root 420 Nov 22 2019 /usr/bin/docker-compose*
-rwxr-xr-x 1 root root 13M Oct 8 13:00 /usr/local/bin/docker-compose*

```

Maybe I just needed to `apt remove docker-compose`. That was not included in the suggested apt remove line

Is there a cleaner procedure for me to follow from a fresh OS install? Or are the instructions maybe for Ubuntu 21.10 beta? I used the desktop version of 21.04. though I think I've caught up with a `apt install ubuntu-server`.

---

<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:** [October 8, 2021, 5:14pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/8 "2021-10-08T17:14:48Z")

</div>

I personally start from Ubuntu Server 20, which is the most recent LTS.

Then I install Docker and docker-compose via [https://docs.docker.com/engine/install/ubuntu](https://docs.docker.com/engine/install/ubuntu) [https://docs.docker.com/compose/install](https://docs.docker.com/compose/install).

docker-compose does not use apt as you've noticed, but that's fine because it's a very simple binary and those instructions symlink it so you don't have to remove anything.

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 8, 2021, 5:26pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/9 "2021-10-08T17:26:40Z")

</div>

Okay, thanks.

I should have used the LTS. In any case, I followed all those instructions, rebuilt, and have identical symptoms.

Whether I try IP address or name, I get:

> Unable to connect
> 
> Firefox can’t establish a connection to the server at odk.research.mcgill.ca.

in my browser.

But now I get something for logs:

```auto

$ docker-compose --version
docker-compose version 1.29.2, build 5becea4c
$ docker --version
Docker version 20.10.9, build c2ea9bc
$ docker-compose logs nginx 
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1277, in request
  File "http/client.py", line 1323, in _send_request
  File "http/client.py", line 1272, in endheaders
  File "http/client.py", line 1032, in _send_output
  File "http/client.py", line 972, in send
  File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 410, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1277, in request
  File "http/client.py", line 1323, in _send_request
  File "http/client.py", line 1272, in endheaders
  File "http/client.py", line 1032, in _send_output
  File "http/client.py", line 972, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 214, in _retrieve_server_version
  File "docker/api/daemon.py", line 181, in version
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 237, in _get
  File "requests/sessions.py", line 543, in get
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 81, in main
  File "compose/cli/main.py", line 200, in perform_command
  File "compose/cli/command.py", line 70, in project_from_options
  File "compose/cli/command.py", line 153, in get_project
  File "compose/cli/docker_client.py", line 43, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 197, in __init__
  File "docker/api/client.py", line 222, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
[38885] Failed to execute script docker-compose

```

I'm willing to start over with LTS etc tomorrow/later if that might help. But docker seems to think nginx is up.

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 9, 2021, 5:51pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/10 "2021-10-09T17:51:27Z")

</div>

I've just realized that my IP address does not seem to be accessible outside the university.  
Maybe that also makes the LetsEncrypt installation break (silently??) I still don't see how that explains my troubles/symptoms, but I will wait for my university to assure that relevant ports are open.

---

<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:** [October 9, 2021, 10:45pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/11 "2021-10-09T22:45:31Z")

</div>

Yes, you need your domain and IP accessible via ports 80/443 from the public Internet.

The permissions issues you are running into, I'm not familiar with. It's like an issue with use (or non-use) of `sudo` or the version of Ubuntu you are using. I'd definitely try the LTS.

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 15, 2021, 10:35pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/12 "2021-10-15T22:35:50Z")

</div>

Still no luck. The ports are now all open.  
I've (multiple times) installed Ubuntu Server LTS and ODK Central.  
I still get SSL failure or can't connect: [https://odk.research.mcgill.ca](https://odk.research.mcgill.ca)

Can I somehow check whether the letsencrypt installation succeeded?  
There seems to be no mention of getting a certificate during the Central installation process.

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 15, 2021, 10:42pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/13 "2021-10-15T22:42:30Z")

</div>

Oh wait... I might have given up and posted 1 minute too soon: one more reboot might have helped. 🙂

---

<div class="post-metadata">

**Author:** ![ceebeelee](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ceebeelee/32/16459_2.png) [@ceebeelee](https://forum.getodk.org/u/ceebeelee)\
**Post date:** [October 15, 2021, 11:13pm UTC](https://forum.getodk.org/t/installing-odk-central-https-fails/35323/14 "2021-10-15T23:13:31Z")

</div>

So my main summary for this thread is that if you don't have your ports globally open yet, your certbot installation won't work so https will fail to connect.

I now have another problem: it seems if the server has no working smarthost relay or etc for email, then ODK makes it very difficult to adminstrate users' passwords. But that is not for this thread.

Thanks, Yaw!
