Where your website files live (public_html and document roots)

public_html, document root, folders, addon domain, home directory · 0 found this helpful

Everything the world can see on your website sits in one folder called public_html. Knowing this folder, and its cousins, saves you from the most common upload mistake: putting files where the web server never looks.

The idea

When someone visits https://example.ca, the web server looks inside a document root, which is the folder assigned to that domain. For your main domain the document root is public_html.

Think of North Shore Bakery's account as a building. The home directory is the whole building. public_html is the shop floor customers can walk into. Other rooms, like mail and logs, are staff only.

A typical layout

/home/yourusername/
├── public_html/              <- example.ca (main domain)
│   ├── index.html
│   ├── wp-content/
│   ├── blog/                 <- example.ca/blog
│   └── .htaccess
├── shop.example.ca/          <- document root of an addon domain or subdomain
├── mail/                     <- email data, not public
├── logs/                     <- access logs, not public
└── tmp/

Document roots for other domains

Type Default document root Learn more
Main domain public_html this article
Subdomain shop.example.ca public_html/shop or a folder you choose Create a subdomain
Addon domain other.ca public_html/other.ca or a folder you choose Addon domains
Alias Same as the domain it points to Domain aliases

Check or change any of these in Account → Hosting → your site → Websites. The Folder column shows each domain's document root, and Change folder edits it.

Tip: Put addon domains outside public_html (for example /home/yourusername/other.ca). Then example.ca/other.ca doesn't also show that site.

Rules of thumb

  • Files in public_html are public. Don't leave backups, database dumps, or .env files there.
  • The home page is index.html or index.php. See Default index files.
  • Folder and file names are case-sensitive.
  • Stay out of hidden system folders, etc, and mail. Changing them can break email or your site.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.