How do change the hostname of a livebook runtime?

I wanna connect to an elixir runtime running on a separate node with livebook, but I cannot get it to work. I can connect to the other node through an iex session just fine but not through livebook.

I want to change the hostname of the nodes spawned by livebook but I cannot figure out how to do that… any ideas?

I figured it out… :slight_smile:

I’m running livebook like this iex -S mix phx.server in a checkout of the livebook repo.

If I give my livebook server node a name like this iex --name livebook@eve.local -S mix phx.server the spawned runtimes will copy that hostname instead and connections to my external node works.

You can configure the various distributed node settings with environment variables set when starting Livebook. I use a small script to do it, which you can find here: Tiny helper script to start Livebook connected to production (fly.io) or development - #2 by zachallaun

I believe the LIVEBOOK_NODE, LIVEBOOK_DISTRIBUTION, and LIVEBOOK_DEFAULT_RUNTIME variables will be most relevant to you. If you’re connecting to a node via IPv6, you will also need the ERL_AFLAGS.