# Letsencrypt certificates not saved? \[SOLVED\]

**URL:** <https://forum.gitea.com/t/letsencrypt-certificates-not-saved-solved/2642>\
**Category:** Install/Maintain/Configure\
**Created:** [November 12, 2020, 10:06pm UTC](https://forum.gitea.com/t/letsencrypt-certificates-not-saved-solved/2642 "2020-11-12T22:06:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0rphism](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/m0rphism/32/1018_2.png) [@m0rphism](https://forum.gitea.com/u/m0rphism)\
**Post date:** [November 12, 2020, 10:06pm UTC](https://forum.gitea.com/t/letsencrypt-certificates-not-saved-solved/2642/1 "2020-11-12T22:06:24Z")

</div>

Hi, I’m running the latest gitea docker image with the builtin letsencrypt options, but for some reason the certificates are not saved. This caused gitea to order a new certificate on every restart of the docker image, which now led to letsencrypt blocking me for one week with TLS handshake error “too many certificates already issued for exact set of domains”.

My server settings look like this:

```
[server]
PROTOCOL = https
APP_DATA_PATH = /data/gitea
DOMAIN = my.domain.omitted
SSH_DOMAIN = my.domain.omitted
HTTP_PORT = 3000
ROOT_URL = https://my.domain.omitted/
DISABLE_SSH = false
SSH_PORT = 22
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
REDIRECT_OTHER_PORT = true
PORT_TO_REDIRECT = 3080
ENABLE_LETSENCRYPT = true
LETSENCRYPT_ACCEPTTOS = true
LETSENCRYPT_DIRECTORY = https
LETSENCRYPT_EMAIL = my@email.omitted

```

but there is no `https` directory in my `/data/gitea` directory.

Any idea what might be the issue?

The `docker-compose.yaml` file looks pretty standard and uses a docker volume to persist `/data`, which works for all the other settings and data:

```
version: "2"

networks:
  gitea:
    external: true

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "80:3080"
      - "443:3000"
      - "222:22"
```

---

<div class="post-metadata">

**Author:** ![m0rphism](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/m0rphism/32/1018_2.png) [@m0rphism](https://forum.gitea.com/u/m0rphism)\
**Post date:** [November 13, 2020, 11:01am UTC](https://forum.gitea.com/t/letsencrypt-certificates-not-saved-solved/2642/2 "2020-11-13T11:01:21Z")

</div>

Got a new subdomain and fixed it.

Please consider updating the documentation for `LETSENCRYPT_DIRECTORY`, to say that this is an absolute path, so the default value `https` will not be placed in the APP\_DATA\_PATH, which for docker installations is the only suggested docker volume. The `LETSENCRYPT_DIRECTORY` gets directly passed through to the underlying `autocert` library.

After setting `LETSENCRYPT_DIRECTORY=/data/gitea/https` it worked correctly.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [November 13, 2020, 11:18am UTC](https://forum.gitea.com/t/letsencrypt-certificates-not-saved-solved/2642/3 "2020-11-13T11:18:59Z")

</div>

Could you send a PR for that? Thanks for advance.
