Independent hosting research · no paid rankings

Desk checked

Setup Basics

Learn how to deploy a website from Codex.

Published: Last checked:

Deploy a Codex website by documenting build needs, testing locally, choosing compatible hosting, connecting a domain, and verifying the live site.

Codex can generate a working website in minutes, but getting it from a local project folder to a live domain is where most deployments stall. The core judgment: the deployment path is determined by what Codex built, not by which hosting brand you prefer. A static portfolio and an app with user logins and a database need fundamentally different infrastructure, and choosing the wrong one produces errors that look mysterious but are entirely predictable.

Alma F.'s October 26, 2026 guide walks through deploying a Codex project to Hostinger, covering review, local testing, deployment methods, environment variables, domain connection, and post-launch verification. What follows is a restructured analysis of that process, with the decision points and failure modes that the step-by-step format tends to bury.

The prerequisite stack and why each piece exists

Before any deployment, five things need to be in place: the Codex-built website itself (saved locally or in a GitHub repository), Visual Studio Code as the editor, the Codex command-line interface run through the VS Code terminal, Node.js and npm for package installation and builds when the project requires them, and a hosting plan compatible with the project's framework.

That last item is where planning usually goes wrong. The guide used Hostinger Web Apps Hosting, which supports Vite projects through the Node.js web app option on the Unlimited and Cloud Startup plans. The dependency chain matters: Vite is the build tool, Node.js is the runtime option that hosting plan must offer, and the plan tier determines whether that option is available at all. Readers who pick a plan before reviewing their project's requirements risk buying capacity they don't need or, worse, capacity that can't run the app.

For anyone without a project to practice on, the guide suggests prompting Codex to create a simple one-page portfolio using Vite with a navigation menu, an image, and a button—explicitly static, with no backend, database, or login system. That constraint is deliberate. It isolates deployment mechanics from application complexity, so a failed deploy points to the pipeline rather than the code.

Step one: make Codex document its own project

The first substantive move is asking Codex to review the project it generated and produce a summary covering the framework, build command, start command, output folder, and required environment variables—saved as `deployment-notes.md` in the project folder, with an explicit instruction not to include passwords, API keys, or other secrets.

This is a documentation step, but its real function is verification. The summary tells you which files to publish and which to leave behind. Skipping it invites two opposite errors: uploading source files that were never meant to go live, or omitting something the site needs to function.

The mechanics are straightforward. Open the project folder in VS Code (for GitHub projects, clone via Source Control, which requires Git installed), start Codex from a new terminal and sign in with a ChatGPT account if prompted, then issue the review prompt. The resulting markdown file should explain how to build the site, where finished files land, and whether extra settings are needed.

Step two: test locally before anything touches a server

Local testing exists to catch broken features while fixes are still cheap. The guide's workflow assumes Vite; projects using something else should ask Codex for the run, build, and test commands in order, along with where to enter them.

For the Vite case, the sequence is: run `npm install` to download dependencies, run `npm run dev` and open the local address shown in the terminal (the example given is `http://127.0.0.1:5173/`) with the terminal kept running, then test navigation, links, images, and buttons while watching for placeholder text. Issues get fixed by Codex and rechecked in the browser.

The build step is where the deployment artifact appears. Stop the dev server with Ctrl + C, run `npm run build`, and a successful build creates a `dist` folder containing `index.html` and an assets folder with the site's CSS and JavaScript. Running `npm run preview` then tests the production version before it goes anywhere. Build errors get pasted back into Codex, the cause fixed, and the failed command rerun.

The distinction between the dev server and the preview server is worth internalizing: the first serves a development version, the second serves what will actually be deployed. A site that works in dev and breaks in preview has a build problem, and finding that out locally is far cheaper than finding it out live.

Step three: three deployment methods, three different update models

The guide presents three routes to Hostinger Web Apps Hosting, which runs both static sites and Node.js apps with a backend. The choice hinges on where you want to publish from and how you plan to handle future changes.

MethodWhen to choose itHow updates work
Hostinger ConnectorDeploy directly from Codex in VS Code without switching between Codex, GitHub, and the Hostinger dashboardRebuild the site and ask Codex to publish the updated files
GitHubUpdate the site regularly and want changes published automaticallyPush to the connected branch; Hostinger rebuilds and redeploys automatically
ZIP uploadPrefer manual file uploads without connecting accountsUpload a new ZIP file and deploy again

