Contents
ChatGPT writes code in pieces inside the conversation, often across several rounds: a file here, a fix there. The hard part isn’t uploading files. It’s collecting the latest correct version of each file and knowing what the code needs to run outside your computer. This guide assumes you didn’t write the code yourself.
Step 1: collect the project into files
Ask ChatGPT in the same conversation:
Show the complete file tree of the project, then write the full final content of every file with its name, and list the dependency file (requirements.txt or package.json) and every environment variable the code needs.
Then create a folder on your computer and create every file with exactly the same name (upper and lower case matter on a server). If ChatGPT gives you a download link for a file or archive, use it instead of copying by hand.
Step 2: work out what kind of code it is
| What’s in the folder | Type | Where it runs | Guide |
|---|---|---|---|
Only index.html, CSS and JS |
Static site | Any plan | Upload an HTML site |
.php files |
PHP site | Any plan | Upload a PHP site |
app.py with Flask or FastAPI |
Python app | AI/Developer plan | Deploy Flask |
server.js or index.js with Express |
Node.js app | AI/Developer plan | Run a Node.js app |
| A Telegram or Discord bot | Always-running process | AI/Developer plan | Run a Telegram bot |
Step 3: fix what usually breaks on a server
Code from a chat is written to run on your computer. Check these points before uploading, and ask ChatGPT to fix anything you find:
- Keys in the code, such as
api_key = "sk-...". Move them to an environment variable:os.environ["OPENAI_API_KEY"]in Python orprocess.env.OPENAI_API_KEYin Node.js. Never put a secret key in JavaScript that runs in the browser. - A fixed port, such as
app.run(port=5000)orapp.listen(3000). In Node.js useprocess.env.PORT. In Pythonapp.run()isn’t used on cPanel at all: Passenger imports theapplicationvariable frompassenger_wsgi.py. - Debug mode: remove
debug=Truefrom production code. - localhost URLs: if the front end calls
http://localhost:5000/api, change it to your real domain over HTTPS. - Missing libraries: every
importorrequireneeds a line inrequirements.txtorpackage.json. - Paths from your machine, such as
C:\Users\.... Use paths relative to the project folder.
Then run the project on your computer one last time. What doesn’t work there won’t work on the server.
Step 4: upload the files
Zip the folder. In cPanel open Files › File Manager:
- Static or PHP site: go into
public_html, click Upload, then Extract.index.htmlorindex.phpmust sit directly inpublic_html, not in a subfolder. - Node.js or Python: create the app first (step 5), then upload the files into its folder outside
public_html, such as/home/USER/myapp. Don’t uploadnode_modulesorvenv.
Step 5: create the app (Node.js or Python only)
Python: open Software › Setup Python App › Create Application. Pick Python 3.9 to 3.12, enter the app folder and domain, and set the startup file to passenger_wsgi.py with entry point application. Put this in the file:
import os, sys
sys.path.insert(0, os.path.dirname(__file__))
from app import app as application
Node.js: open Setup Node.js App › Create Application, pick Node.js 20 or 24, and set the startup file to server.js or your main file.
Either way, add the keys under Environment variables, install libraries with Run Pip Install or Run NPM Install, then click Restart.
Success: the domain opens the site over HTTPS, forms and buttons that call the server work, and no new errors appear in the log file.
Troubleshooting
- The host’s default page shows instead of your site: files are in a subfolder or the page isn’t named
index. See default page after upload. - A 500 error in a Python app: see Python app 500.
- Works only on your computer: see works locally, not on the server.
If an error message makes no sense, paste it unchanged into ChatGPT with the file name, or ask the Araby AI assistant in the panel, which reads the error log and explains the fix.
On ArabyHost
Static and PHP sites written by ChatGPT run on every plan, with free automatic SSL and daily backups. Node.js, Python and bots run on the AI/Developer plans, with SSH, Git and cron for background workers, and you can run Codex on the server over SSH to edit the code there; see Codex on the server. There’s no Docker and no GPU. Prices in your currency are on the pricing page.
FAQ
ChatGPT gave me website code. Where do I put it?
If it's HTML, CSS and JavaScript or PHP, put the files in public_html with File Manager; the home page must be named index.html or index.php. If it's a Node.js or Python server, put it in a folder outside public_html and create an app for it in Setup Node.js App or Setup Python App.
Can I run Python code from ChatGPT on shared hosting?
ArabyHost shared hosting runs PHP and static sites, without SSH. For Python you need an AI/Developer plan, which has Python 3.9 to 3.12 through Setup Python App.
Why does the code work on my computer but not on the server?
The usual causes with ChatGPT code: a library that isn't listed in requirements.txt or package.json, a fixed port such as 5000 or 3000, a localhost URL in the front end, or a file path from your machine. Read the error log first; it usually names the cause.
Can I leave my OpenAI key in the code?
No. A key in front-end code is visible to every visitor, and a key in server code pushed to GitHub can leak. Put it in Environment variables and read it from os.environ or process.env.