Strictly speaking the war ended for Germany with the signing of the Treaty of Versailles on 28 June 1919. (That was exactly five years after Austria-Hungary's Archduke Franz Ferdinand was assassinated in Sarajevo).
At 11 a.m. on November 11, 1918 a ceasefire came into effect with Germany. A formal state of war between the two sides persisted for another seven months, until signing of the Treaty of Versailles on June 28, 1919.
A final peace treaty was signed between the Allied Powers and the country that would shortly become the Republic