Growing cannabis in small places

Cannabis is a remarkable plant, it can be grown in a wide range of conditions and in a large number of different substrates from natural soil to synthetic materials.  It can be grown indoors, outdoors, in a greenhouse or polytunnel. But what about people with hardly any free space, how can cannabis be grown in very small places?