Fix Linux File And Folder Permissions When Using Laravel Forge

If you use Laravel Forge and move some files to another users account (using isolated users), you will have to fix the file and folder permissions.

First step is to set the correct owner. You can do that by running:


Replace CORRECT_USER by the name of the correct user (the ‘isolated’ username) and replace FOLDERby the name of the folder, that contains the desired files and folders (e.g. public).

Next step is to fix the file and folder permissions. The files should have 644, the folders 755 permissions. You can do that by running these commands:

sudo chmod -R 644 FOLDER
sudo chmod -R +X FOLDER

Again, you have to replace FOLDERby the correct name of the folder. The first command sets the permissions to 644 (everyone can read the file / folder, the owner can read and write).

The second command adds the Execute-Flag to all folders, so that the folder permissions become 755 (everyone can read and execute the folder, the owner can read, write and execute).