In this article we for the first time present a fully synthetic mesoporous geopolymer drug carrier for controlled release of opioids. Nanoparticulate precursor powders with different Al/Si-ratios were synthesized by a sol-gel route and used in the preparation of different geopolymers, which could be structurally tailored by adjusting the Al/Si-ratio and the curing temperatures. In particular, it was shown that the pore sizes of the geopolymers decreased with increasing Al/Si ratio and that completely mesoporous geopolymers could be produced from precursor particles with the Al/Si ratio 2:1. The mesoporosity was shown to be associated with a sustained and linear in vitro release profile of the opioid oxycodone. A clinically relevant release period of about 12 h was obtained by adjusting the size of the pellets. The easily fabricated and tunable geopolymers presented in this study constitute a novel approach in the development of controlled release formulations, not only for opioids, but whenever the clinical indication is best treated with a constant supply of drugs and when the mechanical stability of the delivery vehicle is crucial.