Skip to main content
Version: 1.X.X

Setting Custom SSL Certificates for HiTechCloud, HiTechAdmin, and Webmail

โš ๏ธ Currently, adding custom SSL certificates for HiTechCloud and Webmail is only possible from the terminal.

  • Let's Encrypt certificates are stored in /etc/hitechcloud/caddy/ssl/acme-v02.api.letsencrypt.org-directory/
  • Custom certificates must be placed in /etc/hitechcloud/caddy/ssl/custom/

Custom SSL for HiTechAdmin and HiTechCloudโ€‹

Follow these steps to configure a custom SSL certificate for HiTechAdmin and HiTechCloud interfaces:

1. Add the certificateโ€‹

Create a directory custom in /etc/hitechcloud/caddy/ssl/:

mkdir -p /etc/hitechcloud/caddy/ssl/custom/

Then create directory name same as your domain

mkdir -p /etc/hitechcloud/caddy/ssl/acme-v02.api.letsencrypt.org-directory/YOUR_DOMAIN_HERE/

Upload your SSL files to this directory and name them:

  • $DOMAIN.crt
  • $DOMAIN.key

Example:

/etc/hitechcloud/caddy/ssl/custom/srv.hitechcloud.org/srv.hitechcloud.org.crt
/etc/hitechcloud/caddy/ssl/custom/srv.hitechcloud.org/srv.hitechcloud.org.key

2. Set the domainโ€‹

hitechcloudcli domain set <DOMAIN_NAME>

Example:

hitechcloudcli domain set srv.hitechcloud.org

3. Configure Caddyโ€‹

Open the Caddyfile:

nano /etc/hitechcloud/caddy/Caddyfile

Find the section for your domain:

# START HOSTNAME DOMAIN #
example.net {
reverse_proxy localhost:2087
}

Add the tls line after reverse_proxy:

tls /etc/hitechcloud/caddy/ssl/custom/srv.hitechcloud.org/srv.hitechcloud.org.crt /etc/hitechcloud/caddy/ssl/custom/srv.hitechcloud.org/srv.hitechcloud.org.key

๐Ÿ‘‰ Replace srv.hitechcloud.org with your actual domain.

Restart Caddy to apply the certificate:

docker restart caddy

Custom SSL for Webmailโ€‹

1. Add the certificateโ€‹

Create a directory for your domain:

mkdir -p /etc/hitechcloud/caddy/ssl/custom/YOUR_DOMAIN_HERE/

Upload your SSL files and name them:

  • $DOMAIN.crt
  • $DOMAIN.key

Example:

/etc/hitechcloud/caddy/ssl/custom/webmail.hitechcloud.org/webmail.hitechcloud.org.crt
/etc/hitechcloud/caddy/ssl/custom/webmail.hitechcloud.org/webmail.hitechcloud.org.key

2. Assign the domainโ€‹

hitechcloudcli email-webmail domain <DOMAIN_NAME>

Example:

hitechcloudcli email-webmail domain webmail.hitechcloud.org

3. Configure Caddyโ€‹

Open the Caddyfile:

nano /etc/hitechcloud/caddy/Caddyfile

Locate the Webmail section:

# START WEBMAIL DOMAIN #
webmail.example.net {
reverse_proxy localhost:8080
}
# END WEBMAIL DOMAIN #

Add the tls line after reverse_proxy:

tls /etc/hitechcloud/caddy/ssl/custom/webmail.hitechcloud.org/webmail.hitechcloud.org.crt /etc/hitechcloud/caddy/ssl/custom/webmail.hitechcloud.org/webmail.hitechcloud.org.key

๐Ÿ‘‰ Replace webmail.hitechcloud.org with your domain.

Restart Caddy to apply the changes:

docker restart caddy

Custom SSL for Domains (End-Users)โ€‹

End-users can add their own SSL certificates directly from the HiTechCloud interface if the ssl module and features are enabled.

๐Ÿ“– Documentation: Custom SSL for Domains