How do change the hostname of a livebook runtime?

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.