Publish an App Built with Codex
Table of Contents
- From “Codex Built It” to a Live Link
- What You Need
- 1. Ask Codex What the Project Needs
- 2. Build and Test Locally
- 3. Connect Codex to Your Host
- 4. Ask Codex to Deploy
- 5. Choose Who Can See It
- 6. Share the Link
- 7. Update the App and Keep the Same URL
- 8. See How Many People Opened It
- When a Static Host Is the Right Fit
- From “Codex Built It” to a Live Link
- What You Need
- 1. Ask Codex What the Project Needs
- 2. Build and Test Locally
- 3. Connect Codex to Your Host
- 4. Ask Codex to Deploy
- 5. Choose Who Can See It
- 6. Share the Link
- 7. Update the App and Keep the Same URL
- 8. See How Many People Opened It
- When a Static Host Is the Right Fit
From “Codex Built It” to a Live Link
Codex is good at building things: a static site, a small web app, a dashboard, a report, or even a browser game. The last step is always the same. The result is in a folder on your computer. You need a real URL to send to a client, a teammate, or yourself on another device.
This guide shows the shortest path from “Codex just built it” to “here is the live link”. It uses a static host (a host that serves only files) such as Netlify, Cloudflare Pages or Vercel. The guide shows how to find out what the project needs and how to let Codex deploy it. It also shows how to protect a private demo and how to update the app at the same URL.
What You Need
You need Codex in the terminal, your editor or the desktop app. The project must produce a folder with index.html at the root, or a framework build output such as dist/, build/ or out/.
You also need an account on one host. Netlify, Cloudflare (for Pages) and Vercel all deploy static folders from the command line.
This is a typical Codex output folder:
codex-dashboard/
index.html
styles.css
app.js
data/metrics.csv
assets/chart.webp
1. Ask Codex What the Project Needs
Before you choose a host, ask Codex to describe the project:
Tell me how this project builds, which folder holds the production output, which environment variables it reads, and whether anything needs a server at runtime.
The answer tells you where the project can go:
| What Codex built | What it needs | Where to deploy |
|---|---|---|
| Static site, report, dashboard that reads a bundled CSV, browser game | Only files | Any static host |
| Single-page app with client-side routes | Files plus a fallback to index.html |
Any static host, with one routing rule |
| App with a few API routes (a form handler, a proxy to an API) | Small server-side functions | Netlify Functions, Cloudflare Pages Functions or Vercel Functions |
| App with a long-running server process or its own database | A server runtime | An app platform such as Railway, or a VPS (a rented virtual server) |
A single-page app needs one routing rule on the host. Cloudflare Pages treats a project without a top-level 404.html as a single-page app. For unknown paths, it serves the root. On Netlify, add a _redirects file with this rewrite rule to the output folder:
/* /index.html 200
2. Build and Test Locally
Ask Codex to run the production build and list the output folder. Before anything goes online, make sure that:
- The site works from the output folder. Open the built site through a local server, not the development server. Click every route.
- The output contains no secrets. Search the output for API keys, tokens and
.envvalues. Every visitor can read anything in a static folder. - No local references remain. After upload, links to
localhostor to absolute paths on your computer break. Private test data in the folder becomes public.
A short prompt does most of this:
Run the production build, then search the output folder for API keys, tokens, localhost URLs and absolute file paths. Show me anything you find before we deploy.
3. Connect Codex to Your Host
Codex can deploy in two ways.
The first way uses the CLI of the host. Codex runs the same commands that you run yourself. Install the CLI. Sign in once yourself, in your own terminal, so that no password or token goes through the chat:
netlify login
npx wrangler login
vercel login
A sandbox is the limited environment where Codex runs commands. The default workspace-write sandbox of Codex keeps network access off. Codex asks for approval before it runs commands that need the network. A deploy needs the network, so approve it when Codex asks.
The second way uses an MCP server. Netlify and Vercel publish official MCP servers that Codex can use:
codex mcp add netlify --url https://netlify-mcp.netlify.app/mcp
codex mcp add vercel --url https://mcp.vercel.com
Codex opens the browser so that you can authorize the connection. The guide on letting an AI agent deploy a website shows the MCP setup and a first test in detail.
4. Ask Codex to Deploy
Ask for a preview (a test copy with its own URL) first. After you look at it, ask for production, the main public address. These prompts work well:
- “Build the project and deploy the
distfolder to Netlify as a draft withnetlify deploy --dir=dist. Give me the draft URL.” - “Deploy the
outfolder to a new Cloudflare Pages project called codex-dashboard with Wrangler and give me the URL.” - “Deploy this project to Vercel with the Vercel CLI and give me the deployment URL.”
These prompts run a few commands:
netlify deploy --dir=dist
npx wrangler pages deploy out
vercel
netlify deploy without --prod creates a draft deploy. A plain wrangler pages deploy goes to production. To deploy a preview instead, add --branch=<name>. The first vercel deployment of a new project is a production deployment. Later deployments are previews until you add --prod. When the preview looks right, ask Codex to deploy to production (netlify deploy --dir=dist --prod or vercel --prod).
5. Choose Who Can See It
Anyone with the URL can open a new deployment. For a client demo or an unreleased tool, add a gate (a password or sign-in step) at the host:
- On Netlify, you can use a shared password. It is available on Pro and Enterprise plans, not on Free or Personal. See password protecting a Netlify site.
- On Vercel, Password Protection gives you a shared password. It is available on Pro (as a paid option for each project) and Enterprise. Vercel Authentication works on all plans. But viewers need a Vercel account with access, or a shareable link from you. See password protecting a Vercel deployment.
- On Cloudflare Pages, use Cloudflare Access with the One-time PIN method. Access sends each visitor a code by email. It lets in only the addresses or company domain that you list. See Cloudflare Pages password protection.
For each option, make sure that the gate protects the production address and not only previews. Each of these hosts has a setting that protects only previews. Then open the link in a private window. Make sure that the gate appears.
6. Share the Link
You get a stable address on the domain of the host, such as <project>.netlify.app, <project>.pages.dev or <project>.vercel.app. Later, you can connect your own domain in the domain settings of the host. Send that link, not a zip file. The link opens in any browser, on any device. The other person does not need to install anything.
7. Update the App and Keep the Same URL
When the app changes, ask Codex to deploy to the same project, not a new one:
Update the pricing in the dashboard, rebuild, and deploy to the existing Cloudflare Pages project codex-dashboard. Do not create a new project. Confirm the URL is unchanged.
The CLIs make this easy. Wrangler stores the project name after the first deployment. The Vercel CLI links the folder to its project in a .vercel directory. With Netlify, pass the project name with --site. Because the URL stays the same, every link that you already shared shows the new version.
Keep the source in git as well. If an update breaks something, you can rebuild an earlier commit and deploy it again.
8. See How Many People Opened It
Static hosts report traffic as totals. Cloudflare Web Analytics (in the Pages project, Metrics > Enable) and Vercel Web Analytics show traffic totals. They do not identify individual visitors. If the demo is behind Cloudflare Access, the Access authentication logs also show which email signed in and when. To see the page activity of each person on a shared proposal or report, read website link tracking for client work.
When a Static Host Is the Right Fit
A static host publishes the files that Codex produces. It is the short path when the output is one of these:
- A static site, landing page or microsite.
- A frontend app, dashboard or interactive chart.
- A report, prototype or browser game.
- A folder of HTML, Markdown, CSV, PDF and assets.
Some projects need an always-on backend: a server process, a database, a custom runtime or more server-side APIs than a few functions. Deploy these projects on an app platform or a VPS instead. For a plain folder on your own server, see publishing a static folder on a VPS with Caddy. For most “Codex built me a thing, let me share it” moments, the built files are all you need to publish.
A docs portal with Ask AI
and support tickets
Connect a repository, or describe your product to start. Each docs site has search, Ask AI, an API console, an MCP server and support tickets.
- Publishes from GitHub on every push
- Works with Mintlify repositories
- API console from your OpenAPI file
- MCP server and llms.txt for AI agents
- Ask AI and support tickets
- Analytics for people and AI agents
Related Articles

Add a Custom Domain to a Cloudflare Pages Site
Add a custom domain or www to a Cloudflare Pages site: set it up in Pages first, add the DNS record, fix stuck verification and redirect www.

What Is localhost:3000?
Your browser uses localhost:3000 to reach an app running on your own computer. Sending that address to someone else does not give them access to your app.

Move Exported Grok Website Files to Another Host
Export a Grok Build site to GitHub, deploy it on Cloudflare Pages, Netlify, Vercel or GitHub Pages, test it, then retire the grok.me copy.