Foreign traders (primarliy British) had been illegally exporting opium from India to China since the 18th century
The trade grew dramatically from about 1820. The resulting widespread addiction in China was creating social and economic disruption there.
In March 1839 the Chineses government confiscated and destroyed more than 20,000 chests of opium-some 1,400 tones of drugs-that were warehoused at Canton (Guangzhou) by British merchants.
The British government deceided in early 1840 to send an expeditionary force to China, Which arrived at Hong Kong in June, and the war began.
British fleet proceeded up the Pearl River estuary to Canton, and fater months of negotiations there, they attacked and occupied the city in May 1841.
The British held against that ooffensive however, captured Nanjing (Nanking) in late August, which put an end to the fighting. Peace negotiations proceeded quickly, resulting in the Treaty of Nanjing signed, on August 29.