Exhibit 3.1



| |  |                 |  |       
| |  | --------------- |  | ------
| |  | Delaware        |  | PAGE 1
| |  | The First State |  |       

I, JEFFREY W. BULLOCK, SECRETARY OF STATE OF THE STATE OF DELAWARE, DO HEREBY CERTIFY THE ATTACHED IS
A TRUE AND CORRECT COPY OF THE RESTATED CERTIFICATE OF SOLARCITY CORPORATION, FILED IN THIS OFFICE ON THE EIGHTEENTH DAY OF DECEMBER, A.D. 2012, AT 10:21 OCLOCK A.M.

A FILED COPY OF THIS CERTIFICATE HAS BEEN FORWARDED TO THE NEW CASTLE COUNTY RECORDER OF DEEDS.



LOGO



---

| |  |  |  |                                                                                                                                                   
| |  |  |  | --------------------------------------------------------------------------------------------------------------------------------------------------
| |  |  |  | State of Delaware Secretary of State Division of Corporations
Delivered 10:21 AM 12/18/2012 FILED 10:21 AM 12/18/2012 SRV 121354697  4178768
FILE

SOLARCITY CORPORATION

AMENDED AND RESTATED CERTIFICATE OF INCORPORATION

SolarCity Corporation,
a corporation organized and existing under the laws of the State of Delaware, hereby certifies as follows:

A. The name of the
corporation is SolarCity Corporation. The original Certificate of Incorporation of the corporation was filed with the Secretary of State of the State of Delaware on June 21, 2006.

B. This Amended and Restated Certificate of Incorporation was duly adopted in accordance with Sections 242 and 245 of the General
Corporation Law of the State of Delaware (the DGCL), and has been duly approved by the written consent of the stockholders of the corporation in accordance with Section 228 of the DGCL.

C. The Certificate of Incorporation of the corporation is hereby amended and restated in its entirety to read as follows:

ARTICLE I

The name of the corporation is SolarCity Corporation.

ARTICLE II

The address of the corporations registered office in the
State of Delaware is Corporation Trust Center, 1209 Orange Street, Wilmington, New Castle County, Delaware 19801. The name of its registered agent at such address is The Corporation Trust Company.

ARTICLE III

The purpose of the corporation is to engage in any lawful act or activity for which corporations may be organized under the DGCL.

ARTICLE IV

The total number of shares of stock that the corporation shall
have authority to issue is one billion one hundred million (1,100,000,000), consisting of the following:

One billion
(1,000,000,000) shares of Common Stock, par value $0.0001 per share. Each share of Common Stock shall entitle the holder thereof to one (1) vote on each matter submitted to a vote at a meeting of stockholders.

One hundred million (100,000,000) shares of Preferred Stock, par value $0.0001 per share, which may be issued from time to time in
one or more series pursuant to a resolution or resolutions providing for such issue duly adopted by the Board of Directors (authority to do so being hereby



---

expressly vested in the Board of Directors). The Board of Directors is further authorized, subject to limitations prescribed by law, to fix by resolution or resolutions the designations, powers,
preferences and rights, and the qualifications, limitations or restrictions thereof, of any wholly unissued series of Preferred Stock, including without limitation authority to fix by resolution or resolutions the dividend rights, dividend rate,
conversion rights, voting rights, rights and terms of redemption (including sinking fund provisions), redemption price or prices, and liquidation preferences of any such series, and the number of shares constituting any such series and the
designation thereof, or any of the foregoing.

The Board of Directors is further authorized to increase (but not above the
total number of authorized shares of the class) or decrease (but not below the number of shares of any such series then outstanding) the number of shares of any series, the number of which was fixed by it, subsequent to the issuance of shares of
such series then outstanding, subject to the powers, preferences and rights, and the qualifications, limitations and restrictions thereof stated in the Certificate of Incorporation or the resolution of the Board of Directors originally fixing the
number of shares of such series. If the number of shares of any series is so decreased, then the shares constituting such decrease shall resume the status which they had prior to the adoption of the resolution originally fixing the number of shares
of such series.

ARTICLE V

The number of directors that constitutes the entire Board of Directors of the corporation shall be fixed by, or in the manner provided in, the Bylaws of the corporation. At each annual meeting of
stockholders, directors of the corporation shall be elected to hold office until the expiration of the term for which they are elected and until their successors have been duly elected and qualified or until their earlier resignation or removal;
except that if any such election shall not be so held, such election shall take place at a stockholders meeting called and held in accordance with the DGCL.

Effective upon the effective date of the corporations initial public offering (the Effective Date), the directors of the corporation shall be divided into three classes as nearly
equal in size as is practicable, hereby designated Class I, Class II and Class III. The Board of Directors may assign members of the Board of Directors already in office to such classes at the time such classification becomes effective. The term of
office of the initial Class I directors shall expire at the first regularly-scheduled annual meeting of the stockholders following the Effective Date, the term of office of the initial Class II directors shall expire at the second annual meeting of
the stockholders following the Effective Date and the term of office of the initial Class III directors shall expire at the third annual meeting of the stockholders following the Effective Date. At each annual meeting of stockholders, commencing
with the first regularly-scheduled annual meeting of stockholders following the Effective Date, each of the successors elected to replace the directors of a Class whose term shall have expired at such annual meeting shall be elected to hold office
until the third annual meeting next succeeding his or her election and until his or her respective successor shall have been duly elected and qualified.

