The invention relates to a panel for constructing a floor or wall covering. The panel comprises a substantially planar top surface, at least one core layer composed of a composite material which core layer is provided with the cavities, and a bottom surface. The panel further comprises at least one pair of opposite edges, said pair of opposite edges preferably comprising complementary coupling parts configured for mutual coupling of adjacent panels.