Contents
NestJS is a framework for building servers in TypeScript on Node.js. Its app is a process that stays running and listens for requests, so hosting that only serves files is not enough. Three things matter when deploying: the port, the database, and the side services the app depends on.
What NestJS needs in production
| Requirement | Details | On ArabyHost |
|---|---|---|
| A recent Node.js | A long-term support release | Node.js 20 and 24 |
| Process management | Starting the app and restarting it if it stops | Passenger through Setup Node.js App |
| Port | app.listen(process.env.PORT ?? 3000) |
Passenger sets it |
| Database | TypeORM, Prisma or Sequelize | MySQL/MariaDB |
| Environment variables | ConfigModule reads from the environment |
From the app screen in cPanel |
| Build | npm run build produces dist/ |
On your computer, then you upload the output |
Which plan do you need?
The AI and developer plans, because they run Node.js applications and have SSH. The front end that talks to the API, such as Angular or React, runs on any plan as static files.
How it runs on ArabyHost
- Check the port in
src/main.ts:
await app.listen(process.env.PORT ?? 3000);
- Build on your computer:
npm ci, thennpm run build. - Upload the
dist/folder withpackage.jsonand the lock file to a folder outsidepublic_html, such as/home/USER/nestapp. Do not uploadnode_modules. - Create the app from Software, then Setup Node.js App: Node.js 24, Application root set to
nestapp, and Application startup file set todist/main.js. - Add the variables, such as
NODE_ENV=productionand the database details, then Run NPM Install and Restart. - Try an API route in the browser.
If you get a 503, the app crashed on start and the cause is in the log: see Node.js app returns 503. The general steps are in the Node.js API deploy guide.
The database
Create a MySQL database from cPanel as in the MySQL database guide, with localhost as the host. In TypeORM the connection type is mysql with the mysql2 package; in Prisma the provider is mysql. Run migrations over SSH after uploading, not on every start. Details are in the guide to connecting an app to a database.
What is not available
Know these constraints before you build on them:
- Redis: not available, so queues built on it such as BullMQ do not work, nor does caching through it. The alternative is a database table with a cron job, or an external service with a REST interface over HTTPS.
- Microservice transports: Kafka, NATS and RabbitMQ are not available.
- PostgreSQL and MongoDB: not available on the account, and a direct connection to them elsewhere does not work.
- Docker and root: not available.
- Resources: your account has a memory and CPU limit. An app with heavy load or many services needs a VPS.
If your project depends on more than one of these, a VPS from a provider that offers one suits it better.
On ArabyHost
NestJS runs on the AI and developer plans through Passenger, with SSH in an isolated environment, Git and deploys from GitHub, MySQL databases and cron jobs. The SSL certificate is free and automatic and backups are daily. The Araby AI assistant reads the error log and explains why the app crashed. You can run Claude Code or Codex on the same server to change the project.
Prices are shown in your currency on the pricing page, and the renewal price is the price you signed up at. Node.js in general is covered in Node.js hosting and Express hosting.
FAQ
Does NestJS run on ordinary shared hosting?
Not on a plan without Node.js. It needs a plan that runs Node.js applications as a long-running process, which here means the AI and developer plans, through Setup Node.js App in cPanel.
Can I use PostgreSQL with NestJS on your hosting?
The database available on the account is MySQL/MariaDB, and a direct connection to an external PostgreSQL database does not work because outgoing connections are HTTPS only. TypeORM and Prisma support MySQL, and converting is usually a matter of changing the connection settings and a few column types.
How do I run scheduled tasks in NestJS?
The scheduling library's timers only work while the process is alive, and Passenger may stop the app when idle. The safer way is a job in Cron Jobs that calls a protected API route or a separate script.