[{"data":1,"prerenderedAt":89},["ShallowReactive",2],{"blog-list":3},[4],{"id":5,"title":6,"body":7,"date":79,"description":80,"extension":81,"meta":82,"navigation":83,"path":84,"seo":85,"stem":86,"tag":87,"__hash__":88},"blog\u002Fblog\u002F2026-06-17-nitro-on-bun.md","Why we run Nitro on Bun in production",{"type":8,"value":9,"toc":72},"minimark",[10,14,27,32,44,59,63,66],[11,12,6],"h1",{"id":13},"why-we-run-nitro-on-bun-in-production",[15,16,17,18,22,23,26],"p",{},"AiChat's server runs on Bun in production — ",[19,20,21],"code",{},"nitro.preset: 'bun'",", so the process is\n",[19,24,25],{},"Bun.serve",". The interesting part wasn't the runtime. It was the build.",[28,29,31],"h2",{"id":30},"the-build-doesnt-run-on-bun-on-purpose","The build doesn't run on Bun — on purpose",[15,33,34,35,39,40,43],{},"The Nitro server bundle (Rollup) is a known Nuxt memory hog — it peaks around 7.5 GB\nregardless of runtime. DigitalOcean App Platform ",[36,37,38],"strong",{},"hard-caps every build at 8 GB",",\nun-raisable. Node's ",[19,41,42],{},"--max-old-space-size"," throttles the build heap so it fits under\nthat cap; Bun's JS engine has no equivalent throttle, peaks higher, and risks an\nexit-137 OOM on the builder.",[15,45,46,47,51,52,55,56,58],{},"So the Dockerfile builds on Node and runs on Bun. The build ",[48,49,50],"em",{},"engine"," doesn't change\nthe artifact — ",[19,53,54],{},"preset: 'bun'"," emits the same ",[19,57,25],{}," output either way — so the\nproduction server is still 100% Bun.",[28,60,62],{"id":61},"the-lesson","The lesson",[15,64,65],{},"\"Full Bun\" is a runtime decision, not a build one. Match the tool to the constraint:\nBun where it wins (the server), Node where the platform forces your hand (a memory-\ncapped builder). The user never sees the difference.",[67,68,69],"callout",{},[15,70,71],{},"If we ever outgrow the 8 GB build cap, the escape hatch is building the image in CI\nand deploying from a registry — which sidesteps the cap entirely.",{"title":73,"searchDepth":74,"depth":74,"links":75},"",3,[76,78],{"id":30,"depth":77,"text":31},2,{"id":61,"depth":77,"text":62},"2026-06-17","Identical artifact, a Bun runtime, and a build cap that forced an honest decision.","md",{},true,"\u002Fblog\u002F2026-06-17-nitro-on-bun",{"title":6,"description":80},"blog\u002F2026-06-17-nitro-on-bun","Infra","sbsBfThN8l8oUJx_Nwoz1VE1K5foFPBENt3ntbr7sQM",1781793790900]