Skip to main content

Grav is a flat file CMS, giving you the advantages of a Content Management System without requiring a database. A flat file system should perform well for small Web sites. Big sites need databases. Medium size sites might be able to use Grav, depending on how well Grav handles the file storage.

You can download Grav from https://getgrav.org/. Grav is standard PHP which means you can install it anywhere using Nginx or Apache as the Web server. I tested Grav on my notebook so that I can type in between coffee, swimming, and watching the pelicans gliding over the ocean.

This test is using Grav 1.7.48 downloaded on November 11, 2024 with the optional Admin section. The download is 18.9 MB and expands to 6,037 files using 48.5 MB on disk.

My previous tests in 2022 and 2020 resulted in Grav rating low for the projects I worked on. I am hoping for improvement. From what I can see online, the documentation is better.

To Beta or not to Beta?

The Grav download page offered a stable version and a beta version. They suggested the beta version for new sites but they were suggesting that a long time ago and the beta version is still not stable plus a comparison shows there is not much difference. I downloaded the current version.

Beta versions are often unreliable due to large scale testing finding unexpected problems. Add-on modules are often not updated until near the end of the beta phase. Usually everything is stable by the time the developers produce release candidates. Is the documentation updated? Skip the beta version if using Grav for the first time.

To Admin or not to Admin?

The Grav download offers a core Grav and a core + Admin plugin. I chose the Admin version as that is an important part of my testing. I also wanted to find out what flexibility you get from the Admin component.

Start with the Admin option. Learn Grav. The base can then be used for headless Web sites serving applications on mobile devices.

Built in

Grav has an interesting range of packages built in. Twig for templating. Markdown for simple content and Parsedown for extra markdown. The Gregwar Image Library contains useful functionality plus caching of generated images but the result is massively complex. Gregwar appears to be removed in the beta version.

There are also things like the Doctrine Cache module for an excessively abstract cache that does only half of what you need.

Other options

Plugins

Grav offers hundreds of plugin modules. Some are tiny bits that should be part of a bigger package containing related items. Some offer alternatives including several ways to login.

After you plan the functionality and select a range of plugins, you are ready to look at the "skeletons" to see which modules the skeletons use to achieve the same functionality.

The main problem with Grav plugins is the dependency on Javascript. There are a few interesting sounding modules I would use if they were built on modern technology instead of javascript.

Skeletons

Grav offers many "skeletons", preconfigured downloads that may contain a different theme, a selection of optional plugins, and sample pages. I suggest you read through the themes and plugins to see what you want before choosing a skeleton.

Most of the skeletons appear to be just examples of themes. There are a few designed to do something more than show a theme but their description does not indicate anything dramatic.

Themes

Managers, marketing people, and Web "designers" often put theme selection ahead of plugin selection, form before function. Web architects work out what is needed before handing the structure over to a decorator.

Many of the Grav themes repeat the same basics and change only the same images. By the time you remove the duplicates, there are about a dozen interesting variations.

Resources

Download and disk space

The download size is mentioned above. Disk usage jumps by 7 MB when you finish the installation without adding modules or themes. For my web sites, Grav could replace Drupal and use less space for code but there is not much real difference. Plus Grav is expanding in size.

Grav creates a whole lot of writable directories then tries to protect the directories from exploitation using either permissions or Apache directives. Most of those directories, perhaps all of those directories, should be moved outside of the public Web directory.

PHP

Grav requires PHP 7.3.6 or later. I am testing with PHP 8.3. Grav requires the PHP modules Ctype, Curl, DOM, GD, Mbstring, OpenSSL, XML, and Zip. DOM is part of the XML module. Grav looks for all these things the first time Grav starts. The installation checks and the admin reports are excellent. Always start with the Admin version to check the environment.

Symfony

Grav uses a bit too much Symfony. There are lighter weight alternatives to many of the Symfony components. Symfony is for big Web sites and adds too much overheads for small sites. In the long term, with all their active development, they might perform better than some alternatives for medium size sites. If you are a PHP developer, you could look at plugging in alternatives to help Grav use less processing power but it can be difficult as Symfony tends to lock people into using the bigger complex options.

Twig

Twig is the best thing from the Symfony developers and is efficient when the Twig cache options are used. Grav uses the main Twig cache. PHP developers could look at switching on some of the other Twig cache options. Switching to a possibly lighter alternative like Smarty is too difficult.

Install

Grav is hard to install. I do not know why anyone bothers. There are several sets of instructions and the main ones fail. You could resort to Composer but then you would have no control and not know what is installed. There are scripts for installation and they fail. The normally good old reliable option is a manual install where you have complete control an know exactly what happens. Grav describes manual installation but it does not work.

There is no config for Nginx and the Apache config is so painfully bad that translating to Nginx is difficult.

Basic modifications

Grav makes too many folders public. Grav then uses a complicated Apache .htaccess configuration file in an attempt to protect the public files that should not be public. You could move those directories outside the public Web root directory. The Grav code is just too complicated to change.

Conclusions

Grav is actively developed, uses a bit too much Symfony, and might bloat out further. If Grav development aims at simplicity and efficiency instead of complexity or processor intensive code, Grav is a good long term option for small to medium Web sites. Currently it is moving up out of small Web site territory.

Modifying Grav for what I want is too complicated.

Tags: