How to install Grav on Debian 9

Hello guys, As you can see, I have moved from Wordpress to Grav!!

For those who don't know what is Grav, it is an opensource flat-file CMS (Content Management System), meaning without the need of a database. It has been developped from the start to be as performing as possible.

It is also very flexible and easy to use/maintained.

Written in PHP, it leverages Markdown files to store the content, Grav does not require a database. Everything is stored as simple files. It makes it quite fast to run (Especially on SSD) and easy to back up !! You can see all the features here.

Actually my migration experience was a bit more tricky then expected, but I'm quite happy to be on Grav now. On the main issues I faced, I can mention:

  • Only 1 plugin in Wordpress to migrate to Grav called WP2Grav but it cannot keep the comments and the markdown created files required some polishing (I had to use some commands like sed -i... to replace some content)
  • As I imported around 200 articles, the related-pages pluging of Grav were significantly slowing down the blog, creating even loading errors (because it needed more than 30s to display the page...)
  • I had to tweak some files of my template to do what I wanted. Actually it was not difficult, but since there is little documentation yet, it was not as simple as I thoughts.

But overall I'm satisfied.

Now let's see how to install Grav on your Linux server (Debian in my case. Ubuntu should be similar)

Installation Steps

First you will need to have a working LAMP server. If it is not the case, you can check my recent article on how to install LAMP.

1) Refresh your source list and install the required php dependencies.

sudo apt update
sudo apt install php-curl php-fpm php-gd php-zip php-mbstring php-xml


2) Download the latest version of Grav

Go to the download section of the grav website: and check which version is the latest. I suggest you to download the one with the admin panel version (The 1.3.10 as of today's article). Then run:

cd /var/www/
wget -O


3) Assign the correct permissions

sudo chown -R www-data:www-data /var/www/grav-admin


4) Enable required Apache modules

You will need to enable the modules 'rewrite', 'proxy' and 'proxy_fcgi'. You will need also to enable the configuration of pfp-fpm. To do so, simply run:

sudo a2enmod rewrite proxy proxy_fcgi
sudo a2enconf php-fpm

and restart apache.

sudo systemctl restart apache2


5) Create a dedicated virtualhost

I suggest you to run a dedicated virtualhost (for a subdomain, or to better tailor Grav CMS later on). To do this, run:

sudo nano /etc/apache2/sites-available/grav.conf

and copy:

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/grav-admin

        <Directory /var/www/grav-admin>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted

        ErrorLog ${APACHE_LOG_DIR}/grav_error.log
        CustomLog ${APACHE_LOG_DIR}/grav_access.log combined


I let you modify it to fit your needs.

Now enable it and reload apache:

sudo a2ensite grav
sudo systemctl restart apache2

If no issue, you should now have access to your Grav CMS using the configured URL. The first connection will ask you to create the admin account.

Once done, you will be good to go!


We may want to enable a HTTPS connection using a SSL certificate. I have a dedicated article on how to setup SSL certificate using Let's Encrypt. Pretty easy.

I also suggest you to read the official documentation to get yourself familiar with Grav's structure.

Happy blogging!


Loves to discover web-based apps to install on his own server@home and write articles about it


Add a comment