How to setup [Lume](https://lume.land/) with automated deployments using DeployHQ.

> **New in 2026 — managed Static Hosting**: DeployHQ now offers [Static Hosting](https://www.deployhq.com/hosting/static) — fully-managed deployment to Cloudflare's edge for Lume's static output, no server to provision. The walkthrough below covers BYO-server deployment with Deno + Caddy, which remains fully supported.

## 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:

```bash
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:

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

post:
  - command: "systemctl restart lumecms"
```

4- Add Build Commands:

```bash
   deno task build
```

### 3. CMS Installation

1- Create configuration file on your server:

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

2- Add basic configuration:

```json
{
  "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:

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

Add:

```ini
[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:

```bash
   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](https://www.deployhq.com/support) or [contact our support team](https://www.deployhq.com/contact) for assistance._