Grav CMS on Ubuntu 24.04 – A Modern Flat-File CMS for Lightweight Projects
Grav is a modern, open-source flat-file Content Management System (CMS) built with PHP. Unlike traditional CMS platforms like WordPress or Drupal, Grav does not require a database, instead storing content in markdown files, making it lightweight, portable, and easy to version control.
Running Grav CMS on Ubuntu 24.04 LTS offers developers and content creators a secure and performant platform for building websites without the overhead of database administration or complex stack maintenance.
What Makes Grav Unique?
Grav (from “gravity”) is designed to be fast, minimal, and developer-friendly:
- Flat-File Architecture: All content, configuration, and assets are stored as plain files.
- Markdown-Based Content: Pages are written in Markdown with support for front matter using YAML.
- Twig Templating Engine: Enables clean, reusable template logic with native PHP integrations.
- CLI Tooling: Grav includes a powerful command-line tool (
bin/grav
) for updating, installing plugins/themes, clearing cache, and checking system status. - No Database Required: Makes backups, migrations, and deployments trivial—just sync files via Git or rsync.
- Powerful Plugin Ecosystem: Includes Admin Panel, Form builder, Sitemap generation, SEO enhancements, multilingual support, and more.
- Built-In Caching & Performance: Uses multiple caching layers (file-based, memcached, etc.) for fast response times.
Why Use Grav CMS on Ubuntu 24.04?
Ubuntu 24.04 “Noble Numbat” brings the stability and long-term support developers expect (supported until 2029), while introducing key upgrades that align well with Grav’s requirements:
- PHP 8.3 (default in Ubuntu 24.04) is fully compatible with Grav core and plugins.
- Updated OpenSSL and libcurl versions improve HTTPS communication and update mechanisms.
- Systemd & service management enhancements simplify PHP-FPM, NGINX, or Apache service orchestration for Grav deployments.
- Filesystem performance optimizations in the Linux Kernel 6.8+ enhance I/O throughput for flat-file CMS use cases.
Ideal Use Cases for Grav
Grav is ideal when simplicity, speed, and control are more important than dynamic user interaction:
- Developer Portfolios: Lightweight and fast-loading with full Markdown control.
- Documentation Sites: Versionable, searchable, and static in structure.
- Landing Pages or Microsites: Ideal for marketing campaigns or one-pagers with minimal backend logic.
- Company Brochures / Catalogs: Add images, sections, and menus without complex workflows.
- Git-Managed Content Sites: Easily pair with GitHub/GitLab CI pipelines or Netlify-style hosting.
- Static Site Replacement: For users who need CMS features but don’t want a full LAMP/LEMP stack with a database.
Architecture Overview
Grav is composed of:
- Core Engine: PHP-powered parser and renderer that dynamically converts markdown to HTML on-the-fly.
- Twig Templating Layer: Separates logic from content, enabling reusable UI components and theme inheritance.
- YAML Configuration: All settings—from site-wide options to individual plugin behaviors—are managed through
.yaml
files. - Flexible Directory Structure: Organize content by folders, define modular pages, or split by language or taxonomy.
- Caching Layer: Supports APCu, Redis, Memcached, or file-based caching, configurable via
system.yaml
.
Grav CMS in DevOps & Cloud Workflows
Grav’s flat-file nature makes it highly compatible with DevOps best practices:
- Version Control: Everything lives in the repository—content, themes, configs—making Git-based deployment ideal.
- CI/CD Pipelines: Automate build and deployment using GitHub Actions, GitLab CI, Jenkins, or Shape.Host pipelines.
- Stateless Hosting: Grav can be served from a read-only container or mounted volume, with writeable cache directories.
- NGINX or Apache Compatible: Minimal reverse proxy configuration needed; can even run inside Docker containers or on VPS platforms like Shape.Host.
Security Considerations
While Grav is minimal and inherently has a lower attack surface due to its lack of a database:
- Disable unused plugins, especially the Admin Panel, unless you restrict access.
- Run behind HTTPS with Let’s Encrypt
- Apply file permissions properly (e.g., avoid 777 on cache/log folders).
- Monitor PHP versions, as Grav follows upstream PHP deprecations closely.
Plugin Ecosystem & Admin UI
While Grav can be managed entirely via file editing, many users choose the Grav Admin Panel plugin:
- Adds a browser-based GUI
- Supports media uploads, drag-and-drop pages
- Includes plugin and theme installation/updating
- Offers visual configuration of system YAML files
The admin plugin turns Grav into a headless or hybrid CMS, offering a smooth experience for non-technical editors.
Grav vs. Other Flat-File CMS Options
Feature | Grav | Hugo | Jekyll | Pico CMS |
---|---|---|---|---|
Language | PHP | Go | Ruby | PHP |
Templating | Twig | Go templates | Liquid | Twig |
Admin UI | Optional | No | No | No |
Content Format | Markdown | Markdown | Markdown | Markdown |
Build Model | Dynamic | Precompiled | Precompiled | Dynamic |
Grav offers a dynamic CMS experience with PHP while keeping the simplicity of static site generators, making it a hybrid of both worlds.
Grav CMS on Ubuntu 24.04 is a modern, lightweight, and developer-friendly platform perfect for content-heavy websites that do not require complex backends or relational databases. Its flat-file structure, Markdown content model, and PHP-powered engine make it a fast and elegant solution for small businesses, freelancers, and technical content creators.
For maximum performance and flexibility, Grav is best deployed on a Shape.Host Cloud VPS running Ubuntu 24.04, ensuring fast SSD storage, root access, and secure infrastructure designed for modern CMS workloads.
Step 1: Set Up a Server Instance on Shape.Host
Before installing Grav CMS, you need an Ubuntu 24.04 server up and running. Shape.Host provides a powerful and user-friendly cloud VPS platform ideal for this purpose. Here’s how to get started:
Visit https://shape.host and log in to your account.
From the dashboard, click the “Create” button and choose “Instance”.

