Embed a live Linux CLI terminal in Mintlify
Mintlify renders standard React-flavored MDX with <Frame> containers and strict CSP rules. Using an <iframe> with referrerPolicy="origin" embeds a real linux/amd64 terminal into any Mintlify quickstart without modifying your build pipeline.
1. Add KilnVM to Mintlify
quickstart.mdx (Mintlify MDX embed)
<Frame>
<iframe
src="https://kilnvm.dev/embed?project=proj_your_project_id&theme=auto&cmd=mycli%20--help"
title="Interactive CLI Sandbox"
style={{ width: "100%", height: "420px", border: 0 }}
allow="clipboard-read; clipboard-write"
referrerPolicy="origin"
loading="lazy"
/>
</Frame>
2. Seed Files, Run Buttons & Production Tips
custom-kilnvm.js (optional script loader in Mintlify docs root)
(function () {
if (document.querySelector('script[src="https://kilnvm.dev/kilnvm-embed.js"]')) return;
var s = document.createElement("script");
s.src = "https://kilnvm.dev/kilnvm-embed.js";
s.defer = true;
document.head.appendChild(s);
})();
- Always keep referrerPolicy="origin" on the iframe so KilnVM can verify your Mintlify custom domain against Allowed Docs Origins.
- Pass &theme=auto to follow your reader's system theme, or match your Mintlify brand palette using &accent=f97316&bg=09090b.
- Place kilnvm.js at the Mintlify root if you want declarative data-kilnvm-run buttons or multi-file <div data-kilnvm-files> embeds.
3. Try a Live Sandbox Right Now
Click Launch Terminal below to boot a real non-root Linux microVM directly in the page.
Frequently Asked Questions
Does KilnVM work with custom Mintlify domains like docs.yourcompany.com?
Yes. Add https://docs.yourcompany.com (and your .mintlify.app preview domain if desired) to Allowed Docs Origins in Dashboard -> Project Settings.
Will bots or casual page scrolls consume my Mintlify docs quota?
No. External embeds use Click-to-Run and Cloudflare Turnstile by default so containers only boot when a human clicks Launch Terminal.
Ready in 5 minutes
Ship live CLI sandboxes inside your docs.
Start free with 300 sessions per month, isolated linux/amd64 microVMs, and zero credit card required.