Now, solar water heaters ensure hot water for showers and solar panels produce enough electricity not only to power the school and three others nearby but to feed the national grid, providing a small income toward paying other school costs.
Lotfi Hamadi, a Tunisian entrepreneur who helped fund the renewable energy installations, hopes they can be expanded to more schools, making them more efficient to run and more conducive to learning — and curbing the country's precipitous dropout rate.
"I hope the successful experience of this school as a social enterprise can help save the deteriorating public school sector across Tunisia," the 46-year-old said in an interview.
Hamadi, the founder of non-profit organization Wallah (Swear to God) We Can, grew up in France and moved to Canada but returned to Tunisia after the late President Zine El Abidine Ben Ali was ousted in a 2011 revolution.
Aware of the problems at the school in Makthar — in the governorate of Siliana — Hamadi began raising funds from corporate donors to help aiming to ease the kind of problems that have led about 526,000 students to drop out of school over the last five years, about 22% of the student population.
With 100,000 Tunisian dinars ($32,250), he bought 50 solar water heaters and photovoltaic panels capable of producing 45,000 kilowatt-hours (kWh) of power, four times as much as the school needs to operate.
While some of the excess is provided free to other nearby schools, a minority is sold to Tunisia's national power grid, generating about 6,000 dinars ($1,915) a year in income, which has been used to cut school debts and fund other costs.
The project fits into a drive by Tunisia's government to reach at least 4,000 megawatts (MW) of renewable energy by 2030 — both solar and wind — covering 35% of the country's electricity, as it seeks to cut its natural gas imports.
However, renewable energy currently makes up 3% of Tunisia's energy mix, according to the government, and some analysts are skeptical that the country will be able to hit its 2030 target.
"Red tape, political instability and cabinet reshuffles have been hindering Tunisia's plans to carry out renewable energy projects and boost production," said Abdessalem El Khazen, a renewable energy consultant based in Tunis.
Today, students at the Makthar preparatory school study in classrooms that are warm even during the town's bitter winters, with lights available to enable them to work at night.
An electronic board in the schoolyard shows how much solar energy is used each day, and school staff have been trained to carry out repairs and maintenance of the solar systems.
Chaima Rhouma, a former student at the school who is now a spokeswoman for Wallah We Can, said pupils have seen huge changes from the days when classrooms in the winter felt brutally cold.
"After the project was implemented, we became able to take hot showers and have warm rooms," she said.
Students do not only benefit directly from the green energy, they also learn about it during extracurricular activities such as permaculture classes, according to teacher Donia Msihli.
The clean energy installation is just part of a broader green push at the school — including an 8-hectare (20-acre) farm that provides vegetables to the school and jobs for a half-dozen previously unemployed parents of students at the school.
Excess produce is sold at market in Tunis to raise additional money for the school.
"It is a lifesaving project for ourselves and our children," said 41-year-old Habiba Baradi, a mother who works at the farm and whose two children attend the boarding school.
Tunisia's public schools today face a range of challenges, especially as a result of the economy having "lost a decade of growth" since the 2011 revolution due to overregulation, less trade and low investment, according to the World Bank.
In September, the education ministry said 75% of 10-year-old pupils and 83% of 13-year-old pupils were "semi-illiterate."
After Ramadan, in March and April, Hamadi's organization will start work to replicate the Makthar project in three other schools in Bizerte, Gabès and Kairouan provinces, he said.
This report is provided by the Thomson Reuters Foundation.