In this study, the mating behavior of Portunus trituberculatus under indoor conditions and the role of shelters in its mating process were systematically studied by using behavioral observation methods. The results showed that the mating behavior of P. trituberculatus was divided into four stages: courtship and pre-copulatory guarding, reproductive moulting, copulation, and post-copulatory guarding. P. trituberculatus in the no shelter group (NSG) usually preferred to gather at the edges or corners of the cement tank, while P. trituberculatus in the shelter group (SG) preferred to hide in the shelters. During the whole experiment, the shelter occupancy rate of P. trituberculatus during the day (57.40%) was significantly higher than that at night (38.08%) (P < 0.05). In terms of hiding rate, the hiding rate was as high as 63.32% during the day, which was significantly higher than that at night (37.70%) (P < 0.05). The copulation time of the SG was similar to that of the NSG. However, the durations of the pre-copulatory guarding period and post-copulatory guarding period of the SG were shorter than those of the NSG, indicating that the presence of shelters could shorten the total mating duration of P. trituberculatus. P. trituberculatus provided with shelter did not hinder its mating behavior, and there was little difference in mating rate between NSG and SG, which were 100% and 97.22%, respectively. In addition, we found that there was certain cannibalism during the reproductive moulting of female crabs, which could lead to the death or injury of some individuals. However, the survival rate of the SG (89.58%) was significantly higher than that of the NSG (72.92%) (P < 0.05). Moreover, the injury rate in the SG was only 14.13%, which was significantly lower than that in the NSG (31.31%) (P < 0.05). In general, shelters have the capability of appealing to P. trituberculatus during mating and can effectively reduce the incidence of intraspecific cannibalism during mating and improve the survival rate of P. trituberculatus.