For iMessage, I just found AirMessage that works really well: https://airmessage.org/. You just have to install the server app on a macOS desktop, have a domain name or static IP, and maybe forward one port. Then just install the airmessage app from F-droid.
1 Like