You need to have a domain name and a DNS provider that supports wildcard subdomains.
You need to use dnsChallenge in Traefik to get wildcard certificates from Let’s Encrypt.
You need to use one of the supported DNS providers.
Configuration
Setup your wildcard subdomain DNS records, *.coolify.io.
Go to your Proxy settings (Servers / Proxy menu) and add the following configuration based on your providers. The example will use Hetzner as a provider.
You can also set env_file instead of environment in the example above, but then you need to create a .env file with the HETZNER_API_KEY variable on the server.
Change --certificatesresolvers.letsencrypt.acme.dnschallenge.provider=hetzner to your provider.
Now you have two options to configure your wildcard subdomain for your resources.
Normal
If you would like to use one (wildcard) certificate for all of your resources, you can use this option.
It is useful, because Traefik do not need to generate a new certificate for every resource, so new deployments will be available immediately without waiting for the certificate generation.
In your application, set your FQDN to a subdomain you would like to use: https://example.coolify.io.
SaaS
Redirect all subdomains to one application. You can use this option if you want to use Coolify as a SaaS provider.
In your application, leave the FQDN configuration empty.
Add the following custom label configuration:
traefik.http.routers.<unique_router_name>.tls.certresolver should be the same as your certresolver name in Traefik proxy configuration, by default letsencrypt.
traefik.http.services.<unique_service_name>.loadbalancer.server.port should be the same as your application listens on. Port 80 if you use a static deployment.