How to install Let's Encrypt to my droplet with dockerized spring boot app?

Posted October 29, 2019 6.1k views
DockerLet's EncryptUbuntu 18.04

Hello everybody,

I created a droplet (Docker 5:19.03.1~3 on 18.04). I pulled my docker image from docker hub and run it. My docker image contains a Spring boot application. (tomcat embedded). It’s working nice but I want to add https (Let’s encrypt) to my page. I found some documents, tutorials but everybody talks about nginx & apache. Can someone please help me to install https to my spring boot (embedded tomcat) application on my droplet (Ubuntu 18.04.3 LTS bionic) The page is up and running now and I will keep it running while fixing this if possible.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers


I would suggest checking this answer here.

What they are suggesting is the following:

  • Get the certbot from here:

  • Generate a certificate for your domain:
./certbot-auto certonly -a standalone -d -d
  • The SSL would be stored at /etc/letsencrypt/live/ Spring Boot expects PKCS#12 formatted file. So t convert the certificate you could do the following:

  • Go to the /etc/letsencrypt/live/ directory.

openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -name tomcat -CAfile chain.pem -caname root
  • The file keystore.p12 with PKCS12 is now generated in /etc/letsencrypt/live/

  • Then you have to configure your Spring Boot app. In your file and put the following properties there:


I would recommend going through the two original articles as well:

Hope that this helps!

Show answer This answer has been marked as resolved by yonetmen.