Underground pipelines are vital parts to urban water supply, gas supply, and other lifeline systems, affecting the sustainable development of cities to a great extent. The pipeline joint, which is a weak link, may be seriously damaged during natural disasters such as earthquakes. The failure of pipe joints can cause leakage accidents, resulting in system failure and interruption, and even some secondary disasters. Herein, based on uniaxial and plane tensile test results of a T-rubber gasket material, the assembly process and sealing performance of a T-rubber gasket joint of a ductile iron pipe are numerically simulated using the Ogden third-order strain energy density function to fit the material constant. The simulation accounts for severe nonlinearities, including large deformations, hyperelasticity, and complex contacts. The effects of the assembly friction coefficient, assembly depth, and radial clearance deviation of the socket and spigot on the seal contact pressure are analyzed. The results suggest that the entire history of the deformation and stress variations during assembly can be clearly visualized and accurately calculated. For the different friction coefficients, the assembly depth corresponding to the sliding friction condition of the spigot pipe was 74 mm, while the minimum pushing force required to assemble the T-rubber gasket joint of a DN300 ductile iron pipe was 6.8 kN at the ideal situation with a friction coefficient of 0. The effective contact pressure of the rubber gasket seepage surface under various operating conditions is much higher than the normal pressure of municipal pipelines, thus indicating that the rubber gasket joint exhibits the ideal sealing performance. Furthermore, a certain deviation, which is about 20 mm, is allowed for the assembly depth of the rubber gasket joint such that the axial displacement of the pipe joint can be adapted under an earthquake or ground displacement.