@rikemumu55 I’d like to list another alternative. @RobertLucian had some very good suggestions, as usual! However there is a much simpler way, but it has its cons too, so think about it.
Instead of creating a web app app like Robert mentioned you can use your own program online. This can be done through remote access. There are two main ways to do this.
SSH - SSH allows remote access to a terminal. With SSH X-Forwardig you can even run GUI programs.
VNC - VNC is basically software that lets you remotely access the desktop of a computer.
Now normally these methods don’t work outside your network, but regardless they can be used outside your network.
SSH is a great option mostly because if all you need is a terminal, you’ll in theory get a much faster connection then through VNC. However I am not an exact expert on how it can be accessed online…
Probably he easiest option would be VNC.
Your best bet would be VNC Connect. It lets your easily without advanced configuration access your pi anywhere in the world. You can learn more here:
Word of Caution
All of this sounds great, but remember having a device open for remote connections online is a security risk. So make sure your password is very, very, very, Very, good. Just be aware of that? Though with a good password you should be fine!
The advantage of the way Robert mentioned is probably higher security, and faster response. The advantage of he ways I mentioned are simply it’s simplicity.