Exhibit 23.1


Consent of Ernst & Young LLP, Independent Registered Public Accounting Firm
We consent to the incorporation by reference in the following Registration Statements
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 Sunrun, Inc.
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-217869) pertaining to the Sunrun Inc. 2015 Equity Incentive Plan and 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

of our report dated March 6, 2018, with respect to the consolidated financial statements of Sunrun Inc. included in this Annual Report (Form 10-K) for the year ended December 31, 2017.

/s/ Ernst & Young LLP

San Francisco, California
March 6, 2018