IEx into Your Running App

Elixir supports getting a IEx shell into a running production node. How cool is that?

SSH Into Our App

To do this, we will login with SSH to our application VM. There is a one-time setup task for using SSH. Follow the instructions.

fly ssh issue --agent

With SSH configured, let's open a console.

fly ssh console -C "app/bin/hello_elixir remote"
Connecting to hello_elixir.internal... complete
Erlang/OTP 23 [erts-11.2.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1]

Interactive Elixir (1.11.2) - press Ctrl+C to exit (type h() ENTER for help)

You have a live IEx shell into your application!

Tip: One of several ways to exit the IEx shell is to hit Ctrl+C, Ctrl+C; to log out of the VM console, use Ctrl+D or exit.

What's Next?

With another quick update we can prepare our application for clustering by naming our nodes differently.

Next up, Naming Your Elixir Node!