Kirby permissions

I’ve recently set up a kirby site on a Digitalocean VPS with nginx as the server. I’d like to use the panel, but I’m running into some problems.

The standard is that php runs as the user www-data. However I’m putting my site on the server with git, ssh-ing in as user robin. I’ve set permissions to 755, but it seems lirby cannot write to the appropriate folders (for instance, site/accounts). I’ve tried running php as user robin, as per this, but got this error: “Unknown: open(/var/lib/php/sessions/sess_g7qi1s9dmh1ijo8q06vkh3flc2, O_RDWR) failed: Permission denied (13)” so I think that’s causing some other problems.

What are the correct permissions and how does one solve this?

I could run

You could use a post-checkout/post-merge hook to change the user and permissions automatically each time the repo is deployed to the server.

1 Like

Ah, of course. I already have a post-receive hook, so I suppose I can put it in there. Thank you so much!

Are you sure you are transferring via ssh using the right credentials? I had all sorts of crazy permissions problems until I realised i was transferring the files with my account, which wasn’t the account that had ownership of the server files.

You need to figure the name of the account that owns the folders, and use SSH as that user. It’s probably root or something (you shouldn’t leave root enabled).

I would recommend using rSync to transfer the files.