Polyhydroxybutyrate (PHB) is a biodegradable biopolymer which is useful for various applications including packing, medical and coating materials. An endospore-forming bacterium (strain BP17) was isolated from composted soil and evaluated for PHB production. Strain BP17, taxonomically identified as Bacillus drentensis, showed enhanced PHB accumulation and was selected for further studies. To achieve maximum PHB production, the culture conditions for B. drentensis BP17 were optimized through response surface methodology (RSM) employing central composite rotatable design (CCRD). The final optimum fermentation conditions included: pineapple peel solution, 11.5% (v/v); tryptic soy broth (TSB), 60 g/L; pH, 6.0; inoculum size, 10% (v/v) and temperature, 28°C for 36 h. This optimization yielded 5.55 g/L of PHB compared to the non-optimized condition (0.17 g/L). PHB accumulated by B. drentensis BP17 had a polydispersity value of 1.59 and an average molecular weight of 1.15x105 Da. Thermal analyses revealed that PHB existed as a thermally stable semi-crystalline polymer, exhibiting a thermal degradation temperature of 228°C, a melting temperature of 172°C and an apparent melting enthalpy of fusion of 83.69 J/g. It is evident that B. drentensis strain BP17 is a promising bacterium candidate for PHB production using agricultural waste, such as pineapple peel as a low-cost alternative carbon source for PHB production.