Remote-SSH Debugging for Appdaemon Apps in Docker Container

A docker container with ssh natively enabled for dev can be used for debugging the apps of AppDaemon or AD itself. The base image has been changed into Python:3.x (Debian).

No source code needs to be on your local machine due to the Remote-SSH in the VSCode. Minimize the development envirnment configuration. The config folder in use can be volumed (-v) to the container directly. But do not worry about interfering running instance because all the files have been copied to the dev config folder.

Just copy the AppDaemon service in the docker-compose.yml (same with docker run) with a few modifications and type the command docker-compose up. Let’s roll.


  • Local Deployment free (almost)
  • Existing config folder can be used directly
  • Small modifications of a running container service is ready to go

How to use

If you are using docker-compose to running AD and the original service looks like this:

version: '3.3'
        image: acockburn/appdaemon:latest
            HA_URL: ""
            TOKEN: "ha_long_live_token"
            DASH_URL: ""
            - ./appdaemon/conf:/conf
            - /etc/localtime:/etc/localtime:ro
            - 5050:5050
        restart: unless-stopped

Copy the service and modify it:

    # set a different service name
        image: blindlight/appdaemon:dev
        # the image set to blindlight/appdaemon
        # the tag can be latest(offical AD master branch)
        # or dev(offcial AD dev branch)
            HA_URL: ""
            TOKEN: "ha_long_live_token"
            DASH_URL: ""
            # SSHPASSWORD: "set_root_ssh_password"   # set root password for ssh
            RSA_PUB: # alternatively, if you prefer rsa-key, set this to the rsa public file you create in local machine.
            - ./appdaemon/conf:/conf
            - /etc/localtime:/etc/localtime:ro
            - 5050:5050
            - "8022:22" # set the ssh port mapping, don't forget the quotes because yaml recognizes int(a):int(b)<60 as a*60+b
        restart: unless-stopped


docker-compose up -d

Install Remote-SSH extention if you don’t have it.

Open remote window to config a ssh. Recommand to edit config file.

Host appdaemon-dev                        # host id, selfdefine
  User root                               # root, do not change
  HostName                   # host ip
  # IdentityFile ~/.ssh/id_rsa-ad-dev     # rsa private key*
  Port 8022                               # ssh port you mapping in container

* To create ssh-key

ssh-keygen -t rsa -b 4096 -f rsa_file

A private key file and a public key file will be create in the %USERPROFILE%\.ssh\
Copy the public-key to AD config folder and change the env in the docker-compose.yml accordingly.

After ssh into the remote container, open folder /usr/src/app
Select an app and add a breakpoint then press F5 to start debugging.

Inspired by

This works much better if you use VScode to remote directly into the docker container itself. That way linters have a much easier time linting your imports.

Here is the link how to do that.

Reviving the topic.
I have the following setup.
VScode connecting via remote ssh to a debian pc running homeassistant in docker supervised
I connect to the appdaemon docker (add-on) via vscode
when I try to run in debug though pylance complains of a missing assai import and it stops.

Any clue?