To deploy a website from Codex, review the project, test it on your computer, and publish it on hosting that supports its framework and features.
The hosting setup you need depends on what Codex built. For example, a simple portfolio needs only its finished files published, while an app that handles user logins or stores information in a database needs hosting that runs server-side code, such as Node.js.
You can deploy your Codex website to Hostinger directly from your coding environment with Hostinger Connector, or through GitHub or a ZIP upload. Here’s how:
- Review your Codex project.
- Identify the framework and test the site locally.
- Pick a deployment method.
- Check for necessary environment variables.
- Deploy your website.
- Connect your domain.
- Check that the live site works.
What do you need before deploying a website from Codex?
Before deploying a website from Codex, prepare your project files and the tools you’ll use to test and publish your website:
- A Codex-built website. Have your project files saved on your computer or in a GitHub repository.
- Visual Studio Code (VS Code). You’ll use this free code editor to open your project and work with Codex. With Hostinger Connector, you can also deploy a website from your integrated development environment.
- Codex command-line interface (CLI). You’ll use Codex through the VS Code terminal to review and prepare your project.
- Node.js and npm. You’ll use these to install packages and build your website if your project requires them. You’ll check whether you need them in step 2.
- A compatible hosting plan. You’ll need hosting to make your website available online. For this tutorial, I used Hostinger Web Apps Hosting, which supports Vite projects through the Node.js web app option on the Unlimited and Cloud Startup plans. You can choose your hosting plan after reviewing your project’s requirements.
Don’t have a website yet? Create a simple portfolio to practice deployment. Open an empty folder in VS Code, select Terminal → New Terminal, and type codex. Once Codex opens, enter this prompt:
Create a simple one-page portfolio website using Vite, with a navigation menu, an image, and a button. Keep it static, without a backend, database, or login system. Save the project files in the current folder.
Once Codex finishes creating the project files, you’re ready to review them.
1. Review the project Codex generated
Review the project that Codex generated by opening it in VS Code and asking Codex to identify its framework, build command, output folder, and required settings.
This helps you understand which files to prepare and publish, so you don’t upload the wrong files or miss something your website needs to work.
Follow these steps:
1. Open your project in VS Code. Select File → Open Folder and choose your website folder. You should see files such as package.json, index.html, or a src folder in the Explorer panel. For a GitHub project, use Source Control → Clone Repository to download and open it. This requires Git to be installed on your computer.
2. Start Codex. Select Terminal → New Terminal, type codex, and press Enter. Sign in with your ChatGPT account if prompted. You can skip this step if Codex is already running.
3. Ask Codex to review the project. Enter this prompt:
Review this project for deployment. Identify its framework, build command, start command, output folder, and any required environment variables. Explain what each means in simple language. Save the summary as deployment-notes.md in the current project folder.
Don’t include passwords, API keys, or other secrets. Organize the summary under clear headings for the framework, build command, start command, output folder, and environment variables.
4. Check the deployment summary. Open deployment-notes.md in VS Code’s Explorer panel. It should explain how to build your website, where the finished files will be saved, and whether any additional settings are needed.
2. Check the framework and test the website locally
Check your website’s framework in deployment-notes.md, then run and build the project in VS Code. This helps you catch broken features before deployment and create the finished website files you’ll publish.
Open deployment-notes.md in VS Code and find the Framework / build tool entry.
- Does it mention Vite? Follow the instructions below.
- Does it use something else? Ask Codex: “Show me how to run, build, and test this website on my computer. Give me the commands in order and explain where to enter them.”
In my case, Codex used Vite with plain HTML, CSS, and JavaScript. To follow along, open Terminal → New Terminal in VS Code, separate from your Codex session, and follow these steps:
- Install the required packages. Run
npm installand wait for it to finish. This downloads the packages your website needs to work. - Open your website locally. Run
npm run devand open the address shown in the terminal, such ashttp://127.0.0.1:5173/. Keep the terminal running while testing. - Check that everything works. Test the navigation, links, images, and buttons. Look for placeholder text or content that needs replacing. Ask Codex to fix any issues you find, then check the changes in your browser.
- Build the website. Return to the terminal running your local server and press
Ctrl + Cto stop it. Runnpm run build. A successful build creates adistfolder containing the finished website files. - Check the finished files. In VS Code’s Explorer panel, expand the
distfolder. You should seeindex.htmland anassetsfolder containing your website’s CSS and JavaScript files. - Test the production version. Run
npm run previewand open the address shown in the terminal. Check that your website still looks and works as expected. PressCtrl + Cto stop the preview when you’re done.
Paste the error into Codex, ask it to fix the cause, and rerun the failed command.
3. Choose a hosting method for your Codex project
Choose how to deploy your Codex website based on where you want to publish it from and how you plan to handle future updates.
Here are three ways to deploy an existing Codex website to Hostinger Web Apps Hosting, which runs both static websites and Node.js apps with a backend:
|
Method |
When to choose it |
How updates work |
|
Hostinger Connector |
You want to deploy directly from Codex in VS Code without switching between Codex, GitHub, and Hostinger dashboard |
Rebuild the website and ask Codex to publish the updated files |
|
GitHub |
You plan to update your website regularly and want those changes published automatically |
Push changes to the connected branch, and Hostinger automatically rebuilds and redeploys |
|
ZIP upload |
You prefer uploading files manually without connecting accounts |
Upload a new ZIP file and deploy again |
Other cloud platforms, such as Vercel and Netlify, also support Codex-built projects. They make sense if you already host other projects there. You can compare web app hosting providers to explore other options.
4. Check whether your website needs environment variables
Check whether your website needs environment variables by opening deployment-notes.md in VS Code and finding the Required environment variables entry.
These are settings stored outside your code, such as database addresses or API keys, that your website reads when it runs. Missing values break features like logins or database connections after deployment.
Here’s what to look for:
- None or Not required. Your website doesn’t need any environment variables configured, so you can move on to deployment.
- Names such as
DATABASE_URL, or no clear answer. Ask Codex to identify what your website needs and where to get each value. For example,DATABASE_URLcontains connection information from your database provider. Use this prompt:
Check whether this project needs any environment variables to work after deployment. List their names, explain where to get their values, and tell me where to configure them. Don’t ask me to share passwords or secret keys.
Once you have the values, store and add them like this:
- Keep sensitive values, such as
DATABASE_URL, in a secure location, like a password manager. You’ll enter them in your hosting settings during deployment. - For the Vite example, add non-secret
VITE_variables to a.env.localfile before building your website locally and deploying it with Hostinger Connector. Enter these values in Hostinger’s build settings instead if you’re deploying through GitHub or a ZIP file. - Variables starting with
VITE_are visible in the finished website, so never use them for passwords or private API keys.
5. Deploy your Codex website
Deploy your Codex website to Hostinger directly from VS Code using Hostinger Connector, or through Hostinger dashboard using a GitHub repository or ZIP file.
Deploy with Hostinger Connector
To deploy with Hostinger Connector, connect Codex to Hostinger in VS Code, then ask Codex to publish your website. This deploys your website directly from VS Code without manually uploading files through Hostinger dashboard.
1. Install Hostinger Connector. In VS Code, open Extensions, search for Hostinger Connector, and click Install.
2. Connect your account. Click the Hostinger icon in the sidebar, select 1-Click Connect, and sign in. Return to VS Code, confirm the connected status, and make sure Websites is enabled.
3. Restart Codex. In the terminal, type /exit to close Codex, then run codex to start a new session. Ask Codex to “List my Hostinger websites” to check the connection.
4. Deploy your website. Use a temporary domain so you can check your live website before connecting your own domain later. Paste this prompt into Codex:
Deploy my Vite website to Hostinger as a new Node.js web app using the finished files in the
distfolder. Don’t rebuild the project. Use an unused temporary domain and don’t replace any existing website. Show me the hosting account, plan, domain, and files for approval before deploying. Once finished, provide the live URL.
5. Approve and check the deployment. In Codex, confirm the correct hosting account, plan, and temporary domain. Ask it to verify any required environment variables before approving. Once deployed, open the live URL to check that your homepage loads.
👉 Hit a snag during deployment?
I did too! Codex returned an error while deploying my website because it had selected another Hostinger account I could access. I restarted it and used this prompt to check what went wrong:
My previous deployment failed with this error: [paste the error message from Codex].
Check which hosting resources are available for my Hostinger plan and whether you can create a new website on it. Don’t deploy anything yet. Explain what likely caused the error in simple terms and tell me whether it’s safe to retry.
Deploy with GitHub or a ZIP file
You can also deploy your project through Hostinger dashboard without connecting Codex to your hosting account.
For GitHub deployment, make sure you have a GitHub account and Git installed on your computer.
- Prepare your files. In VS Code’s Source Control panel, commit and publish your project to GitHub, or compress the project files into a ZIP archive. For ZIP uploads, keep
package.jsonat the top level and excludenode_modulesand any.envfiles. - Open Hostinger dashboard. Go to Websites → Create site → Web App. In the chat window that opens, enter your preferred domain name or choose a temporary domain. Then select Import Git Repository to connect your GitHub account, or Upload your files to select your ZIP archive.
- Review the settings and deploy. Check the detected build settings. For a Vite project, use
npm run buildas the build command anddistas the output directory. Add the values you prepared under Environment variables → Edit in the build settings if your website requires environment variables. Click Deploy, then open the live URL to confirm your website loads.
▶️ Prefer a quick video? Check out our Codex tutorial for a quick look at how to publish a Codex-built app to Hostinger through GitHub:
Subscribe For more educational videos!
Hostinger Academy
Subscribe
6. Connect your domain
Connect a domain to your Codex website in Hostinger dashboard by opening Websites, finding your newly deployed site, and selecting the Connect domain icon.
Enter your domain name and confirm the change when prompted. Allow up to 24 hours for the domain to connect.
Don’t have a domain yet? Keep using the temporary address and come back to this step later.
7. Test the live website
Test your Codex website by opening its public URL and checking that everything works as expected. Even when your website works perfectly in VS Code, some errors only appear after deployment.
Check these before sharing the website with others:
- Pages and links. Click through your website and check that every link works. For websites with multiple pages, try opening a page directly in a new tab, such as yourbrand.com/about.
- Images and layout. Check that images, fonts, and styles load correctly. Open the website on your phone to make sure nothing overlaps or gets cut off.
- Buttons and forms. Test buttons, menus, and any forms. On my portfolio website, for example, I’d check that the Explore my work button takes visitors to the right section.
- HTTPS. Check that your website address starts with https://, including after connecting your domain.
👉 Found something that doesn’t work? Tell Codex which page you were on, what you tried, and what happened. For browser errors, right-click the page, select Inspect → Console, and copy the error message into Codex. Ask it to fix the error, then rebuild and redeploy your website. Test the same feature again to confirm it works.
Here’s how my practice portfolio turned out after deploying it to Hostinger:
I didn’t have a website when I started, so I asked Codex to build a simple portfolio to practice deploying. Not bad for a first attempt!
How to fix common Codex deployment problems
Fix Codex deployment problems by checking the error in Codex, Hostinger’s build logs, or your browser, then applying the relevant fix from the table below.
|
Problem |
How to fix it |
|
Missing project files |
Check that your ZIP file or GitHub repository contains all the files your website needs. For Vite projects, make sure package.json is at the top level, not inside an extra folder. |
|
Packages won’t install |
Check that your hosting’s Node.js version matches the major version on your computer, such as 22.x. Run node -v in the VS Code terminal to check yours. Look for dependency errors, such as ERESOLVE, in the build logs or terminal. Ask Codex to identify and fix any package conflicts. |
|
Build fails |
In your site’s Hostinger dashboard, open Deployments, select the failed deployment, and view its Build logs. Copy the relevant error into Codex and ask it to fix the cause before redeploying. |
|
Website is blank or loads incorrectly |
Check that the output directory matches your project, such as dist for Vite. Right-click the page and select Inspect → Console to find errors and ask Codex to fix them. |
|
Features work locally but not online |
Check for missing environment variables or website addresses that still point to localhost instead of the live site. Correct the settings and redeploy. |
|
Hostinger Connector returns an error |
Check the error message in Codex. Ask it to verify your hosting account, plan, and website status before trying again. |
Once you’ve fixed the error, redeploy your website and test the affected page or feature to confirm it works.
What should you do after deploying a Codex website?
After deploying your Codex website, keep your hosting active, connect your domain, monitor your website, and keep improving it as your project grows .
Start by checking the renewal settings for your hosting plan and domain in Hostinger dashboard. Turning on auto-renewal prevents your website from going offline because you forgot to renew either one. Connect your own domain once you’re ready to replace the temporary address.
Check your live website regularly, especially after each update. Open the main pages, test key features like buttons and forms, and review the build logs in Hostinger dashboard if a deployment fails.
And just because your website is live doesn’t mean you’re done with Codex! Want to add another project to your portfolio or fix a button? Open the same project in VS Code and ask Codex to make the changes.
You can also explore other Codex use cases as you get more comfortable.
Before publishing your changes, test them locally, then update your live website using the same deployment method you followed earlier. Check the live site afterward to make sure everything works.
This article is a localized version of How to deploy a website from Codex, originally published in English.
All of the tutorial content on this website is subject to
Hostinger’s rigorous editorial standards and values.
Apply for Premium Hosting
Source Credit: https://www.hostinger.com/in/tutorials/how-to-deploy-a-website-from-codex/
