LochStudios  /  Help Centre  /  cPanel  /  Use the File Manager

Use the File Manager

Browse, upload, and edit files on your shared hosting from cPanel File Manager, including hidden files, permissions, and Trash.

Updated

The File Manager in cPanel lets you work with website files in the browser: upload, download, edit, compress, extract, and delete. You do not need a separate FTP client for everyday changes.

This article is for Beginner and Standard shared hosting. Open cPanel from the portal. Do not guess a hostname.

For a large folder or many files, use FTP. For a new WordPress site, install from WordPress Toolkit or Installatron first. See Install WordPress.

Open cPanel

  1. Sign in at the portal.
  2. Open the hosting service for the site.
  3. Click Log in to cPanel.

You do not need a server hostname to get in.

Open the File Manager

  1. In the Files section, open File Manager.
  2. A new tab shows the file browser.
  3. The left tree is folders. The main pane is the contents of the folder you have selected.

The first time you open it, cPanel may ask which folder to start in. Choose Web Root (public_html) to land on the main website, or Home Directory to land one level above that (backups and account files live there). You can change this later under Settings.

Settings worth turning on

  1. Click Settings (the gear) in the File Manager toolbar.
  2. Tick Show Hidden Files (dotfiles). You need this to see .htaccess, .user.ini, and other files that begin with a dot.
  3. Pick a default directory if you want the same starting folder every time.
  4. Click Save.

Without hidden files, a missing .htaccess is easy to miss when you are fixing a 500 or setting custom error pages.

Where files live

FolderWhat it is
Home (the Home button)The account root (/home/username). Backups you generate sit here. Click Home when you are deep in a site folder and need to come up. It is not public_html.
public_htmlDocument root for the main domain. Pages, assets, and WordPress for that name belong here.
Addon / subdomain folderDocument root for that extra site. See Add an Addon Domain and Create a Subdomain.
mailMailboxes stored on this hosting account. Do not delete it.
etc, ssl, and other account foldersAccount configuration. Leave them alone.

Do not upload an addon or subdomain site into the main public_html folder unless that is the document root you chose.

Upload files

  1. Open the folder that should receive the files.
  2. Click Upload in the toolbar.
  3. Choose one or more files from your computer, or drag them onto the upload page.
  4. Wait for the progress bar to finish.
  5. Tick Overwrite existing files only when you mean to replace what is already there.
  6. Click Go Back (or close the upload tab) to return to the folder.

Most browsers also let you drag files straight into the main File Manager pane.

Uploads count toward the plan disk limit. Check space first if the transfer is large: Check Disk Usage. If the browser stalls on a big archive, use FTP instead.

Download files

  1. Select the file (or several files).
  2. Click Download in the toolbar, or right-click and choose Download.
  3. Your browser saves the file to its usual download folder.

To take a whole folder, Compress it first (below), then download the archive.

Create and edit files

New file

  1. Open the destination folder.
  2. Click + File (or right-click an empty area and choose Create New File).
  3. Enter a filename, including the extension (for example index.html or phpinfo.php).
  4. Click Create New File.

New folder

  1. Click + Folder.
  2. Enter a name with no spaces if you can (use hyphens).
  3. Click Create New Folder.

Edit

  1. Select a text file (HTML, PHP, CSS, JS, .htaccess, or similar).
  2. Click Edit for a simple editor, or Code Editor for line numbers and highlighting. HTML Editor is a visual editor for HTML only.
  3. If cPanel asks for a character encoding, leave utf-8 unless you already know the file uses something else. Tick the option to skip this prompt if you always want utf-8.
  4. Make the change.
  5. Click Save Changes.

Do not use the HTML Editor on PHP or .htaccess. A bad save can take the site down. We keep hourly backups of the account if you need a file put back.

Delete any phpinfo.php you create as soon as you have used it. See Choose your PHP version.

Copy, move, rename, and delete

  • Rename: select the item, click Rename, type the new name, confirm.
  • Copy: select the item, click Copy, choose the destination folder.
  • Move: select the item, click Move, choose the destination folder.
  • Delete: select the item, click Delete. cPanel sends it to Trash first unless you tick the option to skip Trash.

Empty Trash after you are sure you do not need the files. Items in Trash still count toward disk.

If you delete the wrong file, look in Trash first. If it is already gone, open a support ticket and ask us to restore from the hourly copies. Tell us the domain, the path, and the date you need.

Do not delete folders you do not recognise, especially etc, mail, ssl, or hidden files at the account root.

Compress and extract

Use this to move a folder in one file, or to unpack an archive you uploaded.

Compress

  1. Select the files or folders.
  2. Click Compress.
  3. Choose Zip Archive unless you have a reason to use tar.gz.
  4. Confirm the filename and location.
  5. Click Compress File(s).

Extract

  1. Select the .zip, .tar.gz, or similar archive.
  2. Click Extract.
  3. Confirm the destination folder.
  4. Click Extract File(s).

Extract into the document root you mean. A zip that contains a top-level folder will create that folder inside the destination. Check the result before you change DNS or tell anyone the site is live.

After you extract, delete the archive and empty Trash so it does not fill the plan.

File permissions

Permissions control who can read, write, or run a file.

1. Select the file or folder.
2. Click Permissions (or right-click → Change Permissions).
3. Set the usual values:
- Folders: 755
- Files: 644
4. Click Change Permissions.

Do not set 777. That lets anyone write to the path and is a common way sites get infected. See Keep your website secure.

If a script still cannot write after 755 / 644, open a support ticket rather than opening the permissions further.

Hidden files and .htaccess

With Show Hidden Files on, you will see .htaccess in public_html (and in addon / subdomain document roots). That file controls redirects, custom error pages, and some PHP overrides.

A typo in .htaccess can send the whole site to a 500. If that happens, rename the file in File Manager (for example to htaccess.bak) to restore the site, then fix the line. See Fix a 500 Internal Server Error and Set up custom error pages.

If something looks wrong

  • You cannot see .htaccess: turn on Show Hidden Files in Settings.
  • You landed in the wrong site: check you are in that domain's document root, not the main public_html.
  • Upload failed or stopped: check disk usage, try a smaller file, or switch to FTP.
  • The site is a 500 after an edit: rename .htaccess as above, or restore the file you just changed from Trash.
  • The Home button did not take you to the website: Home is the account root. Open public_html (or the addon / subdomain folder) from there.

If a file will not save, an upload never finishes, or you are unsure which folder is the document root, open a support ticket and we will look with you.

Related


Was this article helpful?

← Back to cPanel