Theme: Correct File Permission for Folders and Files

Can someone please, just to clarify, what file permission the config.production.json file should have and what the theme folder and theme files should have?

I am asking and I need clarification on this because each time I run ghost upgrade, it always fails due to incorrect file permissions (Digital Ocean, Console, logged in as ghost-mgr running ghost upgrade from cd /var/www/ghost).

And each time, it all gets corrupt, forcing me to remove the droplet and create a new one.

First of all, run ghost doctor and check what are the errors.

Alright, I’ll do that next time. Any other ideas as to why the file permission error would occur? Checking in FileZilla, files are set to 644 and folder to 755.

I cannot say the exact reason without checking it. Now you can execute ghost doctor and check what are the errors.

Yep, I’ll do that. Next time, I’ll even switch to the default Casper theme before running the upgrade.

No, you do not want to wait till the next upgrade. You can execute ghost doctor at any time. Recently I have migrated my Ghost instant to DigitalOcean from GCP and I also got an issue with DIR permission. When I execute ghost doctor, it showed me the errors and how to fix them. Within few seconds I was able to fix them all.


Yep, it did the same for me.
I ran the following and it’s all fine now:

sudo find ./ ! -path "./versions/*" -type f exec chmod 664 {} \;

All that remains now is waiting for 4.2.3 or whatever version that comes next and see if it upgrades without issues.

Ahh… I finally understand the “hassle” :slight_smile:

If and when editing a file locally (development) and when done, uploading it to the server using FileZilla, the owner is changed to root. Ghost doesn’t “like” that and complains about permission issues during an upgrade.

Therefore, I first needed to change the owner into ghost and then run the file permission code (DO, Droplet). Then ghost doctor checks all the marks.

Now that I “get it”, I can’t wait to see how the next upgrade goes.

Yes if you are using Ghost on DO droplet you have to change user to ghost-mgr from root by executing sudo -i -u ghost-mgr.

Yes, but not only that – I needed to change the owner to ghost and then change the file permission of all files before I could run the doctor command.