The update model is the deciding factor, not the initial deploy. Connector suits one-off or occasional publishing; GitHub suits iterative projects where manual redeployment would become a chore; ZIP suits people who want no account linkage at all. The guide also notes that other cloud platforms such as Vercel and Netlify support Codex-built projects, which makes sense if other projects already live there.

Step four: environment variables are where live sites break

Opening `deployment-notes.md` and finding the required environment variables entry determines whether there's anything to configure. These are settings stored outside the code—database addresses, API keys—that the site reads at runtime. Missing values break logins or database connections after deployment, often silently.

Three outcomes are possible. "None" or "Not required" means move on. Names such as `DATABASE_URL`, or no clear answer, means asking Codex to list the variables, explain where to get each value, and say where to configure them—without sharing passwords or secret keys. Sensitive values belong in a secure location like a password manager and get entered in hosting settings during deployment.

The Vite-specific trap deserves emphasis: variables starting with `VITE_` are visible in the finished website, so they must never hold passwords or private API keys. For the Vite example, non-secret `VITE_` variables go into a `.env.local` file before building locally and deploying with Connector; for GitHub or ZIP deployments, they go into Hostinger's build settings instead.

Step five: deploying through Connector

The Connector path runs entirely inside VS Code. Install the Hostinger Connector extension, click the Hostinger icon in the sidebar, select 1-Click Connect, sign in, return to VS Code, confirm connected status, and make sure Websites is enabled. Then restart Codex by typing `/exit` and running `codex` again, and ask it to list Hostinger websites to verify the connection.

The deployment prompt itself is unusually specific, and the specificity is the point: deploy the Vite site as a new Node.js web app using the finished files in the `dist` folder, don't rebuild, use an unused temporary domain, don't replace any existing website, and show the hosting account, plan, domain, and files for approval before deploying. A temporary domain lets you verify the live site before committing a real domain to it.

Approval is a real checkpoint, not a formality. Confirm the account, plan, and temporary domain, ask Codex to verify required environment variables, then approve and open the live URL to check the homepage loads.

The guide's own deployment failed at this stage—Codex selected a different Hostinger account the author had access to. The recovery prompt asked Codex to check which hosting resources were available on the plan, whether a new website could be created, what likely caused the error in plain terms, and whether retrying was safe, all without deploying anything. Multi-account access is a common real-world condition, and the lesson is that an agent with account access may pick the wrong one unless the prompt constrains it.

Step six: deploying through GitHub or ZIP

The dashboard route skips the Codex-to-Hostinger connection. GitHub deployment requires a GitHub account and Git installed; ZIP deployment requires compressing the project files, keeping `package.json` at the top level and excluding `node_modules` and any `.env` files.

In the Hostinger dashboard, go to Websites → Create site → Web App, enter a preferred domain or choose a temporary one, then either Import Git Repository to connect GitHub or Upload your files for the ZIP. Review the detected build settings—for Vite, `npm run build` as the build command and `dist` as the output directory—and add prepared values under Environment variables → Edit in the build settings if required.

What the process reveals about agent-assisted deployment

Three patterns stand out across the workflow. First, Codex is used as a source of project documentation as much as a code generator; the review prompt and the environment-variable prompt both extract information the user could theoretically determine manually but would likely get wrong. Second, every stage has a verification checkpoint—the notes file, the local preview, the approval step, the live URL check—and each checkpoint catches a different class of error. Third, the failure that actually occurred was not technical but contextual: the agent acted on the wrong account because the prompt didn't exclude it.

The limitations are equally clear. The guide covers one framework (Vite) and one hosting provider (Hostinger) in depth, with Vercel and Netlify mentioned only as alternatives. Projects with backends, databases, or login systems are acknowledged as needing server-side hosting but aren't walked through. Domain connection and the final live-site check are listed as steps but not detailed in the source material, so readers should expect to consult provider documentation for those. And the temporary-domain-first approach, while sensible, means the "live" URL checked at deployment isn't the final production address.

For readers, the practical takeaway is that deployment decisions should follow the project review, not precede it. Identify the framework and its runtime requirements, test the production build locally, choose the update model that matches how often the site will change, and treat environment variables and account selection as the two places where live deployments most often fail.

Last updated: October 26, 2026

Spec tagsViteCodexWebsite deploymentHostingEnvironment variables

Reader notes 0

  • No notes yet. Corrections and first-hand test results are welcome.