Topological electronic phases exist in a variety of naturally occurring materials but can also be created artificially. We used a cryogenic scanning tunneling microscope to create dimerized chains of identical quantum dots on a semiconductor surface and to demonstrate that these chains give rise to one-dimensional topological phases. The dots were assembled from charged adatoms, creating a confining potential with single-atom precision acting on electrons in surface states of the semiconductor. Coupling between the dots leads to electronic states localized at the ends of the chains, as well as at deliberately created internal domain walls, in agreement with the predictions of the Su-Schrieffer-Heeger model. Scanning tunneling spectroscopy also reveals deviations from this well-established model manifested in an asymmetric level spectrum and energy shifts of the boundary states. The deviations arise because the dots are charged and hence lead to an onsite potential that varies along the chain. We show that this variation can be mitigated by electrostatic gating using auxiliary charged adatoms, enabling fine-tuning of the boundary states and control of their superposition. The experimental data, which are complemented by theoretical modeling of the potential and the resulting eigenstates, reveal the important role of electrostatics in these engineered quantum structures.