On 11th november 1918, just two days after the kaiser had abdicated, matthias erzberger, representing the government of the new republic, signed the armistice an agreement to stop fighting
In truth, there was little alternative. By November 1918, Germany was torn apart by social and political unrest and its money and troops were running out.
On the battlefield, the entry of two million US troops into the war in 1917 had made the allies much stronger.
From august 1918, the German army was in retreat and it's defensive fortification, the Hindenburg line, had been breached.
Beginning the new republic with a surrender was not a strong start