On Android devices, it’s generally difficult for apps to maintain persistent background services. I’m curious how you were able to prevent Android from terminating the process, and how the Pixel 5 server managed to keep running?
It runs inside Termux, which has a persistent notification to keep it open in the background. I believe I also extended the max phantom process to prevent it from being killed.
The Pixel device I have is from a family member and it is locked to Verizon, who won't unlock the bootloader. I'm sure there's a work around, but I didn't think it was worth the effort. PostmarketOS is rad though, I have it running on an ancient Windows Surface RT.