This is not possible in Cloudron's Web Terminal . A slightly different approach is to just use a custom cron - https://docs.cloudron.io/apps/#cron . cron will run in the "background" and not attached to a terminal. Cron jobs logs are also sent to the App logs.
@cocam123 Cloudron does not support installing external software as such. With that warning, https://docs.cloudron.io/networking/#whitelist-ports will help you expose the port. Cloudron has it's own firewall written on top of iptables and does not use ufw.
@cocam123 as @timconsidine said, Cloudron is not designed to run alongside 3rd party software. The best approach here is to run your public stuff in a separate VM. Then, as @matix131997 said use the app proxy feature. This will set up nginx to proxy all the requests for the domain to this separate VM . App Proxy was designed specifically for the use case of running software outside of the VM and re-using the IP.