In the setup screen:
Location: Choose a data center close to your primary user base.

Operating System: Select Ubuntu 24.04 (64-bit).
Resources: Opt for at least 1 CPU, 2 GB RAM, and 20 GB SSD for Grav CMS.

Confirm and click “Create Instance”.

After deployment, copy the public IP address shown under the “Resources” section for SSH access.

Step 2: Connect to Your Instance via SSH
Once your instance is active, use SSH to access it and begin the setup.
For Linux/macOS:
Open a terminal and run:
ssh root@your_server_ip
For Windows:
- Download and install PuTTY.
- Launch PuTTY, enter your server’s IP in the “Host Name” field.
- Click “Open” and log in as
root
when prompted.
Step 3: Install Grav CMS on Ubuntu 24.04
Follow the steps below exactly as executed in the setup history:
1. Update the system:
apt update

2. Install PHP and required extensions, as well as unzip and Git:
apt install php php-cli php-common php-curl php-gd php-mbstring php-xml php-zip php-intl unzip git

3. Install Apache:
apt install -y apache2

4. Enable Apache’s mod_rewrite
:
a2enmod rewrite
5. Restart Apache to apply changes:
systemctl restart apache2

6. Download and prepare Grav CMS:
cd /var/www
wget https://getgrav.org/download/core/grav-admin/latest -O grav-admin.zip

7. Unzip and organize the Grav files:
unzip grav-admin.zip -d grav
cd grav
8. Set the correct permissions:
chown -R www-data:www-data /var/www/grav
chmod -R 755 /var/www/grav

9. Create a new Apache configuration file for Grav:
nano /etc/apache2/sites-available/grav.conf
Paste the following configuration:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName grav.local
DocumentRoot /var/www/grav
<Directory /var/www/grav>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/grav_error.log
CustomLog ${APACHE_LOG_DIR}/grav_access.log combined
</VirtualHost>

Change
grav.local
to your actual domain or use your IP for testing.
10. Enable the Grav site and disable the default:
a2ensite grav.conf
a2dissite 000-default.conf
11. Reload Apache:
systemctl reload apache2

Step 4: Verify Installation
Open your browser and navigate to:
http://your-server-ip/grav-admin/admin
You will be prompted to create an admin user and configure the site. Once complete, you can start building with Grav’s admin panel.


For reliable, scalable, and fast cloud infrastructure, Shape.Host is your go-to provider. Their Cloud VPS solutions make deploying modern CMS platforms like Grav seamless and efficient.
Visit https://shape.host to deploy your Grav CMS today!