A method for conversion of polyethylene terephthalate (PET) waste into cobalt-carbon nanocomposites is proposed. The main feature of the procedure is the simultaneous formation of highly porous PET-derived carbon support and cobalt nanoparticles. Pyrolysis of a joint precursor obtained by mixing the three main components (PET, cobalt nitrate and KOH) in dimethyl sulfoxide results in the formation of a metal-carbon nanocomposite. The effect of the amount of KOH introduced on the structural properties of nanocomposites has been studied. It was shown that the weight ratio of PET:KOH affects both the porous characteristics of the material and the size of the cobalt nanoparticles. Also, the amount of alkali affects the yield of nanocomposite, both the yield of carbon residue, increasing it from 11.6 to 20.7 wt%, and the content of metal in the composite, which was in the range of 18.5–28.4 wt%.