In order to enhance the level of green and sustainable development of the economy, the national policy of ecological civilization construction is proposed. The 14 coastal ports with the top 20 container throughput in China in 2020 are taken as the research objects, and the environmental efficiency evaluation index system of ports is constructed by combining the requirements put forward by ecological civilization, and the three-stage SBM model is applied to measure the environmental efficiency of 14 coastal ports in China from 2012 to 2020. It was found that the overall green development of Chinese coastal ports was good, with half of the ports achieving effective environmental efficiency with a mean value of 0.804 and a large gap in environmental efficiency levels among ports. External environmental variables have significant effects on the environmental efficiency of ports, and the overall environmental efficiency of ports with ineffective environmental efficiency has improved after excluding the effects of external environmental variables and random errors. Therefore, for ports with ineffective environmental efficiency, policy-related contents should be implemented effectively according to the actual situation of the port, and the environmental efficiency of the port should be improved from the perspective of the change and development of the port hinterland city, combining three aspects of local economic conditions, policy environment and cultural awareness.