WHD Cactus

Filed: 11 Mar 21, 9:45am
Exhibit 5.1
FAX +1 212.408.2501LONDON
March 11,
Cactus, Inc.
920 Memorial City Way, Suite 300
Houston, Texas 77024

Ladies and Gentlemen:
We have acted as counsel for Cactus, Inc., a Delaware corporation (the “Company”), in connection with the proposed offering and sale (the “Offering”) by certain stockholders of the Company (the “Selling Stockholders”) named in Schedule I to the Underwriting Agreement (as defined below) of up to 6,325,000 shares (the “Shares”) of Class A common stock, par value $0.01 per share (“Class A Common Stock”), of the Company, including up to 825,000 shares of Class A Common Stock that may be issued and sold upon exercise by the Underwriters (as defined below) of their option to purchase additional shares of Class A Common Stock, pursuant to that certain Underwriting Agreement, dated March 9, 2021 (the “Underwriting Agreement”), by and among the Company, Cactus Wellhead, LLC (“Cactus LLC”), the Selling Stockholders and Citigroup Global Markets Inc. and Credit Suisse Securities (USA) LLC, as representatives of the underwriters named therein (the “Underwriters”). The Shares proposed to be sold by the Selling Stockholders to the Underwriters pursuant to the Underwriting Agreement consist of up to (a) 6,272,500 shares of Class A Common Stock (the “Redemption Common Stock”) that are to be issued directly to the Underwriters in exchange for an equivalent number of units representing limited liability company interests in Cactus LLC, together with a corresponding number of shares of the Company’s Class B common stock, par value $0.01 per share, as provided in the First Amended and Restated Limited Liability Company Operating Agreement (the “Cactus LLC Agreement”) of Cactus LLC and (b) 52,500 previously issued shares of Class A Common Stock (the “Resale Common Stock”) held by certain of the Selling Stockholders.
In connection with the opinions expressed herein, we have examined, among other things: (i) the registration statement on Form S-3 (Registration No. 333-230328) (the “Registration Statement”) filed by the Company with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”), (ii) the prospectus included in the Registration Statement dated March 15, 2019 (the “Base Prospectus”), (iii) the prospectus supplement to the Base Prospectus dated March 9, 2021, filed with the Commission on March 10, 2021 (together with the Base Prospectus, the “Prospectus”); (iv) the Underwriting Agreement; (v) the Amended and Restated Certificate of Incorporation and the Amended and Restated Bylaws of the Company; (vi) the Cactus LLC Agreement; and (vii) the Company’s records and documents, certificates of representatives of the Company and public officials, and other instruments and documents as we deemed necessary or advisable for the purposes of this opinion. We have also reviewed such questions of law as we have deemed necessary or appropriate. As to matters of fact relevant to the opinions expressed herein, and as to factual matters arising in connection with our examination of corporate documents, records

Cactus, Inc. - 2 -March 11, 2021

and other documents and writings, we relied upon certificates and other communications of corporate officers of the Company, without further investigation as to the facts set forth therein.
In connection with rendering the opinions set forth below, we have also assumed that: (i) all information contained in all documents reviewed by us is true and correct; (ii) all signatures on all documents examined by us are genuine; (iii) all documents submitted to us as originals are authentic and all documents submitted to us as copies conform to the originals of those documents; and (iv) the Redemption Common Stock has been issued in accordance with the Cactus LLC Agreement.
Based on the foregoing, and subject to the assumptions, qualifications, limitations, and exceptions set forth herein, we are of the opinion that
a.the Resale Common Stock has been duly authorized and is validly issued, fully paid and nonassessable; and
b.the Redemption Common Stock has been duly authorized and, when issued and delivered to the Underwriters in accordance with the terms of the Underwriting Agreement and the Cactus LLC Agreement, will be validly issued, fully paid and nonassessable.
The foregoing opinions are limited in all respects to the General Corporation Law of the State of Delaware and the Delaware Limited Liability Company Act (including the applicable provisions of the Delaware Constitution), in each case as in effect on the date hereof, and applicable reported judicial decisions, rules and regulations interpreting and implementing those laws. We express no opinion as to the effect of the laws of any other jurisdiction, domestic or foreign.
We hereby consent to the filing of this opinion of counsel as Exhibit 5.1 to the Company’s Current Report on Form 8-K dated on or about the date hereof, to the incorporation by reference of this opinion into the Registration Statement and to the use of our name under the caption “Legal Matters” in the Prospectus. In giving this consent, we do not hereby admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act and the rules and regulations of the Commission thereunder.
The opinion expressed herein is given as of the date hereof and we undertake no obligations to supplement this opinion if any applicable law changes after such date or if we become aware of any facts that might change the opinion expressed herein after such date or for any other reason.
Very truly yours,
/s/ Baker Botts L.L.P.