visual-studio-codehome-assistant

How can I connect VS Code to a Home Assistant docker container running on Unraid Server?


I want to edit config files in my Home Assistant install with all the VS Code editor goodness.
I'm running Home Assistant via Docker inside Unraid Server.

How can I connect VS Code to the container?


Solution

  • All instructions are from inside VS Code...

    1. Install the Remote SSH extension.
    2. Install the Docker extension.
    3. Install the Dev Containers extension.
    4. Enable the Docker extension for use when connected via SSH.
      Go to the VSCode Settings UI > Remote SSH: Default Extensions > Add Item
      Add ms-azuretools.vscode-docker ssh settings
    5. Use the Remote SSH extension to connect to the unraid server at <ip_address:8123>.
    6. Go to the Docker extension in the sidebar and the Home Assistant container will be in the list.
    7. Right click the container and select "Attach Visual Studio Code" and enter your password when prompted.
    8. Another VS Code window will launch fully logged into the container and ready to edit files.