How to Use Custom Domains

Payara Cloud offers customers on the Standard or Premium subscription tiers the ability to associate custom domains to namespaces. This feature enhances the accessibility of your applications deployed to such namespaces for end users, by providing a personalized and easily recognizable URL.

When applications are uploaded to a specific namespace in Payara Cloud, a default URL is created. This URL is formed by concatenating your namespace and application names, resulting in a link like: https://guide-docu-6696a94c.payara.app/demo (Note: This is a fabricated URL for illustration purposes).

However, these auto-generated URLs may not always align with your brand or be user-friendly, which is why the custom domain feature is valuable. It allows you to transform the default URL into a more brand-centric and user-friendly format such as https://yourAmazingBrand.com/app1, https://yourAmazingBrand.com/app2, and so on, simplifying the way end users access your deployed applications.

Add A Custom Domain

Select the namespace containing your application from the Namespace Navigator. In the Namespace Actions drop down menu, click Custom Domain

A screenshot displaying the menu to add a new domain
Figure 1. Namespace menu to add new domain

On the next screen, click Add Custom Domain.

Interface to add new domain
Figure 2. Button to click for adding a new domain

Enter the domain name you’d prefer to use for accessing your application in the Custom Domain Name field.

Interface for entering custom domain name
Figure 3. Custom domain addition screen on Payara Cloud

Click Set Custom Domain

You’ll now see the Custom Domain screen along with the information needed for setting up the DNS record.

Interface displaying DNS info for custom domain setup
Figure 4. DNS information screen for custom domain setup
The top-level domain name feature requires the domain registrar to support CNAME at the zone apex. This allows you to map the namespace URL directly to the root of the domain. Providers like Cloudflare use CNAME flattening to make such mapping possible. Check with your provider for details on setting CNAME records to the root of your domain.

For instance, if using Cloudflare as your domain host, create a new CNAME record in your domain dashboard as shown.

Cloudflare dns update view
Figure 5. Cloudflare domain record creation interface
  • ❶ Set record type to CNAME

  • ❷ Enter root domain name. Some providers also allow the use of the '@' symbol as a shorthand

  • ❸ Paste the DNS record value copied from Payara Cloud’s custom domain screen

  • ❹ Save

Return to the custom domain setup screen in Payara Cloud.

Interface showing DNS info for custom domain setup
Figure 6. Screen displaying DNS info for custom domain setup

Click Check DNS

Your namespace should now be linked to the configured domain.

Interface displaying fully setup custom domain
Figure 7. Fully configured custom domain post DNS propagation
DNS propagation duration may vary based on your domain name provider, taking anywhere from a few minutes to 48 hours. Check DNS propagation using online tools such as https://dnschecker.org/

With the custom domain configured, all applications deployed to the namespace can be accessed as sub-paths of the set domain. For instance, an application deployed to the context path myapp1 would be accessible via the URL https://jakarta101.com/myapp1.

Edit/Remove Custom Domain

You can always edit or remove configured domains for namespaces on the Custom Domain page.

Interface displaying fully setup custom domain
Figure 8. Custom domain page showing additional operations