# Python webserver in Docker on nonstandard port

**URL:** <https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809>\
**Category:** Help\
**Created:** [September 16, 2020, 8:44am UTC](https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809 "2020-09-16T08:44:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonardoda](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@leonardoda](https://community.letsencrypt.org/u/leonardoda)\
**Post date:** [September 16, 2020, 8:44am UTC](https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809/1 "2020-09-16T08:44:23Z")

</div>

Hi there,  
I am new here and I am not sure I am hijacking a topic. If so please apologize and point me in the right direction. Here is my question.

I have a http service running in a docker instance on port 8888.  
The service is written in python with aiohttp and has only a handful routes defined.  
I would like to convert it to a https service on port 8443

How can I get a certificate for this configuration?

---

<div class="post-metadata">

**Author:** ![griffin](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/griffin/32/50204_2.png) [@griffin](https://community.letsencrypt.org/u/griffin)\
**Post date:** [September 16, 2020, 4:09pm UTC](https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809/3 "2020-09-16T16:09:07Z")

</div>

@leonardoda

Welcome to the Let’s Encrypt Community, Leon 🙂

---

<div class="post-metadata">

**Author:** ![jvanasco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jvanasco/32/55900_2.png) [@jvanasco](https://community.letsencrypt.org/u/jvanasco)\
**Post date:** [September 16, 2020, 6:08pm UTC](https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809/4 "2020-09-16T18:08:31Z")

</div>

There are three things you need to do:

- Run software to obtain the certificate
- Obtain the certificate
- Install the certificate

Under Docker, the first two things are very simple. There are official containers and docs for running Certbot under Docker (see bleow). You’ll be able to complete challenges via the HTTP-01 mechanism (Port80); you can also opt to use the DNS-01 challenge and run Certbot from any computer that can manage DNS.

If you use Docker or elect to run an ACME client to handle DNS-01 challenges from your computer, you must manually install the certificates. This is because Certbot’s Docker container is sandboxed from your Application’s Docker container.

In terms of installing the certs and running services, you could have the Python app handle SSL termination, you could run it in a container that handles SSL termination (uwsgi, gunicorn, etc), or you could install a webserver to run on port 80/443 (nginx and caddy are popular) and then proxy the traffic to your app on the higher port.

Hope this helps!

> **[Get Certbot — Certbot 1.8.0.dev0 documentation](https://certbot.eff.org/docs/install.html#running-with-docker)**
>
> Automatically enable HTTPS on your website with EFF's Certbot, deploying Let's Encrypt certificates.

---

<div class="post-metadata">

**Author:** ![leonardoda](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@leonardoda](https://community.letsencrypt.org/u/leonardoda)\
**Post date:** [September 17, 2020, 10:15am UTC](https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809/5 "2020-09-17T10:15:00Z")

</div>

Thank you for the quick response.  
I was unsure about acquiring the certificate via a second docker instance.  
Installing the certificate is just providing the correct files to the software.

Again thank you, this is a good experience

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [October 17, 2020, 10:15am UTC](https://community.letsencrypt.org/t/python-webserver-in-docker-on-nonstandard-port/133809/6 "2020-10-17T10:15:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
