docker build -t sshubuntu . docker run -d -p 2022:22 sshubuntu In a directory where I have the attached dockerfile and a id_rsa.pub which is the public key to my default ssh key. After this ssh access works with the user 'sshuser' on localhost port 2022 mapped to the server's 22. The LSP server executable 'jdtls' is linked to this user's $HOME/bin, or /home/sshuser/bin. The default shell for user 'sshuser' is '/bin/bash' (though Tramp seems to access it with '/bin/sh'). The local shell is '/bin/zsh'. In the local machine I launch Emacs -Q sessions in slightly different ways. This fails: export REMOTE_FILE=/home/sshuser/yacy_search_server/source/net/yacy/yacy.java ~/Source/Emacs/emacs/src/emacs -Q \ /ssh:sshuser@localhost#2022:$REMOTE_FILE \ --eval '(add-to-list (quote tramp-remote-path) "/home/sshuser/bin")' \ -f eglot Even if it worked, I would be suboptimal. I think I would like to avoid the hardcoding of "/home/sshuser/bin" in my config. This also fails. ~/Source/Emacs/emacs/src/emacs -Q \ /ssh:sshuser@localhost#2022:$REMOTE_FILE \ --eval '(add-to-list (quote tramp-remote-path) "~/bin")' \ -f eglot And the following works. Eglot is started correctly. ~/Source/Emacs/emacs/src/emacs -Q \ /ssh:sshuser@localhost#2022:$REMOTE_FILE \ --eval '(add-to-list (quote tramp-remote-path) (quote tramp-own-remote-path))' \ -f eglot João