After growing up in Georgia, Stalin conducted discreet activities for the Bolshevik Party for twelve years before the Russian Revolution of 1917. Following the October Revolution, Stalin took military positions in the Russian Civil War and the Polish-Soviet War. Stalin was one of the Bolsheviks' chief operatives in the Caucasus and grew close to Lenin, who saw him as a tough character, and a loyal follower capable of getting things done behind the scenes. Stalin played a decisive role in engineering the 1921 Red Army invasion of Georgia, adopting a particularly hardline approach to opposition. Stalin's connections helped him to gain influential positions behind the scenes in the new Soviet government, eventually being appointed General Secretary in 1922. In 1922, a stroke forced Lenin into semi-retirement, while Lenin grew critical of Stalin in late 1922 and early 1923, recommending Stalin's dismissal from the post of General Secretary. However, a very debilitating stroke in March 1923 ended Lenin's political career. In the years following, opponents of Stalin, most notably Leon Trotsky, became isolated politically and were sidelined from the government by Stalin. Eventually, this led Stalin to become the uncontested highest leader of the Party and the Soviet Union.
Before his 1913-1917 exile in Siberia, Stalin was one of the Bolshevik operatives in the Caucasus, organising cells, spreading propaganda, and raising money through criminal activities. Stalin eventually earned a place in Lenin's inner circle and the highest echelons of the Bolshevik hierarchy. His pseudonym, Stalin, means "man of the steel hand". The October Revolution took place in the Russian capital of Petrograd on 7 November 1917 (O.S. 25 October 1917), which saw the transfer of all political power to the Soviets.
In the Russian Civil War that followed, Stalin forged connections with various Red Army generals and eventually acquired military powers of his own. He brutally suppressed counter-revolutionaries and bandits. After winning the civil war, the Bolsheviks moved to expand the revolution into Europe, starting with Poland, which was fighting the Red Army in Ukraine. As joint commander of an army in Ukraine and later in Poland itself, Stalin's actions in the war were later criticized by many, including Leon Trotsky.
In late 1920, with the crises in society following the Russian Civil War, Trotsky argued for the trade unions to be incorporated more and more into the workers' state, and for the workers' state to completely control the industrial sectors. Lenin's position was one where the trade unions were subordinate to the workers' state, but separate, with Lenin accusing Trotsky of "bureaucratically nagging the trade unions". Fearing a backlash from the trade unions, Lenin asked Stalin to build a support base in the Workers' and Peasants' Inspectorate (Rabkrin) against bureaucratism. Lenin's faction eventually prevailed at the Tenth Party Congress in March 1921. Frustrated by the squabbling factions within the Communist Party during what he saw as a time of crisis, Lenin convinced the Tenth Congress to pass a ban on any opposition to official Central Committee policy (the Ban on Factions, a law which Stalin would later exploit to expel his enemies).
Stalin played a decisive role in engineering the Red Army invasion of Georgia in February and March 1921, at a time when Georgia was the biggest Menshevik stronghold. Following the invasion, Stalin adopted particularly hardline, centralist policies towards Soviet Georgia, which included severe repression of opposition to the Bolsheviks, and to opposition within the local Communist Party (e.g., the Georgian Affair of 1922), not to mention any manifestations of anti-Sovietism (the August Uprising of 1924). It was in the Georgian affairs that Stalin first began to play his own hand. Lenin, however, disliked Stalin's policy towards Georgia, as he believed that all Soviet states should be on equal standing with Russia, rather than be absorbed and subordinated to Russia.