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).
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.3:
[isabell@stardust ~]$ uberspace tools version show php
Using 'PHP' version: '8.3'
[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
Creating a "getgrav/grav" project at "./html"
Installing getgrav/grav (1.7.48)
- Downloading getgrav/grav (1.7.48)
- Installing getgrav/grav (1.7.48): Extracting archive
Created project in /var/www/virtual/isabell/html
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 98 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
|- Package flex-objects
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 /
`
Setup cronjobs
Open isabell.uber.space/admin/tools/scheduler Copy and paste the command from the page, it will look similar to this:
Refresh the page to see “Installed and Ready” You can now, if you wish, enable the default jobs, for example default-site-backup or create custom jobs.
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.48, Uberspace 7.16.7, PHP 8.3
Written by: Daniel Kratz <https://danielkratz.com>