Adequate treatment of pain arising from spinal surgery is a major clinical challenge. Opioids are the mainstay of current treatment methods, but the frequency and severity of their side effects display a clear need for opioid-free analgesia. Local anesthetics have been encapsulated into sustained-release drug delivery systems to provide postoperative pain relief. However, these formulations are limited by rapid diffusion out of the surgical site. To overcome this limitation, we synthesized ring-shaped hydrogels incorporating bupivacaine, designed to be co-implanted with pedicle screws during spinal surgery. Hydrogels were prepared by riboflavin-mediated crosslinking of gelatin functionalized with tyramine moieties. Additionally, oxidized β-cyclodextrin was introduced into the hydrogel formulation to form dynamic bonds with tyramine functionalities, which enables self-healing behavior and resistance to shear. Feasibility of hydrogel implantation combined with pedicle screws was qualitatively assessed in cadaveric sheep as a model for instrumented spinal surgery. The in-situ crystallization of bupivacaine within the hydrogel matrix provided a moderate burst decrease and sustained release that exceeded 72 hours in vitro. The use of bupivacaine crystals decreased drug-induced cytotoxicity in vitro compared to bupivacaine HCl. Thus, the presented robust hydrogel formulation provides promising properties to enable the stationary release of non-opioid analgesics following spinal surgery. STATEMENT OF SIGNIFICANCE: Currently, postoperative pain following spinal surgery is mainly treated with opioids. However, the use of opioids is associated with several side effects including addiction. Here we developed robust and cytocompatible gelatin hydrogels, prepared via riboflavin-mediated photocrosslinking, that can withstand orthopedic implantation. The implantability was confirmed in cadaveric instrumented spinal surgery. Further, hydrogels were loaded with bupivacaine crystals to provide sustained release beyond 72 hours in vitro. The use of crystallized bupivacaine decreased cytotoxicity compared to bupivacaine HCl. The present formulation can aid in enabling opioid-free analgesia following instrumented spinal surgery.