The Scottish U21 national team player joins from Aberdeen where there were 39 appearances, of which nine assists and one goal.
“It’s a dream to be here,” the right-back said in a comment.
Ramsay is Liverpool’s third new acquisition of the summer. Previously, the club has recruited Darwin Nuñez and Fábio Carvalho.