Header

Deploying to Lume with DeployHQ

How to setup Lume with automated deployments using DeployHQ.

Requirements

  • A GitHub repository containing your Lume site
  • A hosting server (any provider supporting SSH access)
  • A domain or subdomain for the CMS
  • A DeployHQ account

Setup

1. Server Preparation

First, ensure your server has the required packages:

sudo apt update
sudo apt install -y deno git caddy

2. DeployHQ Configuration

1- Create a new project in DeployHQ - Connect to your GitHub repository - Add your server as a deployment target

2- Configure Server Details: - Protocol: SSH/SFTP - Hostname: Your server's IP or hostname - Port: 22 (default) - Deploy Path: /var/www/lumecms - Authentication: SSH Key (recommended) or password

3- Configure Deployment Settings:

pre:
  - command: "deno cache main.ts"

post:
  - command: "systemctl restart lumecms"

4- Add Build Commands:

   deno task build

3. CMS Installation

1- Create configuration file on your server:

sudo mkdir -p /var/www/lumecms
sudo nano /var/www/lumecms/config.json

2- Add basic configuration:

{
  "domain": "cms.example.com",
  "email": "your@email.com",
  "username": "admin",
  "password": "your-secure-password"
}

3- Setup Caddy server:

   sudo nano /etc/caddy/Caddyfile

Add:

   cms.example.com {
      reverse_proxy localhost:8000
   }

4- Create systemd service:

   sudo nano /etc/systemd/system/lumecms.service

Add:

[Unit]
Description=LumeCMS
After=network.target

[Service]
WorkingDirectory=/var/www/lumecms
ExecStart=/usr/bin/deno run --allow-all main.ts
Restart=always
User=www-data

[Install]
WantedBy=multi-user.default

5- Start services:

   sudo systemctl enable caddy
   sudo systemctl start caddy
   sudo systemctl enable lumecms
   sudo systemctl start lumecms

4. Automatic Deployments

  1. In DeployHQ, go to your project's settings
  2. Enable automatic deployments for your desired branches
  3. Configure Webhook in GitHub:
    • Go to repository settings > Webhooks
    • Add DeployHQ webhook URL
    • Select events: Push and Pull Request

Usage

  1. Make changes in your repository
  2. Commit and push to GitHub
  3. DeployHQ will automatically:
    • Detect changes
    • Run build commands
    • Deploy to your server
    • Restart the CMS service

Benefits of Using DeployHQ

  • Automated deployments
  • Deploy history and rollbacks
  • Multiple environment support
  • Build caching
  • Deployment notifications
  • Zero-downtime deployments
  • Automatic failure detection

Notes

  • The first deployment might take longer due to initial setup and dependency installation
  • Make sure your server's firewall allows HTTP/HTTPS (ports 80/443)
  • Keep your DeployHQ credentials and server SSH keys secure
  • Consider setting up staging environments for testing

This setup provides a more automated and managed deployment process compared to direct VPS deployment, with additional features like rollbacks and deployment monitoring.


Want to learn more about deployments or Wordpress? Check out our documentation or contact our support team for assistance.

Tree

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