Grav

Grav is an open source flat-file (no database) content management system written in PHP.

It was developed with a focus on speed, simplicity, and flexibility. Content can be managed by easily editing folders and markdown files or using an admin panel (GUI).


Note

For this guide you should be familiar with the basic concepts of

License

Grav is released under the MIT License. All relevant information can be found in the LICENSE.txt file in the repository of the project.

Prerequisites

We’re using PHP in the stable version 8.1:

[isabell@stardust ~]$ uberspace tools version show php
Using 'PHP' version: '8.1'
[isabell@stardust ~]$

Your website domain needs to be set up:

[isabell@stardust ~]$ uberspace web domain list
isabell.uber.space
[isabell@stardust ~]$

Installation

To install Grav we use Composer to create a new project in our document root.

[isabell@stardust ~]$ cd /var/www/virtual/$USER
[isabell@stardust isabell]$ composer create-project getgrav/grav html
Installing getgrav/grav (42.2.1)
 - Installing getgrav/grav (42.2.1): Downloading (100%)
Created project in /var/www/virtual/isabell/html
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 67 installs, 0 updates, 0 removals
[...]
[isabell@stardust isabell]$

Visit your previously set up domain isabell.uber.space and you will see a page confirming that the installation was successful.

Install admin panel

You can optionally install the Grav admin panel. To do so we use the integrated Grav Package Manager (GPM). Navigate to your installation directory and install the admin plugin. The package manager will ask you to confirm the installation.

[isabell@stardust ~]$ cd ~/html
[isabell@stardust html]$ bin/gpm install admin
GPM Releases Configuration: Stable
The following dependencies need to be installed...
 |- Package form
 |- Package login
 |- Package email
Install these packages? [Y|n] Y
[...]
[isabell@stardust isabell]$

After the installation you need to open isabell.uber.space/admin in your browser to create an admin account (please don’t use admin as your username).

Setup domain

If you setup Grav not in the document root, html, you have to adapt the .htaccess file from:

` # RewriteBase / `

to this:

` RewriteBase / `

Tuning

Grav turns on caching out of the box to improve the performance of your site. It will automatically use the best cache driver available. You can find more information in the Grav Documentation under Performance & Caching.

Updates

Note

Check the update feed regularly to stay informed about the newest version.

To update Grav you can use the integrated Grav Package Manager (GPM). To update the Grav core navigate to your document root and use the selfupgrade command.

[isabell@stardust ~]$ cd ~/html
[isabell@stardust html]$ bin/gpm selfupgrade --force
[isabell@stardust isabell]$

After updating the Grav core use the update command to update all plugins and themes.

Warning

Please make sure to always update the Grav core first before updating plugins and themes.

[isabell@stardust ~]$ cd ~/html
[isabell@stardust html]$ bin/gpm update --force
[isabell@stardust isabell]$

Tested with Grav 1.7.37.1, Uberspace 7.13, PHP 8.1

Written by: Daniel Kratz <https://danielkratz.com>