Install SSL on subdomain

Hi. I get an error when I install the ssl certificate on the subdomain. I have self-hotsing. My main domain has an SSL certificate installed. And it is not installed on the subdomain. What could be the problem?


Debug Information:
OS: Ubuntu, v20.04.3 LTS
Node Version: v14.17.6
Ghost Version: 4.18.0
Ghost-CLI Version: 1.17.3
Environment: production
Command: ‘ghost setup ssl’

1) ProcessError

Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#'  /etc/letsencrypt/ --issue --home /etc/letsencrypt --domain --webroot /var/www/ --reloadcmd "nginx -s reload" --accountemail
#node-sudo-passwd#[Wed 13 Oct 2021 06:51:20 PM MSK] Can not init api, for

I already have Ghost installed on my main domain. I also want to install Ghost on a subdomain to present my theme there. This is done, for example, on

I also want to note that when installing ghost on a subdomain, I get an error when setting up nginx, which causes the installation of the ssl certificate to be skipped

Enter your Ghost database name: ghost
✔ Configuring Ghost
✔ Setting up instance
+ sudo chown -R ghost:ghost /var/www/maroon/content
✔ Setting up "ghost" system user
ℹ Setting up "ghost" mysql user [skipped]
? Do you wish to set up Nginx? Yes
+ sudo mv /tmp/maroon-scripstr-ru/ /etc/nginx/sites-available/
+ sudo ln -sf /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
+ sudo nginx -s reload
**✖ Setting up Nginx**
**Nginx setup task failed, skipping SSL setup**

I used a sertbot to solve a problem

Go to>Site Tools > Security> SSL Manager.
Select the subdomain from the Select Domain> dropdown and choose the desired type of SSL and then Click Install.