Notwithstanding the foregoing provisions of this Article, each director shall serve until his or her successor is duly elected and qualified or until his or her death, resignation, or removal. If the
number of directors is hereafter changed, any newly created directorships or decrease in directorships



-2-



---

shall be so apportioned among the classes as to make all classes as nearly equal in number as is practicable, provided that no decrease in the number of directors constituting the Board of
Directors shall shorten the term of any incumbent director.

Any director may be removed from office by the stockholders of
the corporation only for cause. Vacancies occurring on the Board of Directors for any reason and newly created directorships resulting from an increase in the authorized number of directors may be filled only by vote of a majority of the remaining
members of the Board of Directors, although less than a quorum, or by a sole remaining director, at any meeting of the Board of Directors. A person so elected by the Board of Directors to fill a vacancy or newly created directorship shall hold
office until the next election of the class for which such director shall have been chosen and until his or her successor shall be duly elected and qualified.

ARTICLE VI

In furtherance and not in limitation of the powers conferred
by statute, the Board of Directors of the corporation is expressly authorized to adopt, amend or repeal the Bylaws of the corporation.

ARTICLE VII

Elections of directors need not be by written ballot unless
the Bylaws of the corporation shall so provide.

ARTICLE VIII

No action shall be taken by the stockholders of the corporation except at an annual or special meeting of the stockholders called in
accordance with the Bylaws, and no action shall be taken by the stockholders by written consent.

ARTICLE IX

To the fullest extent permitted by the DGCL, as it presently exists or may hereafter be amended from time to time, a director of the
corporation shall not be personally liable to the corporation or its stockholders for monetary damages for breach of fiduciary duty as a director. If the DGCL is amended to authorize corporate action further eliminating or limiting the personal
liability of directors, then the liability of a director of the corporation shall be eliminated or limited to the fullest extent permitted by the DGCL, as so amended.

Neither any amendment nor repeal of this Article, nor the adoption of any provision of this corporations Certificate of Incorporation inconsistent with this Article, shall eliminate or reduce the
effect of this Article in respect of any matter occurring, or any cause of action, suit or proceeding accruing or arising or that, but for this Article, would accrue or arise, prior to such amendment, repeal or adoption of an inconsistent provision.



-3-



---

ARTICLE X

Subject to any provisions in the Bylaws of the corporation related to indemnification of directors or officers of the corporation, the corporation shall indemnify, to the fullest extent permitted by
applicable law, any director or officer of the corporation who was or is a party or is threatened to be made a party to any threatened, pending or completed action, suit or proceeding, whether civil, criminal, administrative or investigative (a
Proceeding) by reason of the fact that he or she is or was a director, officer, employee or agent of the corporation or is or was serving at the request of the corporation as a director, officer, employee or agent of another
corporation, partnership, joint venture, trust or other enterprise, including service with respect to employee benefit plans, against expenses (including attorneys fees), judgments, fines and amounts paid in settlement actually and reasonably
incurred by such person in connection with any such Proceeding.

The Corporation shall have the power to indemnify, to the
extent permitted by the DGCL, as it presently exists or may hereafter be amended from time to time, any employee or agent of the corporation who was or is a party or is threatened to be made a party to any Proceeding by reason of the fact that he or
she is or was a director, officer, employee or agent of the corporation or is or was serving at the request of the corporation as a director, officer, employee or agent of another corporation, partnership, joint venture, trust or other enterprise,
including service with respect to employee benefit plans, against expenses (including attorneys fees), judgments, fines and amounts paid in settlement actually and reasonably incurred by such person in connection with any such Proceeding.

A right to indemnification or to advancement of expenses arising under a provision of this Certificate of Incorporation or a
bylaw of the corporation shall not be eliminated or impaired by an amendment to this Certificate of Incorporation or the Bylaws of the corporation after the occurrence of the act or omission that is the subject of the civil, criminal, administrative
or investigative action, suit or proceeding for which indemnification or advancement of expenses is sought, unless the provision in effect at the time of such act or omission explicitly authorizes such elimination or impairment after such action or
omission has occurred.

ARTICLE XI

Except as provided in ARTICLE IX and ARTICLE X above, the corporation reserves the right to amend, alter, change or repeal any provision contained in this Certificate of Incorporation, in the manner now
or hereafter prescribed by statute, and all rights conferred upon stockholders herein are granted subject to this reservation. Notwithstanding any other provision of this Certificate of Incorporation, and in addition to any other vote that may be
required by law or the terms of any series of Preferred Stock, the affirmative vote of the holders of at least 66 2/3% of the voting power of all then outstanding shares of capital stock of the corporation entitled to vote generally in the election
of directors, voting together as a single class, shall be required to amend, alter or repeal, or adopt any provision of this Certificate of Incorporation inconsistent with the purpose and intent of Article V, Article VI, Article VII, Article VIII or
this Article XI (including, without limitation, any such Article as renumbered as a result of any amendment, alteration, change, repeal or adoption of any other Article).



-4-



---

IN WITNESS WHEREOF, SolarCity Corporation has caused this Amended and Restated Certificate
of Incorporation to be signed by the President and Chief Executive Officer of the corporation on this 14th day of December 2012.



By:

/s/ Lyndon R. RiveLyndon R. RivePresident and Chief Executive Officer




-5-