Upon his release, he worked as a casual laborer and became active in the agricultural workers' union as well as in the Social Democratic Party of Hungary from the early 1920s.
By the end of World War II he had become a leading member of the Smallholders Party, which achieved a majority in the 1945 general elections.
As a leading member of the Smallholders' left wing, Dobi contributed some much needed legitimacy to a government that was increasingly dominated by Communists.
After several splits and the expulsion, arrest or exile of anti-communist members ("salami tactics"), Dobi was elected chairman of the Smallholders Party in June 1947.
One of the first acts of the newly elected National Assembly was to approve a Soviet-style constitution, formally marking the onset of total Communist rule in Hungary.
While the presidency was largely a ceremonial post, he took on numerous other high-profile roles to eventually become the second or third most powerful man in Hungary.