---
title: Run a plain Node.js app
project: SuperAdmin
version: 9.0
section: recipes
language: en
license: MIT
url: https://totaljs.es/docs/superadmin/9-0/recipes/plain-nodejs-app/
updated: 2026-11-19T08:00:40.593Z
---

# Run a plain Node.js app

> Host a Node.js app that is not a Total.js app with the Custom type.

SuperAdmin can run any Node.js app that listens on a port. Choose the type **Custom** and give the name of your start script.

SuperAdmin starts the script with Node.js and two arguments: the port number and the mode, `--release` or `--debug`. Your app must listen on that port on `127.0.0.1`.

## Example app

A file `server.js`:

```javascript
var http = require('http');
var port = +process.argv[2];
var mode = process.argv[3];

http.createServer(function(req, res) {
	res.end('Hello from a plain Node.js app (' + mode + ')');
}).listen(port, '127.0.0.1');

console.log('Listening on ' + port + ' ' + mode);
```

Pack it into a ZIP file with `server.js` at the top level.

## Add the app

1. Select **Add > App** and type the **URL address**, for example `http://node.example.com`.
2. Clear **Enable debug mode**.
3. Under **Type of application**, choose **Custom**.
4. In **Custom start script**, type `server.js`.
5. Select **SUBMIT**.
6. In **Upload source-code**, upload the ZIP file. See [Upload source code](../../guides/upload-source-code/).

SuperAdmin runs a command like this one:

```bash
node --nouse-idle-notification --expose-gc /www/www/example_com-node/server.js 8001 --release
```

The port is shown next to the name of the app in the list. Open the address of the app: it answers `Hello from a plain Node.js app (--release)`.

The output of `console.log` goes to the log of the app. See [Logs and analyzator](../../guides/logs-and-analyzator/).

With **Memory limit**, SuperAdmin adds `--max_old_space_size` with your value to the command.
