Oh. I don’t know if you can expect running on a remote system to open the browser on your local computer automatically. The automatic browser opening stuff I was referencing above (I believe) is when you are working with your notebook server locally. Opening a browser on the remote computer isn’t going to help, and in most cases isn’t going to work.
But maybe by ?What should I do to be able to run it and make it automatically to open a browser?", you instead mean get your local browser to connect to the server on the remote computer?
What I do is after the notebook server is up and running like in the terminal you pasted above in your question, is that I leave that terminal window open so the server continues to run and then open a new terminal window. In the new terminal window, I make an SSH tunnel using the information from the URL and the port I opened on the remote system. Then I open a browser on my local computer and I paste in a URL in my browser to connect to the remote notebook server, like so based on your first post I’d be pasting something like you see on this line below in the URL bar of my local browser after the server is running and the tunnel is established:
http://localhost:8889/?token=507b6da30dbfob167bcd477aa1c85b
I follow along mostly the following when I use AWS EC2:
with the SSH tunnel command actually based on here.