Risto Ryti was born in Huittinen, Satakunta, one of seven sons. His parents were Kaarle Evert Ryti, a farmer, and Ida Vivika Junttila. Although he came from a peasant farming background, during his childhood Ryti hardly participated in work on the family's large farm, being a bookish and academically inclined boy. He was educated briefly at Pori Grammar School, and was then tutored at home, before enrolling in the University of Helsinki in 1906 to study law. Ryti was the only one of seven sons to pass the university entrance examination; however his three sisters also matriculated.
Ryti graduated in autumn 1909 as Finland was moving into the second period of Russification. Escaping an oppressive political atmosphere in the capital, Ryti returned to his roots in Satakunta, where he established himself as a lawyer in Rauma. During this period he became acquainted with Alfred Kordelin, one of Finland's richest men. Ryti became Kordelin's lawyer, and eventually the two men became close friends. During this period Ryti also undertook further studies, becoming a Master of Laws in 1912. In the spring of 1914 he moved to Oxford to study maritime law, but the outbreak of World War I forced him to return to Finland. In 1916 he married Gerda Paula Serlachius (1886–1984). They had three children, Henrik (1916-2002), Niilo (1919–1997), and Eva (1922–2009).
In the period after the outbreak of World War I, before Finland achieved its independence, Ryti's business relationship with Kordelin grew even closer, and it appeared likely that Kordelin would ask Ryti to become general manager of his numerous business enterprises. However, in November 1917 Ryti and his wife witnessed the murder of Kordelin at the hands of a Russian Bolshevik. Russian seamen led by a Finnish tailor took Kordelin's party hostage, with the intent to rob them. Ryti, Kordelin's lawyer, refused to legally authorize the robbery despite being threatened at gunpoint. Armed White Guard soldiers were however present and the situation deteriorated into a gunfight. 20 people including Kordelin were killed. Ryti was saved by a malfunction in the enemy's firearm.
During the Finnish Civil War Ryti played no active part, remaining in hiding with his family in Red-dominated Helsinki. Afterwards, however, he would become deeply involved in politics, being elected a National Progressive member of Parliament in 1919, at the age of thirty the second youngest member. In the same year, the party candidate, an admirer of Ryti, Kaarlo Juho Ståhlberg, was elected the first president of Finland. Ryti served as a member of Parliament from 1919 to 1924 and from 1927 to 1929. During his first few years in Parliament, Ryti served as chairman of the Judiciary Committee, and later the Finance Committee. He also served as a member of Helsinki City Council from 1924 to 1927.
According to the Finnish historian Martti Turtola, Ryti succeeded in politics in the first few years after the Finnish Civil War because his liberal, democratic, and republican ideals were popular then. Moreover, Ryti's personal political success continued even after his liberal-oriented National Progressive Party shrank to a fringe party, because he was considered an expert especially in economic policy and, very importantly, an impartial servant of the fatherland who refused to play partisan politics (see Martti Turtola, "Risto Ryti: A Life for the Fatherland").