Metamaterials are artificially structured media with unit cells much smaller than the wavelength of light. They have proved to possess novel electromagnetic properties, such as negative magnetic permeability and negative refractive index. This enables applications such as negative refraction, superlensing and invisibility cloaking. Although the physical properties can already be demonstrated in two-dimensional (2D) metamaterials, the practical applications require 3D bulk-like structures. This prerequisite has been achieved in the gigahertz range for microwave applications owing to the ease of fabrication by simply stacking printed circuit boards. In the optical domain, such an elegant method has been the missing building block towards the realization of 3D metamaterials. Here, we present a general method to manufacture 3D optical (infrared) metamaterials using a layer-by-layer technique. Specifically, we introduce a fabrication process involving planarization, lateral alignment and stacking. We demonstrate stacked metamaterials, investigate the interaction between adjacent stacked layers and analyse the optical properties of stacked metamaterials with respect to an increasing number of layers.