Damus
nostrich profile picture
nostrich
# Bisq with Bitcoin Local Node via SSH Tunnel

## 1. Generate & Secure the Key (Bisq Host)

```bash
ssh-keygen -t ed25519 -C "bisq-tunnel" -f ~/.ssh/bisq-tunnel
# Press Enter twice to leave passphrase empty (required for unattended systemd)
chmod 600 ~/.ssh/bisq-tunnel
chmod 644 ~/.ssh/bisq-tunnel.pub
```

## 2. Deploy to Bitcoin Core Host

```bash
ssh-copy-id -i ~/.ssh/bisq-tunnel.pub <node-username>@<node-ip>
# Verify passwordless login:
ssh -i ~/.ssh/bisq-tunnel <node-username>@<node-ip> "echo 'Key deployed successfully'"
```

## 3. Create Systemd User Service

```bash
mkdir -p ~/.config/systemd/user
vim ~/.config/systemd/user/bisq-btc-tunnel.service
```
Paste exactly this (replace `<node-username>` and `<node-ip>`):

```ini
[Unit]
Description=Bisq Bitcoin Core P2P SSH Tunnel
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/bin/ssh -N -i ~/.ssh/bisq-tunnel -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=accept-new <node-username>@<node-ip> -L 8333:127.0.0.1:8333
Restart=always
RestartSec=5
StandardError=journal

[Install]
WantedBy=default.target
```

## 4. Enable & Start Service

```bash
systemctl --user daemon-reload
systemctl --user enable --now bisq-btc-tunnel
systemctl --user status bisq-btc-tunnel
```
*(Status should show `active (running)` with no errors.)*

## 5. Verify Tunnel

```bash
nc -zv localhost 8333
# Expected: Connection to localhost 8333 port [tcp/*] succeeded
```

## 6. Configure Bisq

1. Open Bisq → **Settings** → **Network Info**
2. **Clear** the `Use custom Bitcoin Core nodes` field
3. Restart Bisq. It will auto-detect `localhost:8333` and connect instantly.

The tunnel will survive reboots, network drops, and SSH timeouts automatically.