Skip to content
local-cert
Browse the documentation

Synology DSM

DSM's certificate wizard only knows Let's Encrypt and requires the NAS to be reachable from the Internet. acme.sh, installed on the NAS, obtains the certificate from local-cert and installs it in DSM with its synology_dsm hook.

ValueWhere to find itIn this guide
ACME directoryfixed for each instancehttps://certs.example.com/acme/directory
Key ID (kid)Keys & access → EAB credentialseab_XXXXXXXXXXXXXXXX
HMAC keyshown only once, at creationCLE_HMAC

1. Prepare the NAS

  1. Control Panel → Terminal & SNMP → enable SSH.
  2. Connect over SSH with an administrator account, then sudo -i.
install acme.sh outside the system volume
mkdir -p /usr/local/share/acme.sh/webroot
cd /tmp && wget -O acme.sh.tar.gz https://github.com/acmesh-official/acme.sh/archive/master.tar.gz
tar xzf acme.sh.tar.gz && cd acme.sh-master
./acme.sh --install --nocron --home /usr/local/share/acme.sh -m ops@example.com
cd /usr/local/share/acme.sh

2. Account and issuance

acme.sh
./acme.sh --register-account --server https://certs.example.com/acme/directory \
  --eab-kid eab_XXXXXXXXXXXXXXXX --eab-hmac-key CLE_HMAC

./acme.sh --issue --server https://certs.example.com/acme/directory \
  -d nas.home.example.com -w /usr/local/share/acme.sh/webroot

The webroot folder stays empty and is served by nothing: local-cert never reads the challenge. The NAS needs no open port.

3. Install in DSM

acme.sh — synology_dsm hook
export SYNO_SCHEME=http
export SYNO_HOSTNAME=localhost
export SYNO_PORT=5000
export SYNO_USERNAME='an-admin-account'
export SYNO_PASSWORD='its-password'
export SYNO_CERTIFICATE='local-cert'   # certificate description in DSM
export SYNO_CREATE=1                    # create it if it doesn't exist

./acme.sh --deploy -d nas.home.example.com --deploy-hook synology_dsm

The certificate appears in Control Panel → Security → Certificate. Assign it to the services you want with Settings.

4. Renewal

Control Panel → Task Scheduler → Create → Scheduled Task → User-defined script, user root, every day:

script
/usr/local/share/acme.sh/acme.sh --cron --home /usr/local/share/acme.sh

acme.sh only renews as expiry approaches, then replays the deployment into DSM with the remembered settings.