Share SWAG letsencrypt certificates among other containers issue

Hi all,

I followed this guide to share the letsencrypt certificates created with swag to other container(s): linuxserver/swag - LinuxServer.io

But no matter what i do the files are never readable/usable.
In this case i’m trying to use them in docker mailserver and the directory is mounted like this:

  • /swag-data/config/etc/letsencrypt/live/domain.tld/:/tmp/docker-mailserver/certs/:rw

And they are visible in the mailserver container:
root@mail:/tmp/docker-mailserver/certs# ls -la
total 28
drwxr-xr-x 2 1000 1000 4096 Jun 14 00:12 .
drwxr-xr-x 3 root root 4096 Jul 30 11:38 …
-rw-r–r-- 1 1000 1000 692 Feb 13 08:47 README
lrwxrwxrwx 1 1000 1000 35 Jun 14 00:12 cert.pem → …/…/archive/domain.tld/cert3.pem
lrwxrwxrwx 1 1000 1000 36 Jun 14 00:12 chain.pem → …/…/archive/domain.tld/chain3.pem
lrwxrwxrwx 1 1000 1000 40 Jun 14 00:12 fullchain.pem → …/…/archive/domain.tld/fullchain3.pem
-rw-r–r-- 1 1000 1000 5568 Jun 14 00:12 priv-fullchain-bundle.pem
lrwxrwxrwx 1 1000 1000 38 Jun 14 00:12 privkey.pem → …/…/archive/domain.tld/privkey3.pem
-rw------- 1 1000 1000 4560 Jun 14 00:12 privkey.pfx

But no way you can access them:
root@mail:/tmp/docker-mailserver/certs# more fullchain.pem
more: cannot open fullchain.pem: No such file or directory

Any suggestions?

That’s not the recommended mount point. Read the guide again

1 Like

Your right, i thought i needed full path to domain.ltd

Hey I’m currently in the same position. I’m using docker-mailserver and I’m unable to get it to recognize the mounted certificates.

Here’s how I mounted it.

  • /swag-data/config/etc:/swag-ssl:ro

I then specified the locations of these certificates in the environment.

  • SSL_TYPE=manual
  • SSL_CERT_PATH=/swag-ssl/letsencrypt/live/my-website.com/fullchain.pem
  • SSL_KEY_PATH=/swag-ssl/letsencrypt/live/my-website.com/privkey.pem

But my mailserver container reports that these keys do not exist. I can temporarily work around this issue by manually copying these certificates to another directory.

I’ve read the guide multiple times, and I can’t seem to get this to work. Any help is appreciated.

Exec into your mailserver container and do ls -al /swag-ssl/letsencrypt/live/my-website.com/fullchain.pem
What does it show?

Ohh, never mind I realize the issue. When I ran the ls command I found that those directories didn’t exist and no files were there. This is when I realized I accidentally mounted the wrong directory where my swag’s data is stored.
Sorry that’s my bad, really simple issue, I should’ve saw that. Thanks for all the help!

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