In this research, we have formulated a Two-Stage Distributionally Robust Optimization (TDRO) model within the context of a mean–variance ambiguity set, specifically designed to address the challenges in the Integrated Berth Allocation and Quay Crane Assignment Problem (BACAP). A key consideration in this study is the inherent uncertainty associated with ships’ arrival times. During the initial stage, we derive a baseline schedule governing berth allocation and quay crane assignment. Anticipating potential disruptions arising from uncertain arrival delays, the second stage is meticulously formulated to determine the worst-case expectation of adjustment costs within the mean–variance ambiguity set. Subsequently, we undertake an equivalent transformation, converting the general TDRO model into a Two-Stage Robust Second-Order Cone Programming (TRO-SOCP) model. This transformation facilitates the application of the Column and Constraint Generation (C&CG) algorithm, ensuring the derivation of an exact solution. To address the computational intricacies associated with second-order cone programming, we propose two enhancement strategies for upper and lower bounds, aimed at expediting the solution process. Additionally, to contend with large-scale instances, we introduce a refinement and approximation method, transforming the TDRO model into a Mixed-Integer Programming (MIP) model. Furthermore, extensive numerical experiments are executed on both synthetic and real-life instances to validate the superior performance of our model and algorithms. In terms of the total cost, the TDRO model demonstrates superior performance compared with Two-Stage Stochastic Programming (TSP) and Two-Stage Robust Optimization (TRO) models.