REGULATION

Law 82-21 in Morocco: producing your own solar electricity in 2026

Declaration, connection agreement, surplus capped at 20%, buyback tariff: what Law 82-21 and its decree change for solar self-production in Morocco.

Published on

Row of ground-mounted solar panels next to an irrigation basin, with olive trees in the background

Since 9 June 2026, the implementing decree of Law 82-21 has been in force, and electricity self-production in Morocco has entered a practical phase. Homes, shops, workshops and farms can produce their own solar electricity within a clear framework. Here is what the official text says, and what still remains to be settled.

Law 82-21 in a few lines

Law No. 82-21 on the self-production of electrical energy was enacted by Dahir No. 1-23-21 of 10 February 2023. Its French version appeared in Official Bulletin No. 7400 of 1 May 2025, and ANRE, the national electricity regulator, publishes it on its website.

The principle is simple: an individual or a company may produce electricity solely for its own consumption, from an installation it owns or has the right to use (Article 2). A household can equip its home, a business the roof of its workshop, a farmer the farm.

Implementing Decree No. 2-25-100 was published in Official Bulletin No. 7489 of 9 March 2026. It has applied since 9 June 2026, three months after publication.

Four regimes depending on capacity and grid connection

The law sorts installations by whether or not they are connected to the grid, and by their capacity. In every case, a formal step is required before building or operating the installation.

The regimes set out in Law 82-21
InstallationRegimeBody named in the text
Not connected to the national gridDeclaration (Article 3)The administration
Connected at low voltage, below a threshold set by decreeDeclaration before works (Article 4)The distribution network operator
From the threshold up to 5 MW, at low or medium voltageConnection agreement (Article 5)The relevant network operator
5 MW and aboveAuthorisation (Article 6)The administration, after technical opinion from the transmission network operator

The declaration threshold and low voltage

Low voltage means networks of 1,000 volts or less (Article 2), which covers almost every home. According to the Moroccan business press, the implementing decree sets at 11 kW the threshold below which a low-voltage installation only requires a declaration.

A declaration is still a formal step: it is filed with the distribution network operator before works begin. Practical details (form, documents, timeframes) should be confirmed with the network operator in your city when the project starts.

Surplus sold to the grid: 20% at most, at a tariff set by ANRE

Article 12 allows a self-producer to sell to the network operator a share of its surplus that may not exceed 20% of annual production. The 10% figure found on some websites is wrong: the official text clearly says 20%.

The surplus tariff is set by ANRE. From 1 March 2026 to 28 February 2027, it is MAD 0.21 per kWh at peak hours and MAD 0.18 per kWh off-peak, for extra-high, high and medium voltage networks. For low voltage, the level used by homes, ANRE has stated that the tariff will be set later: no buyback tariff has yet been published for households.

The surplus is therefore not offset against your bill kWh for kWh: it is sold, within a strict limit, at a tariff set by the regulator.

What the 20% rule means for a home

Because the surplus is capped and its low-voltage tariff is not yet known, the value of an installation lies first in the electricity you use at the moment it is produced. Good sizing therefore starts from your daytime consumption, not from the roof area available.

Several uses can easily be moved to sunny hours:

  • the electric water heater, scheduled around midday;
  • the pool or irrigation pump;
  • the washing machine and dishwasher, run during the day;
  • air conditioning, which works hardest when the sun is strong.

Meter, storage and grid capacity

Every grid-connected installation must have a smart meter for billing (Article 18). This meter may only be installed by the network operator (Article 19). It shows in real time the electricity drawn and injected, by time band.

For evening use, a battery can keep part of the day’s production. Storage is expressly allowed by Article 15, under conditions set by regulation.

Grid hosting capacity is limited: the operator examines declarations and applications in order of receipt, by date and time (Article 14). The law also states that the operator may not cut off a customer’s supply because they own a self-production installation (Article 10).

Your contact depends on your city: a regional multi-service company (SRM), such as the one for Casablanca-Settat, which has distributed electricity in its region since 1 October 2024, ONEE, or a municipal utility. Installations must comply with applicable standards and protect people and property from electrical hazards (Article 17): installation and connection are a job for a qualified professional.

Points still to be clarified

Several items remain to be followed: the low-voltage surplus tariff, the detailed conditions for storage, and the possibility, provided by Article 12, of revising the 20% cap at the self-producer’s request, under conditions still to be set by regulation.

This article was updated on 26 October 2026. We review it regularly, as ANRE decisions and network operators’ procedures may change.

Since 1999, Batitherm has supported Moroccan households and businesses in their energy projects. Our advisors in Casablanca and Rabat help you size an installation that fits this framework, and our after-sales service stays by your side after commissioning.

Frequently asked questions

Can a private individual install solar panels in Morocco?

Yes. Law 82-21 defines a self-producer as any individual or legal entity producing electricity for its own consumption (Article 2). A low-voltage installation below the threshold set by decree must be declared to the distribution network operator before works begin (Article 4).

Can you sell all your production to the grid?

No. The surplus sold may not exceed 20% of annual production (Article 12). The 10% figure sometimes quoted is wrong.

At what price is the surplus bought?

From 1 March 2026 to 28 February 2027, ANRE set MAD 0.21 per kWh at peak hours and MAD 0.18 per kWh off-peak for extra-high, high and medium voltage. The low-voltage tariff will be set later. The ANRE website is the reference for any update.

Does an off-grid installation need to be declared?

Yes. An installation not connected to the national grid requires a declaration to the administration (Article 3), under procedures set by regulation.

Since when has the implementing decree applied?

Decree No. 2-25-100, published in Official Bulletin No. 7489 of 9 March 2026, has applied since 9 June 2026.

Sources