Grav Flat-File CMS Installation and Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Grav Flat-File CMS Installation and Setup
Simple
from 4 hours to 2 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Installation and Setup of Grav (Flat-File CMS)

Grav does not require a database. Minimum requirements: PHP 7.3.6+ (recommended 8.1+), extensions mbstring, curl, ctype, dom, gd, json, xml, zip. Apache or Nginx.

Installation

# Option 1: Direct download
curl -L https://getgrav.org/download/core/grav-admin/latest -o grav-admin.zip
unzip grav-admin.zip -d /var/www/mysite
cd /var/www/mysite

# Option 2: Via Composer
composer create-project getgrav/grav /var/www/mysite

# Set permissions
find . -type f | xargs chmod 664
find . -type d | xargs chmod 775
find . -type d -name cache | xargs chmod 777
find . -type d -name logs | xargs chmod 777
find . -type d -name images | xargs chmod 777
find . -type d -name assets | xargs chmod 777

Nginx Configuration

server {
    listen 80;
    server_name mysite.com;
    root /var/www/mysite;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # Protect system directories
    location ~ ^/(\.git|cache|logs|backup|bin|system|vendor|\.env) {
        return 403;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

system.yaml Configuration

# user/config/system.yaml
home:
  alias: /home

pages:
  theme: my-theme
  markdown:
    extra: true          # enable Markdown Extra (tables, footnotes)
    auto_line_breaks: false

cache:
  enabled: true
  driver: auto
  lifetime: 604800

debugger:
  enabled: false

errors:
  display: 0
  log: true

languages:
  supported: [ru, en]
  include_default_lang: false
  translations: true

site.yaml Configuration

# user/config/site.yaml
title: My Site
author:
  name: Company
  email: [email protected]

metadata:
  description: Site description

taxonomies: [category, tag]

summary:
  enabled: true
  size: 300

GPM — Package Manager

# Update package list
bin/gpm index

# Install plugin
bin/gpm install form login admin sitemap feed

# Update everything
bin/gpm update

# Update Grav core
bin/gpm selfupgrade

# List installed packages
bin/gpm list

Create Admin User

# Via CLI (without web installer)
bin/plugin login newuser \
  --user=admin \
  --password=Admin123! \
  [email protected] \
  --name="Admin Name" \
  --admin=true

Environment Configuration Customization

# user/config/env/production/system.yaml — production overrides
cache:
  enabled: true
  driver: redis
  redis:
    socket: '/var/run/redis/redis.sock'

debugger:
  enabled: false
# user/config/env/development/system.yaml
cache:
  enabled: false

debugger:
  enabled: true
  shutdown:
    close_connection: true

Environment switching via GRAV_ENVIRONMENT=production variable or via setup.php:

// setup.php in root
$environment = getenv('GRAV_ENVIRONMENT') ?: 'production';
define('GRAV_ENVIRONMENT', $environment);