Where should I upload my website files?

The short answer:

The short answer to this question is the public_html/ directory.

Further detail:

Every cPanel account has what is called a home directory. This is the directory that you would normally see when you connect via FTP, SFTP or SSH using your accounts primary cPanel user details.

A brand new cPanel account home directory looks a little like this

.bash_logout
.bash_profile
.bashrc
.contactemail
.cpanel/
etc/
.htpasswds/
mail/
public_ftp/
public_html/
tmp/
www@

Depending on your software, you may not see the files and directories that begin with a dot (e.g. .htpasswds) - in cPanel's File Manager they appear once you tick Show Hidden Files (dotfiles) under Settings. In any case, never delete or modify any of these files or directories unless you know exactly what you are doing.

Your website files should be uploaded into the public_html/ directory. Written out in full that is /home/your-cpanel-username/public_html - it sits inside your home directory, not at the top of the server.

For example if your domain was example.co.uk then a file located at public_html/mypicture.jpg would be served to the internet as https://example.co.uk/mypicture.jpg

The www item is nothing more than a shortcut to the public_html/ directory - you can treat it as the same thing if you find that easier.

What about Add-on domains?

This is a slightly more complex question - for the answer please read Primary, Alias/Parked, Addon & Sub-domains explained.

What about the other files and directories?

All of the other files and directories are required to ensure your web hosting and email accounts function correctly. Therefore, if you are new to cPanel, stick purely to the public_html/ directory and you won't break your hosting account.


How did we do?

Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–