It was the German Marx who first published the Communist Manifesto during the 19th century. This book inspired various Marxist groups both inside and outside of Germany. However, left-wing politics did not really take off in Germany until Bismark resigned in the late 19th century, who had previously banned German socialist parties.
Bismarck was a Prussian aristocrat weary of the rise of socialism. As such, there was little scope for communist parties and Marxist groups in Germany during this period. In fact, even after Bismarck resigned Marxist groups in Germany did not emerge at the beginning of the 20th century. However, the German Socialist Party, the SPD, gained lots of support before the outbreak of the war. They were one of the biggest parties in the Reichstag by 1914.
During the war that followed, Germany’s defeats eroded support for its monarchy. German troops were surrendering in number to the Entente by 1918, and calls for an end to the war and Wilhelm 2nd's abdication became louder in Germany. The Entente also made it clear that they were not prepared to accept an armistice unless Wilhelm 2nd abdicated the throne. So Wilhelm 2nd did abdicate, and German delegates met with the Entente to discuss an armistice at Foch’s carriage. The war ended on November 11, 1918.
The removal of the German monarchy was followed by the drafting of a new charter for the Weimar Republic. The SPD were the most influential party in the Weimar Republic, but the new Reichstag had many parties including the KPD, which was the German Communist Party. Partly inspired by Lenin and the Bolsheviks in Russia, KPD activists Rosa Luxembourg and Liebknecht attempted a similar coup in 1919, the Spartacus uprising. This coup failed, and neither Luxembourg of Liebknecht survived.
However, the KPD remained in the Reichstag and campaigned in the various Weimar Republic elections. The KPD gradually gained an increasing amount of support in Germany during the 1920s. By the end of the 1920s they had gained a number of seats in the Reichstag. At the beginning of the 1930s they were the biggest communist party in Europe, and as support for the Weimar Republic declined the likelihood of the KPD winning an election increased markedly.
Two factors prevented a communist regime emerging in Germany during the early 1930s. The first was that they could not establish a united front with the SPD to defeat fascism. In addition, the Reichstag fire in 1933 was also blamed on the communists. It was the communist Van Der Lubbe that burnt the Reichstag, although debate has remained whether Van Der Lubbe did it alone. However, the Nazi Party blamed communists generally; and the left-wing parties disappeared from Germany entirely as the Nazis consolidated.
For the remainder of the decade the only chance of a communist revival in Germany would likely come from war. Tensions between Germany and the USSR remained, and the Treaty of Versailles was gradually overturned. In 1938, German troops occupied Czechoslovakia and war in Europe seemed likely.
However, Germany and the USSR established the Nazi-Soviet Pact with the USSR promising neutrality if the German army advanced into Poland. In 1939, war began as German soldiers occupied Poland; although the Soviets remained neutral until 1941.
The war in the East did not begin well for the USSR, as the Germans advanced further into Russia. The Russian winter and Soviet reinforcements stabilized the front in late 1941. However, a renewed German advance into southern Russia in 1942 put the oil fields of the Caucasus within reach. The Russians held out and encircled the German army at Stalingrad, and in 1943 the Red Army advanced westwards. By 1945, the Red Army occupied much of Eastern Europe and advanced into east Germany and Berlin. Germany then surrendered to the Allies.
At Potsdam Germany was divided into various occupation zones, including the Russian zone in East Germany that included Berlin. The USSR established the GDR (German Democratic Republic) communist regime in 1949. A new communist regime had revived communism in Germany. However, many Germans fled the GDR and emigrated to western Germany, which prospered during the 1950s.
As emigration continued in the 1960s, the GDR established a wall in Berlin. The Berlin Wall emerged during the 1960s, and remained in place for much of the Cold War. Only in 1989, when communist regimes began to fall in the Eastern Bloc, would the Berlin Wall crumble. Without the support of the Russian army, the GDR consented to the opening of the Berlin Wall. Consequently, east Germans began to cross into West Berlin; and the wall was gradually demolished.
This marked the end of the GDR, and paved the way for German unification in the 1990s. In 1990, Germany united and the GDR was history. Communism in Germany declined, and since unification a number of left-wing groups have dissolved. However, in 2007 The Left party was established as a successor to the KPD; and today is one of the larger parties in the Reichstag.
It was the Russian army and Communist Party of the Soviet Union that really established a communist regime in Germany in the postwar era. No communist party has ever really been elected by the Germans, but the KPD gained an increasing amount of support in the early 1930s. Since German unification there has been little sign that this could change, except perhaps the rise of The Left party, which is the largest left-wing party in Germany.