Skip to content
Atlas Hoster
Website › Publier ses fichiers

The public_html folder: where to put your website's files

Updated on 18 November 2026Checked on cPanel 138 on 11 November 2026

On a cPanel hosting account, public_html is the folder that holds the files visible on the Internet. Everything in it can be seen by your visitors; the rest of your space stays private.

Before you start

  • You can access cPanel or an FTP account (see the article "Publish your website by FTP with FileZilla").
  • You know what you want to publish: an index.html page, a WordPress site, a folder of images…

What public_html is for

  • The home directory is the top-level folder of your account. It holds all the files your sites use. According to the cPanel glossary, visitors cannot see anything it contains, except what is in public_html or its subfolders.
  • public_html is a subfolder of the home directory. It holds the files reachable over HTTP, that is, by the browser. The www folder is a link to public_html.
  • The document root is the folder whose content is shown when someone types your domain's address. For the main domain, it defaults to public_html.

In practice, the full path of public_html is /home/your-username/public_html. You will need it, for example, to schedule a cron job.

<!-- ILLUSTRATION TO COME (plan A.7): /home/user folder tree diagram. Nothing created here. -->

Steps: put your files in the right place

  1. Open the File Manager. In cPanel, under "Files", click File Manager. The Settings menu (at the top) lets you choose the folder opened at start: pick Web Root (public_html or www) to land directly in the right folder.
  2. Go into public_html. In the left-hand column, click public_html.
  3. Drop your files. The Upload button sends files one by one. For a whole site, compress it to a .zip on your computer, upload the archive, then select it and click Extract (see the article "Use the cPanel File Manager"). With FTP, open public_html and drag your files into it.
  4. Name the home page index.html (or index.php). According to the Apache documentation, the server looks for an index.html file in a folder by default; the exact name can be configured. A WordPress site brings its own index.php.
  5. Check by opening your domain in the browser.

What about another domain?

When you add a domain or a subdomain, cPanel gives it its own folder, by default inside public_html (for example public_html/newdomain.com). That is where the domain's files go. You can see and change a domain's root in the Domains screen (Manage button), except for the main domain's. The folder does not move by itself: if you change the root, you must move your files yourself.

Expected result

Your site shows at your domain's address, and the files you do not want to publish (backups, configuration files) are somewhere other than public_html.

If something goes wrong

  • Your domain shows a default page or a list of files. Your files are probably next to public_html, or the home page file does not have the expected name (index.html, or index.php for a PHP site). Check the folder and the name.
  • The .htaccess file is invisible. Files whose name starts with a dot are hidden. In the File Manager, Settings, tick Show Hidden Files (dotfiles).
  • A sensitive file is reachable online. Everything in public_html is public, unless protected by a password or by .htaccess. Move it up, into the home directory.
  • After going live, the site has not changed. Clear your browser cache and check that you overwrote the right file.

FAQ

What is the full path of public_html? It is /home/ followed by your cPanel username, then /public_html.

Can I put files outside public_html? Yes, in the home directory, but they are then not reachable from the Internet. That is the place for anything that must not be public.

What is the difference between public_html and www? None: according to the cPanel glossary, www is a link to public_html.

How should I organise my site's folders? Keep names simple (lower-case letters, digits, hyphens, no spaces or accents). This is not a cPanel requirement but it avoids hard-to-read addresses and mistakes.

Going further

Need a space to publish your site? See our web hosting.

WebsiteAll guides