Creating a phone server.

download adb https://dl.google.com/android/repository/platform-tools_r33.0.3-darwin.zip

Download a rom of your phone by googling the value in the about your phone (in your phone)

Follow these instructions https://topjohnwu.github.io/Magisk/install.html#magisk-in-recovery


Install userLAnd < seems to work well

Install ubuntu

update OS

on the phone create a new user and add them to sudo



Since ssh it's not on the local default port use ssh bohdan@192.168.2.17 -p2022 to connect to it

Portforward the router - I'm not able to test locally because I can't visit a site from my own domain, used my phone on a wireless network

For portfoward, we change 80 to 2080, 443 to 2443, 22 to 2022, because the phone didn't allow for those ports to be used

Install Apache

A. enable ssl on apache sudo a2enmod ssl

B. install openssl sudo apt-get install openssl

D. if necessary, change /etc/apache2/ports.conf, this works to 2080 and 24443 



DNS - https://www.duckdns.org/ is a great service, set it up

Set your dns to do a cname, for me I did phone.bohdananderson.com to cname bohdanhome.duckdns.org

Yes you are able to get certs for cnames.

setup the suggested script (needed to install cron to get it to work)



install certbot 



you are set with a fully functioning server on a phone!