Support article
What the public_html folder is on your hosting
Learn what public_html is, where to upload your website's files, its recommended permissions, and how to protect it in cPanel or DirectAdmin.
Introduction
The public_html folder is one of the most important folders in your hosting service. It’s where the files that make up your website are stored, and they become visible on the Internet when someone visits your domain.
In this guide we explain what public_html is, what it’s for, how it relates to www, what permissions it should have, and how to safely modify its files from your hosting panel or via FTP.
What the public_html folder is
public_html is your website’s public root directory. This means that anything you upload inside this folder can be loaded from the browser through your domain.
Inside public_html you’ll typically find files and folders such as:
- HTML, PHP, CSS, and JavaScript files.
- Images, videos, and other website resources.
- WordPress, Joomla, Drupal, or other CMS folders.
- Configuration files specific to your web application.
For example, if your domain is yourdomain.com, the server looks for the public content inside public_html to display the site to the visitor.
Which folder you should upload your website’s files to
Your website’s files should be uploaded to the public_html folder. You can do this in two common ways:
- From cPanel’s or DirectAdmin’s File Manager.
- Using an FTP client, such as Filezilla.
Before uploading files, check that you’re inside the correct folder. If you upload your site outside public_html, your domain may not display the page, or you may see an error.
How to modify files inside public_html
To edit or replace files inside public_html, follow these general steps:
- Log in to your hosting panel.
- Open the File Manager or connect via FTP.
- Go into the
public_htmlfolder. - Find the file you want to modify.
- Download a copy or make a backup before changing it.
- Edit the file or upload the new version.
- Save the changes and check the site from your browser.
It’s very important to make a backup before modifying files, especially if you’re going to change WordPress, PrestaShop, Joomla, or a live application’s files. If you work with WordPress, avoid editing core files unless you know exactly what you’re changing.
Recommended permissions for public_html
Permissions determine who can read, write, or execute files and folders on the server. Generally, the recommended setup is:
- Folders:
755 - Files:
644
In simple terms, each digit adds up the permissions you need: read (r) is worth 4, write (w) is worth 2, and execute (x) is worth 1. These permissions let the server display your site correctly while keeping files and folders from being left open insecurely.
Don’t change permissions to more open values, like 777, unless technical support tells you to for a very specific, temporary case.
How to protect the public_html folder
Since public_html contains files visible from the Internet, it’s worth taking care of its security:
- Keep the right permissions: folders at
755and files at644. - Use strong passwords for the panel, FTP, WordPress, and email accounts.
- Keep WordPress, PrestaShop, Joomla, plugins, themes, and extensions up to date.
- Don’t upload backups, databases, or private files inside
public_html. - Remove old files, installers, or tests you no longer need.
- Check for unknown files if you suspect an infection or unauthorized access.
If you need to store backups or private files, it’s safest to keep them outside the public folder whenever possible.
Which control panels use public_html
The public_html folder is used by hosting control panels such as cPanel and DirectAdmin. At miHosting, access to cPanel or DirectAdmin depends on the plan you signed up for. Both panels let you manage files, domains, subdomains, email accounts, databases, and other hosting features.
Which domain gets installed in public_html
Usually, public_html corresponds to your hosting service’s main domain — the domain used when signing up or setting up the account. You can also create subfolders inside public_html to organize content or to host other domains and subdomains, depending on what your plan and control panel allow.
The relationship between public_html and www
On some servers, especially cPanel environments, you may see a folder called www showing the same content as public_html. This usually means www is an alias or shortcut pointing to public_html. That’s why entering yourdomain.com or www.yourdomain.com can show the same website.
If your site doesn’t load the same with and without www, check your domain’s configuration, DNS, SSL certificate, and the application’s internal redirects.
How to install a new domain in public_html
To install a new domain on your hosting service:
- Make sure the domain is registered.
- Set up miHosting’s DNS to point to our servers.
- Log in to your control panel.
- Add the domain from the corresponding section.
- Choose the root folder where its files will be hosted.
- Upload the site to that folder.
- Wait for DNS propagation if you just changed the DNS servers.
You can use public_html or a subfolder, depending on how you want to organize the domains within your hosting. If you have doubts or run into issues during the process, you can contact our technical support team.
Useful tips
- Avoid mixing files from different websites in the same folder if you can help it.
- Use clear names for subfolders and projects.
- Back up before installing, deleting, or replacing files.
- If your site starts showing errors after modifying files, restore the previous copy or contact support.
Common problems
I uploaded my website but it doesn’t show
Check that the files are inside public_html or inside the folder assigned to the domain. Also confirm there’s a starting file, such as index.html, index.php, or the equivalent file for your application.
I see “Index of” instead of my website
The server can’t find a starting file (index.html, index.php) inside the folder, so it shows the file listing instead.
I see the same content in www and public_html
That’s normal in some configurations. In many cases, www points to the same folder as public_html.
I modified a file but don’t see the changes
This could be browser cache, WordPress cache, server cache, or you may have edited a copy of the file in another folder. Clear the cache and confirm the file’s path.
I can’t edit a file
The permissions may not allow writing, or the file may belong to another system user. Don’t change permissions insecurely — contact support if you can’t modify it from the panel.
Frequently asked questions
Is public_html a public folder?
Yes. Files inside public_html can be served by the web server and, in many cases, are accessible from the Internet.
Can I delete the public_html folder?
It’s not recommended. If you delete it, your website may stop working. If you need to clean up your site, only delete files you recognize and keep a backup.
Where should I upload WordPress?
Usually, WordPress should be installed inside public_html if it will be the domain’s main site. If it will be installed in a folder or subdomain, it should be uploaded to the assigned path.
Can I have several domains inside public_html?
Yes, you can create folders for other domains or subdomains, as long as your plan and hosting panel allow it.
Conclusion
public_html is your website’s public root. That’s where you should upload your page’s files so they can be seen through your domain.
Before modifying files, check that you’re in the right folder, use secure permissions (755 for folders, 644 for files), and make a backup. If you have questions about your hosting’s structure or need help uploading your site, miHosting’s support team can guide you.