Skip to content

Powered by Grav + Helios

Vultr

Vultr

Vultr is another entry in the SSD-Powered VPS market and offers similar features and functionality as the other VPS providers, but for slightly less money. You get 100% SSD Storage, Ultra fast Intel CPUs and 14 low latency locations.

After creating an account and navigating to the Vultr Control Manager, click on the Deploy tab. Leave the server type on Compute Instances and choose a location:

Next select the Operating System from the list available. We have selected Ubuntu 24.04 LTS to be consistent with the other guides and because it's the latest, very popular, reliable, and well supported distribution.

For the Server Size you can pick a size that is appropriate for you but Grav will run great on any of them. For the sake of this guide, we'll use the 1 CPU, 1GB memory option that is currently priced at $8/month.

You can choose any optional features you would like, and then provide a simple Server Label to identify the VPS instance. We'll use Grav. Then click Place Order to create and install the server.

After a minute or so, your server should be ready and you can click the manage link next to your server in the list to get the server details. On this page you will be shown a control panel for the server that lets you control the state, along with the initial root username and password. You can can SSH via the command provided in this tab using the password you entered when you created the distribution instance. Public key authentication is recommended, and Vultur has SSH public key authentication documentation that walks you through the steps required.


This guide covers installing Grav on a fresh Ubuntu 24.04 LTS (Noble Numbat) VPS with Nginx and PHP 8.3.

Initial Server Setup

First, set up a local /etc/hosts entry to give your server IP a friendly name such as digitalocean.dev. This makes it easier to SSH to your server:

BASH

Update System Packages

After connecting as root, update all installed packages:

BASH
apt update && apt upgrade -y

Install Required Packages

Install Nginx, PHP 8.3, and essential extensions for Grav:

BASH
apt install -y vim zip unzip nginx git \
    php8.3-fpm php8.3-cli php8.3-gd php8.3-curl \
    php8.3-mbstring php8.3-xml php8.3-zip php8.3-intl php8.3-apcu

This installs:

  • Nginx - High-performance web server
  • PHP 8.3-FPM - FastCGI Process Manager for PHP
  • PHP Extensions - Required by Grav for image processing, caching, etc.

Configure PHP-FPM

Edit the PHP configuration for better security:

BASH
vim /etc/php/8.3/fpm/php.ini

Find cgi.fix_pathinfo (use /cgi.fix_pathinfo in vim to search), uncomment it and set to 0:

INI
cgi.fix_pathinfo=0

Warning

This setting prevents PHP from executing the closest matching file when the requested file isn't found - a significant security risk if left enabled.

Create a Dedicated User

Create a grav user to run the site (don't run web apps as root):

BASH
adduser grav

Provide a strong password when prompted.

Configure PHP-FPM Pool

Create a dedicated PHP-FPM pool for the grav user:

BASH
cd /etc/php/8.3/fpm/pool.d
mv www.conf www.conf.bak
vim grav.conf

Add the following configuration:

grav.conf
 1[grav]
 2user = grav
 3group = grav
 4
 5listen = /run/php/php8.3-fpm-grav.sock
 6
 7listen.owner = www-data
 8listen.group = www-data
 9
10pm = dynamic
11pm.max_children = 10
12pm.start_servers = 3
13pm.min_spare_servers = 2
14pm.max_spare_servers = 5
15
16chdir = /

Create Web Directory

Switch to the grav user and create the web directory:

BASH
su - grav
mkdir -p ~/www/html

Create a test file to verify the setup:

BASH
echo '<?php phpinfo();' > ~/www/html/info.php
exit

Configure Nginx

Create the Nginx server block:

BASH
vim /etc/nginx/sites-available/grav

Add the following configuration:

grav
 1server {
 2    listen 80;
 3    index index.html index.php;
 4
 5    ## Begin - Server Info
 6    root /home/grav/www/html;
 7    server_name _;
 8    ## End - Server Info
 9
10    ## Begin - Index
11    location / {
12        try_files $uri $uri/ /index.php?$query_string;
13    }
14    ## End - Index
15
16    ## Begin - Security
17    # deny all direct access for these folders
18    location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
19    # deny running scripts inside core system folders
20    location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
21    # deny running scripts inside user folder
22    location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
23    # deny access to specific files in the root folder
24    location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; }
25    ## End - Security
26
27    ## Begin - PHP
28    location ~ \.php$ {
29        fastcgi_pass unix:/run/php/php8.3-fpm-grav.sock;
30        fastcgi_split_path_info ^(.+\.php)(/.+)$;
31        fastcgi_index index.php;
32        include fastcgi_params;
33        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
34    }
35    ## End - PHP
36}

Enable the site and remove the default:

BASH
ln -s /etc/nginx/sites-available/grav /etc/nginx/sites-enabled/
rm /etc/nginx/sites-enabled/default

Test the configuration:

BASH
nginx -t

You should see:

TXT
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Start Services

Restart Nginx and PHP-FPM:

BASH
systemctl restart nginx
systemctl restart php8.3-fpm

Verify PHP is working by visiting http://YOUR_SERVER_IP/info.php. You should see the PHP info page with PHP 8.3 and APCu listed.

Caution

Remove the info.php file after testing: rm /home/grav/www/html/info.php

Install Grav

Switch to the grav user and download Grav:

BASH
su - grav
cd ~/www
wget -O grav.zip https://getgrav.org/download/core/grav/latest
unzip grav.zip
rm -rf html
mv grav html

Verify Installation

Visit http://YOUR_SERVER_IP and you should see the Grav is Running! page.

Test CLI Tools

Since you're running as the grav user, CLI tools work out of the box:

BASH
cd ~/www/html
bin/grav clear

Output:

TXT
Clearing cache

Cleared:  cache/twig/*
Cleared:  cache/compiled/*

Touched: /home/grav/www/html/user/config/system.yaml

GPM commands also work:

BASH
bin/gpm index

Optional: Install Admin Plugin

To install the Grav Admin panel:

BASH
bin/gpm install admin

Then visit http://YOUR_SERVER_IP/admin to create your admin account.

Optional: Enable HTTPS with Let's Encrypt

For production sites, enable HTTPS using Certbot:

BASH
apt install -y certbot python3-certbot-nginx
certbot --nginx -d yourdomain.com

Certbot will automatically configure Nginx for SSL and set up auto-renewal.

Next Steps