Header

Deploying ProcessWire on Vultr with DeployHQ

Devops & Infrastructure, Open Source, Tips & Tricks, and Tutorials

Post Image

Introduction

This guide explains how to set up and deploy ProcessWire using DeployHQ on a Vultr FreeBSD 13.0 server. DeployHQ will automate our deployment process, making it easier to manage updates and deployments. Please also note that this blogpost is similar to the Guide already published.

Prerequisites

  • A Vultr account with a FreeBSD 13.0 server
  • A DeployHQ account
  • A Git repository containing your ProcessWire project
  • SSH access to your server

Step 1: Initial Server Setup

Follow the package installation steps from the original guide:

$ pkg update
$ pkg install -y sudo nano unzip wget bash git
# Install PHP, Apache, MySQL and required modules as in original guide

Step 2: Configure DeployHQ

1- Create a new project in DeployHQ

  • Log into DeployHQ
  • Click "New Project"
  • Connect your Git repository

2- Configure Server Details

  • Click "Servers & Groups"
  • Add a new server
  • Select "SSH/SFTP"
  • Enter your Vultr server details:
  Protocol: SSH/SFTP
  Hostname: Your-Vultr-IP
  Port: 22
  Username: your-ssh-user
  Authentication: SSH Key

3- Configure Deployment Settings

  • Set deployment path: /usr/local/www/apache24/data/processwire
  • Configure deployment commands:
  # Post-deploy commands
  chmod -R 755 /usr/local/www/apache24/data/processwire
  chown -R www:www /usr/local/www/apache24/data/processwire

Step 3: ProcessWire Configuration

  1. Create a deployment-specific configuration: Create site/config-deploy.php:
<?php
  $config->dbHost = 'localhost';
  $config->dbName = 'processwire';
  $config->dbUser = 'processwireuser';
  $config->dbPass = 'MySecurePassword';
  $config->httpHosts = ['your-domain.com', 'www.your-domain.com'];
  1. Add deployment exclusions Configure these exclusions directly on DeployHQ UI:
  # Exclude these files/directories from deployment
  site/assets/cache/*
  site/assets/logs/*
  site/assets/sessions/*
  site/config.php

Step 4: Database Setup

Follow the MySQL setup steps from the original guide, but add:

# Create deployment-specific database user
CREATE USER 'deployhq'@'localhost' IDENTIFIED WITH mysql_native_password BY 'DeployPassword';
GRANT ALL ON processwire.* TO 'deployhq'@'localhost';
FLUSH PRIVILEGES;

Step 5: Deployment Process

1- Initial Deployment

  • In DeployHQ, click "Deploy" for your first deployment
  • Monitor the deployment logs

2- Automatic Deployments Configure automatic deployments:

  • Go to "Automatic Deployments" in DeployHQ
  • Enable "Automatically deploy when changes are pushed"
  • Select your branch (e.g., main/master)

Step 6: Post-Deployment Checks

1- Verify File Permissions

  $ sudo chmod -R 755 /usr/local/www/apache24/data/processwire
  $ sudo chown -R www:www /usr/local/www/apache24/data/processwire

2- Clear ProcessWire Cache Add to DeployHQ post-deployment commands:

  rm -rf /usr/local/www/apache24/data/processwire/site/assets/cache/*

Step 7: Maintenance Mode

Create a maintenance mode toggle in DeployHQ, using before and after SSH Commands:

# Enable maintenance mode (before deployment)
touch /usr/local/www/apache24/data/processwire/.maintenance

# Disable maintenance mode (after deployment)
rm /usr/local/www/apache24/data/processwire/.maintenance

Another option would be to use Zero Downtime Deployments but it's not covered in this guide.

Security Considerations

1- Add to your .htaccess:

# Prevent direct access to deployment files
<FilesMatch "^\.deployhq">
    Order allow,deny
    Deny from all
</FilesMatch>

2- Configure DeployHQ IP Whitelist

  • Go to Project Settings
  • Add DeployHQ IP addresses to your firewall, listed here.

Conclusion

You now have an automated deployment setup for ProcessWire using DeployHQ and Vultr. This setup provides:

  • Automated deployments
  • Version control integration
  • Deployment rollback capability
  • Maintenance mode support
  • Secure deployment process

Remember to:

  • Regularly backup your database
  • Monitor deployment logs
  • Test deployments in a staging environment first
  • Keep your ProcessWire installation and modules updated

This case study shows how DeployHQ can be an integral part of a modern CMS deployment workflow, helping teams maintain complex websites with ease and efficiency. Whether you're managing documentation or any other web project, DeployHQ's automated deployment capabilities can streamline your workflow and improve team productivity.

A little bit about the author

Facundo is the CTO at DeployHQ. He oversees our software engineering team by day and, in his free time, enjoys hobbies such as cycling, spending time in nature, and the company of Bono 🐶

Tree

Proudly powered by Katapult. Running on 100% renewable energy.