Mosque is an important building for Muslims worldwide for doing religious activities, such as daily prayers, weekly discourses, and annual celebrations. In many places, mosques are considered appropriate buildings for rooftop solar photovoltaics (PV) installation. This study provides a techno-economic analysis of an on-grid PV system in a great mosque. As a case study, Masjid Tablighiyah Garegeh in Bukittinggi is chosen, which is currently under construction with an expected capacity of up to 1,400 people. This study uses HOMER software as a tool to assess optimum configuration for an on-grid PV system. There are four options that is considered in this study: PV-grid, PV-battery-grid, battery-grid, and grid only system . Optimization results showed that both configurations with PV have promising performance; however, an on-grid PV system without battery system is the most optimum configuration. A 40 kWp PV equipped with a 27 kW converter has the least net present cost with USD 6,902, while the cost of energy when implementing the system is only about USD 4.8 cent per kWh. By implementing the system, 57.2 MWh of electricity will be produced from the PV.