Solar panels and self-consumption are fully legal and well established across Spain, including Andalucía, Málaga province and the Costa del Sol. What changes from one project to the next is not whether solar is allowed, but which combination of technical, administrative and municipal steps applies. That combination depends on the type of installation, its capacity, whether surplus electricity is exported, the municipality, the property type and the applicable grid connection.
This guide explains the current legal and administrative framework for solar panels in Spain in 2026, including permits, legalisation, self-consumption categories and the rules that commonly affect villa and property owners in Marbella and along the Costa del Sol.
What Are the Solar Panel Regulations in Spain in 2026?
Spain regulates solar self-consumption through a defined national framework built around Real Decreto 244/2019, which sets the administrative, technical and economic conditions for self-consumption of electricity. On top of this national framework, electrical certification rules, regional registration procedures and municipal requirements can also apply depending on the project and its location.
For a homeowner, this means a compliant solar installation is rarely governed by a single rule. It usually involves a combination of national self-consumption regulation, technical/electrical certification, and, where relevant, regional and municipal procedures. A company offering professional solar panel installation will typically coordinate these different layers as part of the project rather than leaving the homeowner to identify each requirement individually.
What Law Regulates Solar Self-Consumption in Spain?
Real Decreto 244/2019, of 5 April, is the central piece of national legislation regulating solar self-consumption in Spain. It defines the different self-consumption modalities, the conditions for connecting production installations to the grid, and the framework for compensating surplus electricity.
Among other things, the decree establishes the distinction between self-consumption with and without surplus, introduces the legal basis for collective self-consumption (allowing several consumers, including neighbours in the same building, to share one generation installation), and sets out simplified compensation mechanisms for eligible surplus electricity. Other rules — electrical safety regulations, regional administrative procedures and municipal requirements — sit alongside this national decree rather than replacing it. For the full legal text, see Real Decreto 244/2019 in Spain’s Official State Gazette.
What Types of Solar Self-Consumption Exist in Spain?
Solar self-consumption without surplus
Autoconsumo sin excedentes (self-consumption without surplus) describes an installation designed so that no electricity is exported to the grid. This is commonly achieved with anti-export protection — a device or inverter configuration that limits or blocks the flow of surplus generation back into the distribution network. Homeowners sometimes choose this configuration to simplify certain administrative or grid-related requirements, though the applicable procedure still depends on the specific installation and distributor.
Solar self-consumption with surplus
Autoconsumo con excedentes (self-consumption with surplus) allows any electricity generated beyond the property’s own consumption to be exported to the grid. Exporting surplus is a separate matter from being compensated for it: a system can export surplus without the owner being enrolled in a compensation mechanism, depending on whether the applicable contractual and administrative steps have been completed.
Do You Need Permission to Install Solar Panels in Spain?
There is no single, universal “solar permit” in Spain. Instead, a compliant project generally involves up to four distinct concepts, which are not the same thing and are not always required in the same way:
- Municipal procedure: depending on the works and the municipality, some form of local authorisation or notification to the town hall may apply to the physical installation.
- Electrical certification and legalisation: the electrical installation is documented and certified by a qualified installer, in line with applicable electrical safety regulations.
- Regional administrative registration: self-consumption installations are typically registered with the competent regional authority, which in Andalucía is coordinated through the Junta de Andalucía.
- Grid or distributor procedures: where applicable, the electricity distributor may need to be notified or involved, particularly for installations that export surplus.
Because these four elements can apply independently of one another, the installer should verify which combination applies to a specific property before assuming that a project is fully compliant.
Do Solar Panels Need Grid Access and Connection Permission?
Whether formal grid access and connection procedures apply depends on several factors: whether the installation exports surplus, its capacity, its classification under the applicable legislation, and the requirements set by the local distributor. It is inaccurate to state that every installation below a given capacity threshold is automatically exempt from all grid procedures — exemptions can apply to certain categories of low-capacity, non-exporting installations, but this depends on the specific case rather than capacity alone.
In practice, this means two systems of similar size can be subject to different grid requirements simply because one exports surplus and the other does not, or because they connect to different points on the network. The installer should confirm the applicable procedure directly with the relevant distributor rather than relying on general assumptions.
Do Solar Panels Need to Be Legalised in Spain?
What homeowners usually mean by “solar legalisation” is the process of documenting and registering the electrical installation through the applicable technical, regional and, where relevant, distributor procedures. An installation that generates and consumes electricity without completing this documentation is not necessarily illegal in principle, but leaving it undocumented can create practical problems later.
An undocumented or partially documented installation may complicate distributor procedures, delay or prevent enrolment in surplus compensation, create friction during a property sale or ownership transfer, affect insurance coverage, and make future modifications or expansions harder to formalise. Completing the applicable paperwork at the time of installation is generally more straightforward than resolving gaps afterward.
What Documents Are Normally Required to Legalise Solar Panels?
The specific documents required depend on the project, its capacity, and whether it exports surplus. Documentation commonly involved in Spanish solar projects can include:
- A technical report or project describing the installation
- Electrical installation certification issued by the installer
- Technical documentation for the inverter and protection systems
- Technical documentation for the solar panels
- A single-line electrical diagram
- Commissioning documentation
- Distributor paperwork, where the installation exports surplus or requires grid notification
- Regional registration records
- Municipal documentation, where applicable to the works carried out
- Proof of anti-export configuration, for zero-export systems
Not every installation requires every item on this list — the applicable documentation set is defined by the project’s classification and location.
How Is a Solar Installation Registered in Andalucía?
In Andalucía, self-consumption installations are registered within the national framework through the region’s competent administration, coordinated by the Junta de Andalucía. Professional installers normally prepare the required technical documentation and submit or coordinate the applicable registration on the homeowner’s behalf as part of the installation process.
This registration procedure applies to properties throughout Málaga province and the Costa del Sol, including villas and residential properties in Marbella, Estepona and neighbouring municipalities, in the same way it applies across the rest of the autonomous community.
What Is Simplified Surplus Compensation?
Compensación simplificada (simplified surplus compensation) is a mechanism under which electricity exported to the grid can be valued by the consumer’s electricity retailer and credited against the bill, for consumers and installations that meet the eligibility conditions. It does not represent a fixed or guaranteed rate — the value applied depends on the specific contract and retailer, exported electricity must be measured, and the corresponding contractual setup must be in place before compensation can be applied. Property owners should treat compensation as something to be arranged and confirmed with their retailer rather than assumed automatically.
What Is a Zero-Export Solar System?
A zero-export (or anti-export) solar system is configured, typically through the inverter or an added protection device, so that no electricity flows back into the distribution grid. Homeowners may choose this configuration for a range of reasons: distributor or grid capacity constraints at the property, a preference to simplify certain administrative steps, or a consumption pattern that makes exporting surplus less relevant. Zero-export is not inherently better or worse than a system with surplus — the right choice depends on the property’s consumption profile and the applicable local conditions.
Can You Add a Battery to a Legal Solar Installation?
Battery storage can be integrated into many self-consumption installations, typically through a hybrid inverter that manages solar generation, battery charging and discharging, and the connection to the grid. Adding a battery generally increases the share of self-generated electricity a property can use, including in the evening when panels are not producing.
A common misconception is that a grid-connected solar system will automatically keep a house running during a power outage. In reality, a standard grid-connected system is generally designed to disconnect during a grid outage for safety reasons. Backup operation during an outage requires a suitable hybrid inverter, a compatible battery, backup or EPS (emergency power supply) architecture, and correct electrical design with the appropriate protection and switching components. This is a distinct technical configuration, not a default feature of every solar-plus-battery system. KiDi Solar’s solar and battery storage solutions are designed around this distinction, so the intended use case — self-consumption, backup, or both — is defined at the design stage.
Can Solar Panels Work During a Power Cut?
Solar panels can power selected loads during a blackout only when the system has been designed with suitable backup capability. Without that specific design, a standard grid-tied installation disconnects during an outage as a safety measure, in the same way conventional grid-connected electrical systems do.
Achieving backup capability during a power cut generally means the system includes a hybrid inverter with backup output, a battery sized for the loads that need to stay powered, and wiring that separates backup circuits from the rest of the property’s electrical installation. This is typically planned and installed at the outset, since retrofitting backup capability into an existing standard system can require additional electrical work.
Solar Panels in Apartment Buildings and Communities of Owners
Autoconsumo colectivo (collective self-consumption) allows several consumers — for example, neighbours in the same building — to share the electricity generated by one installation, such as panels on a shared roof. This modality distributes generated energy among participants according to agreed coefficients and requires its own administrative documentation, in addition to the standard self-consumption procedures.
Shared installations raise questions that individual, single-property systems do not: who owns the panels, how generation is metered and distributed among participants, and how common areas such as the roof or shared electrical infrastructure are used.
Do You Need Permission From a Comunidad de Propietarios?
Where a solar project involves the use of a common roof, shared façade, or communal electrical infrastructure, some form of community procedure or approval can be required depending on the specific project and the community’s own governing rules. This is different from an installation confined entirely to a single owner’s private space and existing individual supply.
Because the requirements for community approval can vary by project and are governed by both national community-property law and the community’s internal regulations, this is an area where project-specific verification — rather than a general rule of thumb — is the appropriate approach.
Solar Panel Permits in Marbella and the Costa del Sol
Municipal procedures for solar installations are not identical across every Costa del Sol town hall. A project in Marbella can be subject to different local requirements, forms or timelines than an equivalent project in Estepona, Mijas, Benahavís, Fuengirola or Benalmádena, and Málaga city and Torremolinos each apply their own municipal processes as well. Sotogrande, spanning parts of the Cádiz side of the coast, follows its own local municipal framework in addition to the regional and national rules described above.
For a property owner, this means the correct municipal procedure genuinely depends on where the property is located, not only on the technical specification of the system. KiDi Solar verifies the applicable process for each specific property and municipality as part of planning a project, rather than applying a single standard procedure across every town hall on the coast. For projects specifically in Marbella, more detail is available on the page for solar panel installation in Marbella.
How Long Does Solar Legalisation Take?
There is no fixed number of days that applies to every solar legalisation process in Spain. Timelines depend on the complexity of the project, the municipality involved, how complete the technical documentation is when submitted, the distributor’s own processing times, whether any technical corrections are requested, and whether surplus compensation needs to be set up in addition to standard registration.
It is also worth distinguishing between the physical installation, which is often completed within a matter of days, and the administrative processing that follows — registration, certification and, where applicable, distributor and compensation procedures — which can take longer and proceed on a separate timeline from the on-site work.
Can Solar Panels Be Installed Before All Paperwork Is Complete?
In practice, some documentation is typically prepared before the physical installation begins (such as the technical project and design), some is generated during installation (such as component certificates and the single-line diagram), and some is completed after commissioning (such as final certification, registration and, where applicable, distributor communication or surplus compensation setup).
This staged approach is normal. What should be avoided is operating a completed installation — particularly one exporting surplus or claiming compensation — without the documentation that applies to that specific configuration having been finalised.
Who Is Responsible for Solar Panel Legalisation?
Responsibility for a compliant solar project is typically shared across several parties: the property owner, who commissions the installation; the authorised installer, who designs and certifies the electrical work; a technician or engineer, where the project’s complexity requires one; the electricity distributor, for grid-related procedures; the energy retailer, for compensation arrangements; and the relevant municipal and regional administrations, for local and regional procedures.
Because these responsibilities are spread across multiple parties, a turnkey company that coordinates all of them on the owner’s behalf removes the need for the homeowner to manage each relationship separately.
Common Solar Legalisation Mistakes
- Classifying the installation incorrectly relative to its actual configuration or capacity
- Submitting incomplete electrical certification
- Poor or inconsistent technical documentation
- Incorrect inverter or export configuration relative to what was declared
- Ignoring municipal requirements specific to the property’s location
- Assuming every Costa del Sol municipality follows the same procedure
- Incomplete communication with the electricity distributor
- Never activating surplus compensation after installation, leaving eligible savings unclaimed
- Missing documentation that later complicates a system expansion or battery addition
- Incorrect configuration of a backup or EPS system relative to its intended use
Why Use a Turnkey Solar Installer?
There is a meaningful difference between installing panels on a roof and delivering a complete, legally documented solar project. The first is a physical task; the second includes consumption analysis, system sizing, electrical design, installation, inverter configuration, battery integration where relevant, electrical protections, certification, legalisation, applicable grid paperwork, surplus compensation setup, and ongoing monitoring and solar maintenance.
A turnkey installer can coordinate all of these steps as one process, rather than leaving the property owner to manage design, certification, registration and distributor communication as separate, disconnected tasks.
Solar Legalisation for EV Charger and Solar Integration
An increasing number of Costa del Sol homeowners combine solar panels, battery storage and an EV charger, often with dynamic load management so the property’s total electrical demand stays within safe limits. EV charger installation carries its own technical requirements, separate from those governing the solar generation and storage components, and needs to be accounted for in the property’s overall electrical design rather than treated as an afterthought once the solar system is already installed.
Frequently Asked Questions About Solar Panel Regulations in Spain
Are solar panels legal in Spain?
Yes. Solar self-consumption is legal and regulated nationally through Real Decreto 244/2019, alongside applicable regional and municipal procedures.
Do I need permission to install solar panels in Spain?
There is no single universal permit. Depending on the project, a combination of municipal procedure, electrical certification, regional registration and grid or distributor procedures may apply.
Do solar panels need to be registered in Spain?
Self-consumption installations are generally registered with the competent regional administration — in Andalucía, this is coordinated through the Junta de Andalucía — as part of the applicable legalisation process.
What is Real Decreto 244/2019?
Real Decreto 244/2019 is the national decree that regulates the administrative, technical and economic conditions of solar self-consumption in Spain, including self-consumption categories, grid connection conditions and surplus compensation.
Can I receive compensation for surplus solar electricity?
Eligible installations can access simplified surplus compensation, under which exported electricity is valued by the retailer and credited against the bill, subject to the applicable contract and eligibility conditions.
Do I need permission for solar panels in Marbella?
Marbella applies its own municipal procedure alongside the national and regional framework. The applicable local requirements should be verified for the specific property before installation.
Can I install solar panels on an apartment building?
Yes, through collective self-consumption, which allows several consumers to share one installation. This typically requires additional administrative documentation and, where common areas are used, community-level agreement.
Can solar panels work during a blackout?
Only when the system has been specifically designed for backup operation, with a suitable hybrid inverter, compatible battery and correct electrical configuration. A standard grid-tied system disconnects during an outage for safety.
Do I need a battery with solar panels?
No. A battery is optional and increases self-consumption and, where properly configured, enables backup capability, but a grid-connected solar system can operate without one.
Who legalises a solar installation in Andalucía?
The authorised installer typically prepares the technical documentation, and registration is processed with the competent regional administration, coordinated through the Junta de Andalucía, as part of the overall legalisation process.
Do solar rules differ between Marbella and Estepona?
Municipal procedures can differ between Costa del Sol town halls, including Marbella and Estepona, even though both fall under the same national and regional self-consumption framework.
Can I add a battery later?
In many cases a battery can be added to an existing system, provided the inverter and electrical design are compatible or can be adapted. This should be assessed on a project-specific basis before purchase.
Need Help With Solar Panel Legalisation on the Costa del Sol?
KiDi Solar provides turnkey solar installations for villas, houses and investment properties across Marbella and the Costa del Sol, and can coordinate the technical and administrative side of a project alongside the physical installation. This includes system sizing, installation, electrical documentation, applicable legalisation and grid paperwork, battery integration, and support with surplus compensation setup.
For an assessment of what applies to your specific property, you can request a free solar assessment. Property owners looking for further practical guidance can also browse the KiDi Solar solar energy blog for more detailed guides on solar and battery topics.
