A liberal in politics, in 1847 signed a protest manifesto against the brutal suppression of a riot in 1847 asking reforms to king Charles Albert of Sardinia. He was elected in the Piedmontese parliament (the Parlamento Subalpino) in 1848, defeating future prime minister Camillo Benso, Conte di Cavour. He was re-elected in 1863 and in the following legislatures, and later he became Senator of Italy (1871).
In 1848 he was a supporter of the First Italian War of Independence, while in 1864, after the Unification of Italy, he opposed to the transferring of the capital from Turin to Florence. Subsequently, he worked in favour of Rome, conquered only in 1870, as the capital of the new country. In 1867 he became vice-president of the Chamber of Deputies and, during the III Menabrea cabinet, minister of the Interior (1869).
Ferraris was mayor of Turin from January 1878 to October 1882 and held for a long period the position of provincial president. He was again Minister, this time of Justice, in the first Starabba cabinet (1891).