Frequently Asked Questions
You can set the default port for phoenix each time you launch the application from jupyter notebook with an optional argument
port
in launch_app().Yes, you can use either of the two methods below.
- Install pyngrok on the remote machine using the command
pip install pyngrok
. - In jupyter notebook, after launching phoenix set its port number as the
port
parameter in the code below. Preferably use a default port for phoenix so that you won't have to set up ngrok tunnel every time for a new port, simply restarting phoenix will work on the same ngrok URL. - import getpassfrom pyngrok import ngrok, confprint("Enter your authtoken, which can be copied from https://dashboard.ngrok.com/auth")conf.get_default().auth_token = getpass.getpass()port = 37689# Open a ngrok tunnel to the HTTP serverpublic_url = ngrok.connect(port).public_urlprint(" * ngrok tunnel \"{}\" -> \"http://127.0.0.1:{}\"".format(public_url, port))
- "Visit Site" using the newly printed
public_url
and ignore warnings, if any.
Ngrok free account does not allow more than 3 tunnels over a single ngrok agent session. Tackle this error by checking active URL tunnels using
ngrok.get_tunnels()
and close the required URL tunnel using ngrok.disconnect(public_url)
.This assumes you have already set up ssh on both the local machine and the remote server.
If you are accessing a remote jupyter notebook from a local machine, you can also access the phoenix app by forwarding a local port to the remote server via ssh. In this particular case of using phoenix on a remote server, it is recommended that you use a default port for launching phoenix, say
DEFAULT_PHOENIX_PORT
.- Launch the phoenix app from jupyter notebook.
- In a new terminal or command prompt, forward a local port of your choice from 49152 to 65535 (say
52362
) using the command below. Remote user of the remote host must have sufficient port-forwarding/admin privileges.ssh -L 52362:localhost:<DEFAULT_PHOENIX_PORT> <REMOTE_USER>@<REMOTE_HOST>
If you are abruptly unable to access phoenix, check whether the ssh connection is still alive by inspecting the terminal. You can also try increasing the ssh timeout settings.
Simply run
exit
in the terminal/command prompt where you ran the port forwarding command.Last modified 2mo ago