Deploying a Kirby CMS Project with DeployHQ
Deploying a Kirby CMS Project with DeployHQ
This guide assumes you have a hosted server with a web server like Apache or Nginx configured to serve your Kirby CMS application.
Using DeployHQ for Deployments
DeployHQ simplifies application deployments to servers. It allows configuration definitions, custom commands, and automated deployments on code push.
The free plan allows 1 project deployment up to 5 times daily.
Creating a Project
After signup and login, create a project via Projects > New Project.
Follow the wizard to choose your repository. For connection issues, consult DeployHQ's support page.
Dedicated User for DeployHQ
Create a separate user for deployments:
sudo adduser deployhq
sudo usermod -a -G www-data deployhq
Configuring a Server
Configure your Kirby CMS application location. Go to Servers > New Server.
- Name the server and select SSH protocol.
- Enter server IP in Hostname.
- Set Username as
deployhq
. - Check Use SSH key rather than password for authentication?. Run on your server:
su - deployhq
mkdir ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
- Paste DeployHQ's public key, save with
Ctrl + X
,y
,Enter
. - Set permissions:
chmod 600 ~/.ssh/authorized_keys
- Set Deployment Path to your Kirby CMS application location.
- Enable Perform zero-downtime deployments on this server.
Update web server configuration to point to /var/www/your-kirby-project/current
.
- Enter
production
in Environment and enable automatic deploy.
Save the configuration.
For connection issues, refer to DeployHQ's support page.
Config Files (Optional)
Upload sensitive files via Config Files > New Config File.
Copy your .env
file contents into the config file content field.
Setting Up SSH Commands
Configure post-deployment commands via SSH Commands > New SSH Command.
Create these commands:
- Clear Cache:
cd %path% && php kirby clear:cache
- Update Composer Dependencies:
cd %path% && composer install --no-dev --optimize-autoloader
Ensure correct command order.
Deploying Your Project
Click Deploy Project in the header. Select the server and revisions. Click Deploy to start deployment.
Your Kirby CMS project deployments are now automated.
For guides on deploying other applications, visit DeployHQ's guides page.