{“content”:”---\nname: paperclip-windows-setup\ndescription: Install and run Paperclip server on Windows PC for mobile access via Tailscale\ntags: []\n---\n\n# Paperclip Windows Setup\n\nRun Paperclip server on Windows PC for mobile access via Tailscale.\n\n## Context\n- PC: Windows, Tailscale IP 100.83.112.84\n- User: Sozo, admin privileges\n- Server installed at D:\paperclip\n- Neon DB used (not local PostgreSQL) — connection string stored in check_db.js\n- Default port: 3101 (observed in practice; config.json may show 3100)\n\n## Prerequisites\n- Node 24+ on Windows\n- npm or pnpm on Windows\n- Neon DB connection string (postgresql://neondb_owner:…)\n\n## Steps\n\n### 1. Install paperclip server (one-time)\npowershell\ncd D:\\\nNew-Item -ItemType Directory -Force -Path D:\\paperclip\ncd D:\\paperclip\nnpm init -y\nnpm install @paperclipai/server\n\n\n### 2. Start paperclip server (via SSH)\nbash\n# Use PowerShell Start-Process — works reliably over SSH\nssh -i ~/.ssh/id_ed25519_hermes [email protected] ^\n \"powershell -Command 'Start-Process -FilePath node -ArgumentList \\\"node_modules\\\\@paperclipai\\\\server\\\\dist\\\\index.js\\\" -WorkingDirectory \\\"D:\\\\paperclip\\\" -NoNewWindow -PassThru'\"\n\n# Or with cd approach (must use cmd /c \"cd /d ...\" for Windows paths)\nssh -i ~/.ssh/id_ed25519_hermes [email protected] ^\n \"cmd /c \\\"cd /d D:\\\\paperclip && node node_modules\\\\@paperclipai\\\\server\\\\dist\\\\index.js\\\"\"\n\n\n### 3. Verify\npowershell\n# Check port\nnetstat -ano | Select-String \"31\"\n\n# Health check\ncurl http://127.0.0.1:3101/api/health\n\n\n## Key Lessons\n\n### Termux incompatibility\nPaperclip CLI is Electron-based → does NOT work on Android/Termux. Server-only approach works but npm install on Termux is slow/unreliable due to network timeouts.\n\n### SSH background process on Windows\n- start /b cmd /c \"node ...\" — does NOT work reliably over SSH (process dies)\n- PowerShell Start-Process -NoNewWindow — works reliably over SSH\n- cmd /c \"cd /d D:\\paperclip && node ...\" — works but path resolution is from SSH cwd\n\n### Server binds to 127.0.0.1 by default\nPaperclip server binds to loopback only (127.0.0.1). To allow remote access via Tailscale:\n1. Edit C:\\Users\\Sozo\\.paperclip\\instances\\default\\config.json\n2. Change \"bind\": \"loopback\" → \"bind\": \"all\"\n3. Change \"host\": \"127.0.0.1\" → \"host\": \"0.0.0.0\"\n4. Restart server\n\n### Embedded PostgreSQL permission issue\nPaperclip’s embedded-postgres fails on Windows admin accounts with:\n\"Execution of PostgreSQL by a user with administrative permissions is not permitted\"\n→ Use external PostgreSQL or Neon DB instead\n\n## Access via Tailscale\nAfter fixing bind to 0.0.0.0, access from mobile at: http://100.83.112.84:3100\n\n## Troubleshooting\n- Server not listening on expected port: Server was killed — restart with PowerShell Start-Process\n- SSH start /b process dies: Use PowerShell Start-Process instead\n- Module not found error: Ensure SSH command uses cd /d D:\\paperclip or -WorkingDirectory \"D:\\\\paperclip\"\n- Can’t connect from Termux: Check bind setting in config.json (must be “all” not “loopback”)\n- Port 0 after config change: Kill all node processes (taskkill /F /IM node.exe) then restart\n- Neon DB connection: Check D:\\paperclip\\check_db.js for stored connection string\n”}