No, you don't need to use mounting rails. Solar panels can be attached directly to the roof using brackets. However, if you have a metal roof, you may want to use rail mounts to provide additional support and protection.