Setup Guide

1 Install reattachd

Run this command on your computer:

curl -fsSL https://raw.githubusercontent.com/kumabook/Reattach/main/install.sh | sh
2 Set up the daemon

macOS (launchd)

# Create log directory
mkdir -p ~/Library/Logs/Reattach

# Create plist file
cat > ~/Library/LaunchAgents/com.kumabook.reattachd.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.kumabook.reattachd</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/reattachd</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>~/Library/Logs/Reattach/reattachd.log</string>
    <key>StandardErrorPath</key>
    <string>~/Library/Logs/Reattach/reattachd.error.log</string>
    <key>EnvironmentVariables</key>
    <dict>
        <key>PORT</key>
        <string>8787</string>
        <key>PATH</key>
        <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
    </dict>
</dict>
</plist>
EOF

# Load and start
launchctl load ~/Library/LaunchAgents/com.kumabook.reattachd.plist

Linux (systemd)

# Create service file
sudo tee /etc/systemd/system/reattachd.service << 'EOF'
[Unit]
Description=Reattach Daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/reattachd
Restart=always
Environment=PORT=8787

[Install]
WantedBy=multi-user.target
EOF

# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable reattachd
sudo systemctl start reattachd
3 Configure network access

Choose how your iOS device will connect to reattachd:

Local network

Use your machine's local IP address directly. No additional setup required.

URL: http://192.168.x.x:8787

VPN

If you have a VPN setup, use the machine's IP address on the VPN network.

URL: http://<vpn-ip>:8787

Cloudflare Tunnel

For secure remote access without exposing ports:

# Create tunnel
cloudflared tunnel create reattach

# Configure tunnel (edit ~/.cloudflared/config.yml)
tunnel: reattach
credentials-file: /path/to/credentials.json

ingress:
  - hostname: your-domain.example.com
    service: http://localhost:8787
  - service: http_status:404

# Start tunnel
cloudflared tunnel run reattach
URL: https://your-domain.example.com
4 Register your device

Generate a QR code to register your iOS device:

reattachd setup --url <your-url>

Scan the QR code with the Reattach iOS app to complete registration.

Need help? Check out the GitHub repository for more details and troubleshooting.