Exhibit 23.1


Consent of Independent Registered Public Accounting Firm
We consent to the incorporation by reference in the following Registration Statements:
Form S-8 (No. 333-224806) pertaining to the Sunrun Inc. 2015 Equity Incentive Plan, Sunrun Inc. 2015 Employee Stock Purchase Plan
Form S-3 (No. 333-222099) pertaining to the registration of common stock, preferred stock, debt securities, and warrants
Form S-8 (No. 333-217869) pertaining to the Sunrun Inc. 2015 Equity Incentive Plan and Sunrun Inc. 2015 Employee Stock Purchase Plan
Form S-8 (No. 333-211356) pertaining to the Sunrun Inc. 2015 Equity Incentive Plan and Sunrun Inc. 2015 Employee Stock Purchase Plan
Form S-8 (No. 333-206120) pertaining to the Sunrun Inc. 2015 Equity Incentive Plan, Sunrun Inc. 2015 Employee Stock Purchase Plan, Sunrun Inc. 2014 Equity Incentive Plan, Sunrun Inc. 2013 Equity Incentive Plan, Sunrun Inc. 2008 Equity Incentive Plan, and Mainstream Energy Corporation 2009 Stock Plan

of our reports dated February 28, 2019, with respect to the consolidated financial statements of Sunrun Inc. and the effectiveness of internal control over financial reporting of Sunrun Inc. included in this Annual Report (Form 10-K) of Sunrun Inc. for the year ended December 31, 2018.

/s/ Ernst & Young LLP

San Francisco, California
February 28, 2019