Skip to content

Unraid Integration Setup Guide

MrD3y5eL edited this page Jan 10, 2025 · 1 revision

Prerequisites

  • SSH enabled on your Unraid server
  • Home Assistant instance
  • SSH key or root password for Unraid

Setup Methods

Method 1: Password Authentication

  1. In Home Assistant, go to Settings → Devices & Services
  2. Click "Add Integration" and search for "Unraid"
  3. In the first step:
    • Enter your Unraid server IP/hostname
    • Enter username (typically 'root')
    • Select "Password" as authentication method
  4. In the second step:
    • Enter your root password
  5. In the final step:
    • Configure update intervals and UPS settings if needed
    • Click Submit

Method 2: SSH Key Authentication (Recommended)

A. Generate SSH Key

If using Home Assistant OS or Container:

  1. Open a terminal on your Home Assistant machine (use SSH Add-on or direct SSH)
  2. Generate an SSH key:
    mkdir -p /config/ssh
    cd /config/ssh
    ssh-keygen -t ed25519 -f unraid_key
    • When prompted for passphrase, press Enter (no passphrase)
    • This creates:
      • /config/ssh/unraid_key (private key)
      • /config/ssh/unraid_key.pub (public key)

B. Configure Unraid

  1. Copy the contents of the public key:
    cat /config/ssh/unraid_key.pub
  2. SSH into your Unraid server
  3. Add the key to authorized_keys:
    mkdir -p ~/.ssh
    chmod 700 ~/.ssh
    echo "PASTE_YOUR_PUBLIC_KEY_HERE" >> ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys

C. Configure Integration

  1. In Home Assistant, go to Settings → Devices & Services
  2. Click "Add Integration" and search for "Unraid"
  3. In the first step:
    • Enter your Unraid server IP/hostname
    • Enter username (typically 'root')
    • Select "SSH Key" as authentication method
  4. In the second step:
    • Enter the path to your private key: /config/ssh/unraid_key
  5. In the final step:
    • Configure update intervals and UPS settings if needed
    • Click Submit

File Permissions

Ensure correct permissions are set:

On Home Assistant:

chmod 700 /config/ssh
chmod 600 /config/ssh/unraid_key
chmod 644 /config/ssh/unraid_key.pub

On Unraid:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Troubleshooting

Common Issues

  1. "SSH key file not found"

    • Verify the key path is correct
    • Check file permissions
    • Ensure the file exists in the specified location
  2. "Connection refused"

    • Verify SSH is enabled on Unraid
    • Check if the port is correct
    • Verify firewall settings
  3. "Permission denied"

    • Check file permissions
    • Verify the public key is properly added to authorized_keys
    • Make sure the username is correct (usually 'root')

Verification Steps

Test SSH connection:

# From Home Assistant container
ssh -i /config/ssh/unraid_key root@YOUR_UNRAID_IP

If successful, you should connect without password prompt.

Security Notes

  1. Always use strong SSH keys (ed25519 recommended)
  2. Keep private keys secure and backed up
  3. Regular backup of SSH keys and configurations

Need help? Check the GitHub repository for additional support.