Structures containing stacked self-assembled InAs quantum dots within a GaAs matrix are studied by cross-sectional scanning tunneling microscopy. The dots consist of an InGaAs alloy with an increasing indium concentration in the growth direction. From comparison of the lattice constant profiles of stacked and unstacked dots, it is evident that the strain in the GaAs matrix around the dots is strongly affected by the stacking process. The results show an increasing deformation of the dots in the stack and a reduced growth rate of the GaAs spacer layers, resulting in the formation of terraces on the growth surface on which new dots form. If the total structure, containing the dot layers and the spacer layers, exceeds 30 nm, the local GaAs growth rate remains constant from this point on. The InAs dot growth rate remains constant throughout the entire stack.