Communism as a distinct political and economic doctrine started to take shape in the 1840s. The term "communism" itself did not come into use until that time, but ideas resembling communism date back much earlier, including as far back as the 4th century BCE with Plato's writings on an ideal society. Modern communism is most widely associated with Karl Marx and Friedrich Engels, who outlined its principles in "The Communist Manifesto" published in 1848. Marx's communism was motivated by responses to the social inequalities of the Industrial Revolution. While earlier societies and thinkers had versions of communal living or shared property, communism as a revolutionary ideology aimed at abolishing private property and creating a classless society solidified in the mid-19th century.
In summary, communism in its contemporary form began around the 1840s-1848 with Marx and Engels. However, ideas related to communism existed in various forms for millennia before that time.