Linear scaling methods for density-functional theory (DFT) simulations are formulated in terms of localized orbitals in real space, rather than the delocalized eigenstates of conventional approaches. In local-orbital methods, relative to conventional DFT, desirable properties can be lost to some extent, such as the translational invariance of the total energy of a system with respect to small displacements and the smoothness of the potential-energy surface. This has repercussions for calculating accurate ionic forces and geometries. In this work we present results from onetep, our linear scaling method based on localized orbitals in real space. The use of psinc functions for the underlying basis set and on-the-fly optimization of the localized orbitals results in smooth potential-energy surfaces that are consistent with ionic forces calculated using the Hellmann-Feynman theorem. This enables accurate geometry optimization to be performed. Results for surface reconstructions in silicon are presented, along with three example systems demonstrating the performance of a quasi-Newton geometry optimization algorithm: an organic zwitterion, a point defect in an ionic crystal, and a semiconductor nanostructure.<br/