We study a shape optimization problem involving a solid $$K\subset {\mathbb {R}}^n$$
K
⊂
R
n
that is maintained at constant temperature and is enveloped by a layer of insulating material $$\Omega $$
Ω
which obeys a generalized boundary heat transfer law. We minimize the energy of such configurations among all $$(K,\Omega )$$
(
K
,
Ω
)
with prescribed measure for K and $$\Omega $$
Ω
, and no topological or geometrical constraints. In the convection case (corresponding to Robin boundary conditions on $$\partial \Omega $$
∂
Ω
) we obtain a full description of minimizers, while for general heat transfer conditions, we prove the existence and regularity of solutions and give a partial description of minimizers.