The accurate ground-state potential energy function of the beryllium dimer, Be(2), has been determined from large-scale ab initio calculations using the single-reference coupled-cluster approach in conjunction with the correlation-consistent core-valence basis sets up to septuple-zeta quality. Results obtained with the conventional and explicitly-correlated coupled-cluster methods were compared. The scalar relativistic and adiabatic (the diagonal correction) effects were also discussed. The vibration-rotation energy levels of Be(2) were predicted and found to be as accurate as those determined from the empirical potential energy function [J. M. Merritt et al., Science, 2009, 324, 1548]. The potential energy function of Be(2) was determined in this study to have a minimum at 2.444 angstrom and the well depth of 935 cm(-1).