Skip to content

Configuring file permissions in File Manager

Learn how to use cPanel’s File Manager to set permissions for your website files and folders.

This guide explains how to adjust file permissions correctly to ensure your site works properly and remains secure.

On Linux servers, every file and directory has permission settings that tell the operating system who can read, modify, or execute them. There are three permission types:

  • Read (r or 4): Allows viewing the contents.
  • Write (w or 2): Allows modifying the contents.
  • Execute (x or 1): Allows running a file as a program or accessing a directory.

These permissions are applied to three user groups:

  • User: The file owner.
  • Group: Users in the same group as the owner.
  • World: Everyone else.

Permissions are represented numerically. For example:

  • Read (4) + Write (2) = 6

  • So a permission of 644 means:

    • User: Read + Write (6)
    • Group: Read (4)
    • World: Read (4)

Correct File Permission Settings for Websites

Section titled “Correct File Permission Settings for Websites”

Your web server must be able to read your files to display them online, so proper permissions are required.

Important: None of your files or folders should be writable by others. If World or Group has write permission, anyone could modify or delete your files.

HTML and Image Files (Permissions: 644)
These files must be readable by everyone.

User Group World
Read Set Set Set
Write Set - -
Execute - - -
Permissions 6 4 4

Directories (Permissions: 755)
Directories must be executable so they can be accessed.

User Group World
Read Set Set Set
Write Set - -
Execute Set Set Set
Permissions 7 5 5

CGI Files (Permissions: 755)
CGI scripts (usually in cgi-bin) must be executable.

User Group World
Read Set Set Set
Write Set - -
Execute Set Set Set
Permissions 7 5 5

How to Change File or Directory Permissions in cPanel

Section titled “How to Change File or Directory Permissions in cPanel”
  1. Log in to cPanel.

  2. Go to File Manager under the Files section.

  3. Select the file or directory you want to edit.

  4. Click the Permissions icon.

  5. Check or uncheck the boxes to adjust permissions.

    • The numeric code updates automatically.
  6. Click Change Permissions to apply.