A distinct site under your domain.
THE STEPS
- cPanel > Domains > Create a subdomain
- If DNS is external, add an A record for it there
- Confirm it resolves
- Run AutoSSL, ticking the subdomain
- Install the application in its directory
THE DOCUMENT ROOT
cPanel sets one automatically. If the application expects a different structure, adjust it under Domains.
Modern frameworks frequently expect the web root to point at a subdirectory. Serving the project root exposes configuration files.
WHY A SUBDOMAIN RATHER THAN A SUBDIRECTORY
Separation. Rewrite rules do not conflict, and the application has its own space.
A subdirectory shares the main site's .htaccess and cookies, which can cause genuine problems.
WHY A SUBDIRECTORY RATHER THAN A SUBDOMAIN
Search authority is shared, which suits content that is genuinely part of the same site.
CERTIFICATE COVERAGE
Each subdomain needs it. Run AutoSSL after creating one.
A subdomain does not receive mail unless you configure it to. Usually you do not want it to.
REMOVING IT
Remove the subdomain in cPanel and the DNS record if external.