EXHIBIT 5.1

OPINION OF WILSON SONSINI GOODRICH & ROSATI

PROFESSIONAL CORPORATION

May 10, 2017

 

Sunrun Inc.

595 Market Street, 29th Floor

San Francisco, California 94105

Re:  Registration Statement on Form S‑8

Ladies and Gentlemen:

We have examined the Registration Statement on Form S-8 (the “Registration Statement”) to be filed by Sunrun Inc., a Delaware corporation (the “Company”), with the Securities and Exchange Commission on or about the date hereof, in connection with the registration under the Securities Act of 1933, as amended, of 4,172,833 shares of the Company’s common stock (“Common Stock”) reserved for issuance under the Sunrun Inc. 2015 Equity Incentive Plan and 2,086,416 shares of Common Stock reserved for issuance under the Sunrun Inc. 2015 Employee Stock Purchase Plan (which plans are referred to herein as the “Plans” and which shares of Common Stock are referred to herein as the “Shares”).

On the basis of the foregoing, and in reliance thereon, we are of the opinion that the Shares, when issued and sold in the manner referred to in the Plans and pursuant to the agreements that accompany the Plans, will be legally and validly issued, fully paid, and nonassessable.

We consent to the use of this opinion as an exhibit to the Registration Statement and further consent to the use of our name wherever appearing in the Registration Statement and any amendments thereto.

 

Very truly yours,

 

WILSON SONSINI GOODRICH & ROSATI

Professional Corporation

 

/s/ Wilson Sonsini Goodrich & Rosati, P.C.