Skip to content
New: Laravel Hosting, Node.js Hosting & GitHub DeploysSee the plans →
Products
Solutions
Developers

Guides

How to create a subdomain with its own SSL

Add a subdomain in the panel, what happens to DNS and SSL automatically, and the document root decision that decides what it serves.

Introduction

A subdomain, such as blog.yourdomain.com or app.yourdomain.com, has its own DNS record, its own SSL certificate, and its own document root. This guide covers creating a subdomain in the panel, choosing what it serves, and how its DNS and SSL are configured.

Creating a Subdomain

In the panel, open your site and go to Domains, then Add domain. Enter the full subdomain, for example blog.yourdomain.com, and choose it as a subdomain of your existing domain. The subdomain will appear in the domains table next to the main domain, tagged as a subdomain.

Choosing a Document Root

Every domain in the table has a document root, which is the folder its visitors are served from. A subdomain typically uses one of two configurations:

  • Its own folder, for example public_html/blog. Use this when the subdomain is a separate application, a landing page, or a staging copy. Most subdomains use this configuration.
  • The same folder as the main domain. Use this when the subdomain should show the same site. This is mostly used by applications that route by hostname themselves.

Choose the folder when you create the subdomain, then place an index.php or index.html file in it.

Note: A subdomain that points at an empty folder returns an error rather than a blank page. Check the folder’s contents before troubleshooting the subdomain itself.

DNS and SSL

Litehost Nameservers

If your domain uses our nameservers, the subdomain’s DNS record is created for you. A free SSL certificate is issued automatically once the record resolves, in the same way as the main domain. The Security page lists the subdomain with its own certificate status and its own Force HTTPS toggle.

A new subdomain may take up to an hour to complete this process. If the padlock takes longer, see the SSL guide.

External DNS

If your DNS is managed elsewhere, add the subdomain at your DNS provider and point it at the same place as your main domain. Everything else proceeds in the same way. If you use Cloudflare’s proxy, see the Cloudflare guide.

Subdomains and Additional Websites

A subdomain is part of the site that owns the parent domain. It shares that site’s storage, is managed from the same panel screens, and does not use up a hosting account.

If you need a separate site with separate access, you need an additional website rather than a subdomain. Open a ticket and we will set it up with you.

Keep reading

Other guides

Start building today

Laravel apps with queues and Horizon, WordPress stores, Node.js servers. One container with SSH, deploys from GitHub and people who answer. One bill a year.

Launch my site