Yes, you can install solar panel on the roof of your house which may have a life of around 20-25 years, but before that, you should check the state of your roof, if your roof is dilapidated then you must first repair your roof or then you must repair the roof and then install the solar panels. Also, you must check if there is enough space on your roof, for the panel to absorb enough sunlight.