Introduction: In 2017 the drug chenodeoxycholic acid (CDCA) became unavailable to Dutch patients with the rare inborn error of metabolism cerebrotendinous xanthomatosis (CTX). This was a direct result of a steep price increase after CDCA was authorized in the EU as an orphan drug. As a result, Dutch health insurance companies were unable to reimburse this drug and the availability of CDCA to patients with CTX was directly at risk creating an unmet medical need. CTX is characterized by juvenile cataract, tendon xanthomas, infantile-onset diarrhea, psychomotor retardation and progressive cerebellar ataxia. Treatment with CDCA, when initiated before neurological symptoms are present, can prevent the onset of neurological complications. Methods: To assure continuation of patient treatment with a high quality product, the hospital pharmacy of the Amsterdam UMC developed CDCA capsules as a pharmacy preparation. A simple and robust formulation was developed for capsules in a broad dose range of 35-250mg, ensuring that both pediatric and adult patients can receive an exact dose tailored to their specific needs. Capsules are prepared manually on a small scale for the individual patient. To assure the quality of the product, product validation and stability studies were performed. Results: The results show that the product complies with all specifications based on the requirements of the European Pharmacopoeia. The capsules contain the declared amount of CDCA, no degradation product or other (microbiological) impurities are formed during the production process and the capsules show a quick dissolution profile. Stability studies indicate that it is a stable product and no impurities increase or arise over time. These results show that these pharmacy preparations are of high quality and comply to Good Manufacturing Practice (GMP) requirements. Discussion: Through our research, we have demonstrated that pharmacy compounding can be a viable alternative in situations where immediate access to essential medication is crucial or when certain drugs are temporarily inaccessible. The purpose of this paper is to offer comprehensive guidance to other pharmacies to improve the availability of currently inaccessible drugs through the practice of pharmacy compounding, thereby facilitating improved patient care.