Setting up Kirby on NearlyFreeSpeech

There are a few other threads about this host. I like how cheap they are, and the old school vibe is nice, but they aren’t set up for Kirby (or any PHP CMS) by default. Starterkit/plainkit both fail. Thanks to some help from tobias on discord, I’ve somewhat wrapped my head around it.

This page actually had the answer all along, but I was a bit too dense to find it even though I read it over. I recommend reading it too and using your own best judgement:
https://faq.nearlyfreespeech.net/section/programming/phpwritingfiles#phpwritingfiles

Basically, in order for PHP to be able to write files, all the files need to be in the “web” group. I think this is equivalent to the “www-data” group on other hosts. So I just ran this from the root directory of the site:

chown -R :web .

Maybe you could be more picky about what you change here, but I just went for the whole folder.

This keeps the user the same, but changes the group of all the files to the web group, so yoursite:web. You can’t do web:web for whatever reason, but files created by the Panel will be web:web. Since there is no sudo privilege, if you need to do anything with files owned by the web user, you need “reposess” the files from the NearlyFreeSpeech user settings.

After this is done, you may need to set the permissions as well, and the standard wisdom on that seems to be setting folders to 755, and files to 644, but you actually need to do 664 on NFS, to allow group writes to the files. And by that logic, I guess 765 or 775 for folders, but this hasn’t been necessary for me. I had to because at this point in my troubleshooting I had screwed up the permissions already. And that should do it, the panel, media folder, and everything else should be functional. This has to be done for each site you make with NFS.

TL;DR: Set the user group of all files to “web” and set the permissions so files are writable by the group.

1 Like