Deployment Guide
Run Reviewflow in production on a Linux VPS.
Overview
This guide covers:
- Running the server as a systemd service (auto-start on boot)
- Exposing it to the internet via Cloudflare Tunnel
Prerequisites
- Linux server with systemd (Ubuntu, Debian, etc.)
- Node.js 20+ installed
cloudflaredinstalled (download)- A domain on Cloudflare (for permanent URL)
Quick Test (Temporary Tunnel)
For testing without permanent setup. The URL changes on each restart.
bash
# Terminal 1: Server
cd ~/reviewflow
yarn install && yarn build
yarn start
# Terminal 2: Tunnel
cloudflared tunnel --url http://localhost:3000Copy the generated URL and use it for your webhook configuration.
Production Setup
1. Build the project
bash
cd ~/reviewflow
yarn install
yarn build2. Configure
bash
# Environment
cp .env.example .env
nano .env # Add your webhook tokens
# Application
cp config.example.json config.json
nano config.json # Add your repos3. Install systemd service
bash
# Copy template
sudo cp docs/deployment/templates/review-flow.service /etc/systemd/system/
# Edit with your values
sudo nano /etc/systemd/system/review-flow.service
# Replace YOUR_USER and paths
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable --now review-flow
# Check status
sudo systemctl status review-flow4. Set up Cloudflare Tunnel
bash
# Login to Cloudflare
cloudflared tunnel login
# Create tunnel
cloudflared tunnel create review-flow
# Note the tunnel ID
# Configure DNS
cloudflared tunnel route dns review-flow review.your-domain.com
# Create config
mkdir -p ~/.cloudflared
cp docs/deployment/templates/cloudflared-config.yml ~/.cloudflared/config.yml
nano ~/.cloudflared/config.yml
# Replace YOUR_TUNNEL_ID, YOUR_USER, and domain
# Install tunnel service
sudo cp docs/deployment/templates/cloudflared.service /etc/systemd/system/cloudflared-review-flow.service
sudo nano /etc/systemd/system/cloudflared-review-flow.service
# Replace YOUR_USER
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable --now cloudflared-review-flow5. Verify
bash
# Check services
sudo systemctl status review-flow
sudo systemctl status cloudflared-review-flow
# Test endpoint
curl https://review.your-domain.com/health
# View logs
journalctl -u review-flow -fTemplates
See the templates/ directory for:
review-flow.service- systemd unit for the servercloudflared.service- systemd unit for the tunnelcloudflared-config.yml- Cloudflare tunnel configuration
Updating
bash
# Stop service
sudo systemctl stop review-flow
# Update code
cd ~/reviewflow
git pull
yarn install
yarn build
# Restart
sudo systemctl start review-flowTroubleshooting
See Troubleshooting for common issues (services, tunnels, webhooks).