planet is an amalgam of rocks and minerals, heat is provided by the sun, water could have been of extraterrestrial origin, and then enters fungi using heat and humidity to develop mycelium, mycelium turns minerals into compost with enzymes, space dust introduces bacteria which evolves through thermal vents a/biogenesis, and voila, you have life. We do know that before vegetation, Earth had fungi structures made of half rock, half fungi flesh, and they probably evolved into actual trees. At the same time, lichen spread from underwater to the surface of the Earth. Fungi released CO2, creating an atmosphere for plants to develop. The rest is evolution.