Kirby on Netlify

Has anyone tried deploying a Kirby site to Netlify via github?

I was testing this today with the starter template but what i got was the default netlify 404 page.
The site works fine on my local server.

I’m thinking it has something to do with the .htaccess file being ignored on netlify but im not sure.
If anyone has successfully coupled Kirby and Netlify before, any help is greatly appreciated! Thanks

1 Like

Well, its worse than that - Netlify is intended for static sites. Its expecting plain old html or sites controlled by a headless CMS hosted elsewhere. There is no PHP or anything as far as i can tell.

1 Like

Not possible.

Netlify is intended for static websites (HTML/CSS/JS)
Kirby runs on dynamic language PHP, which is not allowed on Netlify.

i see. thanks for the answers. in that case, do you folks have a similar service to recommend? heroku etc

Which kind of “service” are you looking for?

Hi farisk, Arrived here 'cause I was also trying to host on Netlify. Did you find a solution to your Kirby hosting?

Thanks
David

well as others have mentioned here. its not possible on netlify.

i’ve also tried heroku. the site works ok but the admin pages dont run.

so i just bought a normal web hosting and uploaded everything there.

Thanks Farisk,
I guess you get what you pay for

You could run a generator to output a static version of your Kirby site, then drag it to netlify or via github…

Here’s discussion around one of these:

Sure, but not if you want to use the Panel.

1 Like

Yes, sadly. I’ve often wondered which was the best way for versioning deployment +panel.

I think the most common scenario is to have some kind of “publishing workflow”:

  • a PHP webserver (e.g. staging.my-website.com) where you put Kirby, setup the panel, add editor accounts, … and let the editors create content over there.
  • a production webserver (e.g. my-website.com) where you can either have
    • the same kirby installation as on your staging environment, but with aggressive caching (needs PHP - but no panel). Whenever your editors “publish” from the staging environment, the content is pushed to the production server (git/rsync/sftp/…), and its caches are cleared.
    • a static site, generated from your kirby installation on the staging environment (afaik there is no SSG plugin for kirby 3 yet?) which is then pushed onto static hosting (shared hosting/netlify/…)? Note that this only works if none of your website is dynamic (or the dynamic parts of it are fetched from serverless functions via other providers/servers).

Be prepared to develop a lot yourself (plugins/code/hooks/build pipelines/…) for these scenario’s, as this is not really Kirby’s “first use case” but it’s definitely possible :+1:.

1 Like

@bvdputte There is indeed a static plugin for kirby 3…

And for Kirby 2

1 Like

Aha, I didn’t know about that. Thanks for the links, James :raised_hands:.

FWIW, I personally feel more for a scenario with “Kirby as backbone + aggressive caching” vs a “pre-generated static site”. But this is obviously completely my preference/opinion. Use whatever you like :+1:

1 Like