You must perform the installation via console (not an SSH session!)
sudo su –
apt-get update
cd /tmp
wget https://software.virtualmin.com/gpl/scripts/install.sh
chmod 777 install.sh
./install.sh
after install
nano /etc/netplan/01-netcfg.yaml
Add addresses: [‘x.x.x.x/xx’]
where x is ip and xx is subnet
then exit and do netplan apply and reboot
resume install via web browser:10000
for php5:
apt install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6