Skip to content
Node.js and Python4 min read

Your project works on your computer but not on the server: what differs?

Works on localhost, fails after deploy

Short answer

A project that works locally and fails on the server usually hits a difference between the two environments, not a bug in the code. The common ones: Linux is case-sensitive, localhost URLs are hard-coded, .env was not uploaded, the build step was not run, the database differs, PHP or Node is older, and the app listens on a fixed port. Check them in that order.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Before you start: collect the evidence
  2. Differences, most common first
  3. How to avoid it
  4. On ArabyHost

On your computer localhost:3000 or localhost:8000 opens and everything works; after upload you get an error, a blank page or data that never arrives. The code is the same, but the environment is not: a different operating system, different paths and versions, and no development server quietly doing things for you. This page lists the differences, most common first, with a link to each fix.

Before you start: collect the evidence

  • The browser Console (F12): frontend errors and the status codes of requests.
  • The server error log: Metrics → Errors in cPanel, storage/logs/laravel.log in Laravel, or the log file in your Node.js app folder.

Give these messages to the AI tool that wrote the project, instead of saying “it does not work”.

Differences, most common first

1. Letter case in names

Linux tells Header.jsx from header.jsx, and import './Components/Nav' from a folder called components. Windows and macOS accept both. Find the file name in the error message and compare it letter by letter. In Laravel this often shows up as Target class does not exist; for images, as images not showing.

2. localhost written into the code

A URL like http://localhost:5000/api or 127.0.0.1 in the frontend makes the visitor’s browser look for the API on the visitor’s own device. Search for localhost and replace it with an environment variable holding the production URL. If you get a CORS message, see CORS error. What localhost means is explained in what is localhost.

3. .env did not arrive or is not read

.env is not deployed by Git, is hidden in File Manager, is not read by Node.js on its own, and Vite variables are baked in at build time. All of it is in .env not loaded on hosting.

4. There is no development server on the hosting

npm run dev and php artisan serve are development tools only. On hosting:

5. The database is different

Locally you may use SQLite, or MySQL as root with no password. On cPanel you create a database and user whose names carry your account prefix, with DB_HOST=localhost as usual, and you must import the tables. See database connection refused after deploy, SQLite read-only and Prisma on hosting.

6. A different PHP or Node.js version

Code written on PHP 8.3 can fail on 8.1; a library that needs Node 20 fails on 18. Compare php -v and node -v locally with the server. Change PHP in MultiPHP Manager, and choose the Node version when you create the app in Setup Node.js App. See choose a PHP version.

7. Ports and long-running processes

app.listen(3000) works locally, but on hosting Phusion Passenger starts your app and hands requests to it. Use process.env.PORT || 3000 rather than a fixed port. A 503 means the app did not start; see Node.js app returns 503 and EADDRINUSE. Bots started in a terminal stop when you close it; see bot stops after closing the terminal.

8. Packages, memory and permissions

9. HTTPS and cookies

Locally you run on http, on the server on https. http:// links inside the page are blocked as mixed content, session cookies may need the right domain setting, and in Laravel this sometimes appears as 419 Page Expired.

How to avoid it

On ArabyHost

AI/Developer plans give you an environment close to your computer: SSH jailed in CageFS, Node.js 20 and 24, Python 3.9 to 3.12, PHP 8.1 to 8.3, Git and Composer, with Node and Python apps through Phusion Passenger. You can run Claude Code or Codex over SSH to fix differences directly on the server. There is no Docker and no root access. On every plan, the Araby AI assistant reads the error log and explains which difference stopped the project.

FAQ

People say the server is Linux. Why does that matter?

Most hosting runs Linux, which treats Logo.png and logo.png, or Components and components, as different. Windows and macOS usually do not, so the project works for you and fails on the server over a single letter.

Should I upload node_modules or vendor from my computer?

Better to install them on the server with npm install or composer install, since some packages are built for your operating system. Without SSH, upload a vendor folder built with the same PHP version as the hosting.

My project uses SQLite. Will it work on hosting?

It works if the database file's folder is writable, but MySQL or MariaDB suits a real site better. If you see attempt to write a readonly database, the folder's permissions are the problem.

My AI tool says the code is correct, so why does it fail?

It tested in its own environment or on your machine. Give it the full error message from the server log and say the hosting is cPanel on Linux, and you will get a fix that fits the real environment.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.