$npx -y skills add Sarai-Chinwag/wp-openclaw --skill wp-openclaw-setupInstall wp-openclaw on a VPS. Use this skill from your LOCAL machine to deploy a self-contained WordPress + OpenClaw environment on a remote server.
| 1 | # WP-OpenClaw Setup Skill |
| 2 | |
| 3 | **Purpose:** Help a user install wp-openclaw on a remote VPS from their local machine. |
| 4 | |
| 5 | This skill is for the **local agent** (Claude Code, etc.) assisting with installation. Once OpenClaw is running on the VPS, this skill is no longer needed — the OpenClaw agent takes over with its own pre-loaded skills. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## FIRST: Interview the User |
| 10 | |
| 11 | **Do NOT proceed with installation until you've asked these questions and gotten answers.** |
| 12 | |
| 13 | ### Question 1: Installation Type |
| 14 | |
| 15 | > "Are you setting up a **fresh WordPress site**, or do you have an **existing WordPress site** you want to add OpenClaw to?" |
| 16 | |
| 17 | **Options:** |
| 18 | - **Fresh install** — New VPS, new WordPress site |
| 19 | - **Existing WordPress** — Site already running, just add OpenClaw |
| 20 | - **Migration** — Site exists elsewhere, moving to this VPS |
| 21 | |
| 22 | ### Question 2: Autonomous Operation |
| 23 | |
| 24 | > "Do you want **autonomous operation** capabilities? This includes Data Machine — a self-scheduling system that lets your agent set reminders, queue tasks, and operate 24/7 without human intervention. |
| 25 | > |
| 26 | > - **Yes (recommended for content sites)** — Full autonomy, self-scheduling, proactive operation |
| 27 | > - **No (simpler setup)** — Agent responds when asked, no self-scheduling overhead" |
| 28 | |
| 29 | ### Question 3: Server Details |
| 30 | |
| 31 | > "I'll need some details about your server: |
| 32 | > 1. What's the **server IP address**? |
| 33 | > 2. Do you have **SSH access**? (key or password) |
| 34 | > 3. What **domain** will this site use?" |
| 35 | |
| 36 | ### Question 4: For Existing WordPress |
| 37 | |
| 38 | If they chose existing WordPress: |
| 39 | |
| 40 | > "Where is WordPress installed on the server? (e.g., `/var/www/mysite`)" |
| 41 | |
| 42 | --- |
| 43 | |
| 44 | ## Build the Command |
| 45 | |
| 46 | Based on their answers, construct the appropriate command: |
| 47 | |
| 48 | | Scenario | Command | |
| 49 | |----------|---------| |
| 50 | | Fresh + Data Machine | `SITE_DOMAIN=example.com ./setup.sh` | |
| 51 | | Fresh, no Data Machine | `SITE_DOMAIN=example.com ./setup.sh --no-data-machine` | |
| 52 | | Existing + Data Machine | `EXISTING_WP=/var/www/mysite ./setup.sh --existing` | |
| 53 | | Existing, no Data Machine | `EXISTING_WP=/var/www/mysite ./setup.sh --existing --no-data-machine` | |
| 54 | |
| 55 | Add `--skip-deps` if nginx, PHP, MySQL, Node are already installed. |
| 56 | Add `--skip-ssl` to skip Let's Encrypt certificate. |
| 57 | Add `--secure` to run the agent as a non-root user. |
| 58 | |
| 59 | --- |
| 60 | |
| 61 | ## Confirm Before Proceeding |
| 62 | |
| 63 | Before running anything, summarize what you're about to do: |
| 64 | |
| 65 | > "Here's the plan: |
| 66 | > - **Server:** 123.45.67.89 |
| 67 | > - **Domain:** example.com |
| 68 | > - **Type:** Fresh install |
| 69 | > - **Data Machine:** Yes |
| 70 | > - **Command:** `SITE_DOMAIN=example.com ./setup.sh` |
| 71 | > |
| 72 | > Does this look right?" |
| 73 | |
| 74 | Only continue after explicit confirmation. |
| 75 | |
| 76 | --- |
| 77 | |
| 78 | ## Run via SSH |
| 79 | |
| 80 | ```bash |
| 81 | ssh root@<server-ip> |
| 82 | git clone https://github.com/Sarai-Chinwag/wp-openclaw.git |
| 83 | cd wp-openclaw |
| 84 | <constructed command from above> |
| 85 | ``` |
| 86 | |
| 87 | For **migration**, first transfer the database and wp-content: |
| 88 | ```bash |
| 89 | # On old server |
| 90 | mysqldump dbname > backup.sql |
| 91 | tar -czf wp-content.tar.gz -C /var/www/oldsite wp-content/ |
| 92 | scp backup.sql wp-content.tar.gz root@newserver:/tmp/ |
| 93 | |
| 94 | # On new server — import, then run setup with --existing |
| 95 | mysql -e "CREATE DATABASE wordpress;" && mysql wordpress < /tmp/backup.sql |
| 96 | mkdir -p /var/www/mysite && tar -xzf /tmp/wp-content.tar.gz -C /var/www/mysite/ |
| 97 | ``` |
| 98 | |
| 99 | The script handles everything: PHP (auto-detected), dependencies, WordPress, Data Machine, nginx, SSL, OpenClaw, skills, and workspace files. |
| 100 | |
| 101 | --- |
| 102 | |
| 103 | ## Post-Setup Verification |
| 104 | |
| 105 | After setup.sh completes, verify: |
| 106 | |
| 107 | ```bash |
| 108 | # WordPress |
| 109 | wp --allow-root option get siteurl |
| 110 | |
| 111 | # Data Machine (if installed) |
| 112 | wp --allow-root plugin list | grep data-machine |
| 113 | |
| 114 | # OpenClaw |
| 115 | openclaw gateway status |
| 116 | |
| 117 | # Site reachable |
| 118 | curl -I https://yourdomain.com |
| 119 | ``` |
| 120 | |
| 121 | Then complete OpenClaw configuration: |
| 122 | ```bash |
| 123 | openclaw configure # Set up API keys and channels |
| 124 | systemctl start openclaw # Start the agent |
| 125 | ``` |
| 126 | |
| 127 | Credentials are saved to `~/.openclaw/credentials` (chmod 600). |
| 128 | |
| 129 | --- |
| 130 | |
| 131 | ## When to Use This Skill |
| 132 | |
| 133 | Use when the user says things like: |
| 134 | - "Help me install OpenClaw on my server" |
| 135 | - "Set up wp-openclaw on this VPS" |
| 136 | - "Add OpenClaw to my existing WordPress site" |
| 137 | |
| 138 | **Do NOT use** for ongoing WordPress management — that's the OpenClaw agent's job after installation. |
| 139 | |
| 140 | --- |
| 141 | |
| 142 | ## Troubleshooting |
| 143 | |
| 144 | - **WordPress 500 errors:** Check PHP-FPM status, nginx error log, file permissions |
| 145 | - **WP-CLI errors:** Use `--allow-root`, verify wp-config.php |
| 146 | - **OpenClaw won't start:** Check `node --version` (needs 18+), check `~/.openclaw/logs/` |
| 147 | - **Data Machine not working:** Verify plugin active, run `wp action-scheduler run --allow-root` |