This work presents an approach for both distributed synthesis and control for a network of discrete-time constrained linear systems without central coordinator. Every system in the network is dynamically coupled to a number of neighboring systems and it is assumed that communication among neighbors is possible. A model predictive controller based on distributed optimization is introduced, by which every system in the network can compute feasible and stabilizing control inputs online. Stability of the closed-loop network of systems is guaranteed by introducing local terminal cost functions and sets, which together satisfy invariance conditions in a distributed way. This includes in particular that the local terminal sets are not static but evolve over time. It is shown that synthesis of both quadratic terminal cost functions and corresponding terminal sets can be done by distributed optimization. Finally, closed-loop performance of the proposed controller is demonstrated on a coupled array of inverted pendulums.