Folder Permissions for Web Hosting: Why Not 777, and How to Set 755 or 775 in FTP or SSH

Setting a folder to 777 makes uploads work, but it also lets any process on the server write there. On most hosts 755 for folders and 644 for files is all you need.

On most current web hosts, folders should be 755 and files 644. That’s enough for PHP to write uploads, because PHP usually runs as your own account user. Setting a folder to 777 lets every user and process on the server write to it, which makes it easy for malware to drop files there, and on some servers it even causes 500 errors. Use 775 only when your host runs PHP as a different user in a shared group, and 777 almost never.

Originally published in October 2010 as a CuteFTP how-to. Rewritten in December 2026 because 777 is no longer good advice.

What the numbers mean

Each digit is a set of permissions for one group of users: the owner, the owner’s group, and everyone else. Each digit adds up read (4), write (2) and execute (1).

ValueOwnerGroupEveryone elseTypical use
755read, write, enterread, enterread, enterFolders
644read, writereadreadFiles
775read, write, enterread, write, enterread, enterShared upload folders
600read, writenonenoneConfig files with passwords
777everythingeverythingeverythingAvoid

For folders, “execute” means permission to open the folder and list what’s inside.

Why uploads fail, and what fixes them

If an upload folder isn’t writable, the usual cause is ownership, not permissions. When PHP runs as your account user (suPHP, PHP-FPM or LiteSpeed’s lsphp, which most shared hosts use), a folder owned by you with 755 is writable. If files were uploaded by root or another user, fix the owner instead of opening permissions to everyone. Your host can do this, or you can run chown over SSH if you have access.

On hosts that run PHP as you, 777 folders are often refused outright, and PHP scripts inside them return a 500 error as a safety measure.

Set permissions in an FTP client

In CuteFTP, FileZilla or WinSCP, right-click the folder, choose Properties or File permissions, and enter the number, such as 755. FileZilla can apply it to subfolders too: tick “Recurse into subdirectories” and choose “Apply to directories only”. Then repeat with 644 and “Apply to files only”.

Set permissions in cPanel File Manager

Select the folder, click Permissions in the toolbar, enter the value and save.

Set permissions over SSH

These commands reset a whole site to the usual defaults:

find ~/public_html -type d -exec chmod 755 {} +
find ~/public_html -type f -exec chmod 644 {} +
chmod 600 ~/public_html/wp-config.php   # or 640 if your host needs it

Run them from your home folder and double-check the path first.

Windows servers

Windows hosting doesn’t use these numbers. Permissions are set per user in the control panel, such as Plesk’s File Manager, or by your host. Ask for write access for the application pool user on the upload folder only.

Common questions

My plugin says to set a folder to 777. Should I?

Try 755 first, then 775. If neither works, ask your host who PHP runs as. If you must use 777 temporarily, change it back once the problem is found.

What permissions should WordPress use?

Folders 755, files 644, and wp-config.php 600 or 640. WordPress needs to write only to wp-content/uploads for media, and to more folders only if you update plugins from the dashboard.

Can wrong permissions cause a 500 error?

Yes. On many shared hosts, PHP files or folders that are writable by group or everyone are blocked, and the server returns a 500 error.