The physical properties of two-dimensional van der Waals (2D vdW) crystals depend sensitively on the interlayer coupling, which is intimately connected to the stacking arrangement and the interlayer spacing. For example, simply changing the twist angle between graphene layers can induce a variety of correlated electronic phases, which can be controlled further in a continuous manner by applying hydrostatic pressure to decrease the interlayer spacing. In the recently discovered 2D magnets, theory suggests that the interlayer exchange coupling strongly depends on layer separation, while the stacking arrangement can even change the sign of the magnetic exchange, thus drastically modifying the ground state. Here, we demonstrate pressure tuning of magnetic order in the 2D magnet CrI3. We probe the magnetic states using tunneling and scanning magnetic circular dichroism microscopy measurements. We find that the interlayer magnetic coupling can be more than doubled by hydrostatic pressure. In bilayer CrI3, pressure induces a transition from layered antiferromagnetic to ferromagnetic phases. In trilayer CrI3, pressure can create coexisting domains of three phases, one ferromagnetic and two distinct antiferromagnetic. The observed changes in magnetic order can be explained by changes in the stacking arrangement. Such coupling between stacking order and magnetism provides ample opportunities for designer magnetic phases and functionalities.