We discuss photo- and leptoproduction of J/psi mesons at energies ranging from those of fixed-target experiments up to those of HERA. Elastic and diffractive production as well as various inelastic processes are studied. We investigate the range in which J/psi production is described by photon-gluon fusion in the color-singlet model. We show how inelastic J/psi production at HERA can be used to extract the gluon density. We estimate an accessible range of 3 X 10(-4) < x < 0.1 and discuss sources of errors in the reconstruction of the gluon density at HERA.