Shanghai, as an international metropolis, is embracing an ever-growing population and ongoing economic development, the pressure on the natural resources and the environment is continually increased. How to ease the tension among economy, resources and the environment? The sustainable green development of Shanghai has been the focus of the public and the government. Urban carrying capacity involves complex interactions among population, economy, resources and environment. Understanding how the balance among various elements is an important scientific question for sustainable green development in Shanghai. For this purpose, the balance between urban development and ecological resources was emphasized, and population carrying capacity, GDP, green ecological index and added value of secondary industry were introduced to measure urban carrying capacity. Here, the dynamic changes of the carrying population, GDP, green ecological index and the added value of the secondary industry in Shanghai during 2018-2035 were simulated using a system dynamics model including four subsystems and 65 variables from a macroscopic perspective. Five development scenarios have been employed during the simulation namely status-quo scenario, economic-centric scenario, high-tech-centric scenario, environment-centric scenario and coordinated equilibrium scenario. The simulation results indicated that the potential of carrying population will decline by 2035, and the economic and ecological indicators will also be at the low level under the status-quo scenario, which is an inferior option. While Under coordinated equilibrium scenario, the ecological environment, population growth and economic development all perform excellently, which is the best option. Therefore, the urban carrying capacity of population-economy-resources in Shanghai may be improved by increasing the investment in scientific research, rising the expenditure on environmental protection and improving the recycling efficiency of waste solid and water. The results provide insights into the urban carrying capacity of Shanghai city.