With the Termux + PyPi repositories you can do basically the same as you would do in a normal Linux terminal and it’s great.
I’m not a fan of having many apps on my phone and with Termux I can have yt-dlp, ffmpeg and even magick to do almost anything I want, it’s just great and I don’t know how Termux is not more popular, I hope more people will find sense in it and use it too if they see a use for it.
I’ve run http servers from my phone to copy files from it. For fun I made CSS for the file list and added an “upload file” button. I never got the php max upload size setting to take effect though. And I never bothered with that cert crap. But you CAN run web servers. I found the php web server worked best.