We use the variational method within the Hamiltonian formalism of QFT to derive relativistic two-, three- and four-body wave equations for scalar particles interacting via a massive or massless mediating scalar field (the scalar Yukawa model). The Lagrangian of the theory is reformulated by using Green's functions to express the mediating field in terms of the particle fields. The QFT is then constructed from the resulting reformulated Hamiltonian. Simple Fock-space variational trial states are used to derive relativistic two-, three- and four-body equations. The equations are shown to have the Schrödinger non-relativistic limit, with Coulombic interparticle potentials in the case of a massless mediating field and Yukawa interparticle potentials in the case of a massive mediating field. Ground-state solutions of the relativistic equations are obtained approximately for various strengths of coupling, for both massive and massless mediating fields, and a comparison of the two-, three- and four-particle binding energies is presented.