How to SSH access

You’ll need to reference the actual IP address for the VM as well as the HTTP port that the individual site container is listening on. This isn’t shown in the Local GUI, but you can use the docker-machine and docker commands that are bundled with Local to get that information.

The general gist is that you can list out the local-by-flywheel machine to get the IP that it is on for your laptop, and then use docker to list out the details fo the ports that are in use.

Here’s what that process looks like for me:

image

For reference, here’s the output from my terminal session in case you want to copy/paste things:

benjamin:~/
$ alias docker-machine='/Applications/Local\ by\ Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine'
benjamin:~/
$ eval $("docker-machine" env local-by-flywheel)
benjamin:~/
$ docker-machine ls
NAME                ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS
local-by-flywheel   *        virtualbox   Running   tcp://192.168.94.100:2376           v18.06.1-ce
benjamin:~/
$ alias docker='/Applications/Local\ by\ Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker'
benjamin:~/
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                                                         NAMES
bd24b471d8ba        local-router:1.1    "nginx -g 'daemon ..."   6 minutes ago       Up 6 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp                                                      admiring_nobel
dca3d1469c9b        flywheel:1.3.2      "supervisord"            2 weeks ago         Up 6 minutes        0.0.0.0:4012->80/tcp, 0.0.0.0:4013->443/tcp, 0.0.0.0:4015->1080/tcp, 0.0.0.0:4014->3306/tcp   suspicious_kare
benjamin:~/
$ ssh -R 80:192.168.94.100:4012 serveo.net
Hi there
Forwarding HTTP traffic from https://fenum.serveo.net
Press g to start a GUI session and ctrl-c to quit.
HTTP request from 76.115.187.209 to https://fenum.serveo.net/

I still think that you will likely run into other headaches trying to share this sort of tunneled connection, and would recommend that sites that are meant to be actively collaborated on should probably be pushed to a development or staging server so that changes are available to everyone in a reliable manner.

As you can see in my screenshot, there are a bunch of assets being blocked due to the SSL certificate not covering the Serveo domain, so it’s not really an “out-of-the-box” solution.

1 Like

The exit; command is used to close the terminal session after exiting the docker session. It’s an assumption that if you are exiting the docker container, then you are likely done with doing whatever terminal things you were wanting to do against the container.

Can you help me better understand what isn’t working? What is the typical workflow that is preventing ssh access to the site container?

@ben.turner This is in the context of right-clicking on a site and selecting “Open Site SSH”. Sometimes, when I first open Local (and maybe when iTerm or Terminal is closed) it will open and connect correctly. But other times I get this: https://cl.ly/2a80d03775a4

It almost seems to have something to do with the command not reliably working synchronously. Ideally the exit; would not fire until after the SSH application finishes. But it seems like, in some (most) cases the exit; command gets executed before the SSH has finished connecting.

I see why you added the command, but really it doesn’t seem worth it. I’d be perfectly fine with closing the terminal myself once I’m finished. In fact, typically, if I’m doing with some remote work I just close the terminal rather than explicitly exiting the session. If I do exit that means I won’t to do something further in the terminal. My recommendation would be to just remove the exit; command.

1 Like

Putty is the standard on Windows. https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

What’s interesting from that screenshot is that I can see malloc peeking out from behind that window prompt. The term malloc usually refers to something having problems allocating memory to something, but I’m not entirely sure what that would be.

  • How much RAM does this computer have?
  • When you encounter this sort of thing, do you have lots of other applications running or applications that use a lot of memory?

Thanks for the suggestion! We’re currently working on improving this sort of thing with future versions of Local so getting feedback is really helpful in gauging what’s important with our users!

@ben.turner I can’t imagine memory is the issue as I’m on a 16 GB MacBook Pro. I’ve not had memory issues in any other form.

That said, I’m not sure what changed — I haven’t tried to connect in a couple months (and I have updated Local since then) — but connecting is working every time now. So I guess it’s fixed? Hahah!

Nice @jasontheadams – I’m glad it’s working well now! Have an awesome day!

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.