We compute the three-loop corrections to the potential of two heavy quarks. In particular we consider in this Letter the purely gluonic contribution which provides in combination with the fermion corrections of Ref. \cite{Smirnov:2008pn} the complete answer at three loops.