Node.js, Python, and Ruby
Use this page to run Node.js, Python, or Ruby applications in your hosting account, e.g. an Express API, a Flask/Django app, or a Rails/Sinatra app. Each application answers on a URL of your domain.
When this menu is available
The sidebar menu appears when your package includes Node.js, Python, or Ruby:
| Package includes | Menu name |
|---|---|
| Node.js and/or Python | Node.js & Python |
| Ruby (with or without the others) | Node.js, Python & Ruby |
If the page shows "No application runtimes on this server yet", your hosting provider has not installed runtimes on your server. If some runtimes are not in your package, the page shows "Some runtimes are not included in this account's package."
How it works
- Each application runs as your account's user from its own folder in your home folder.
- The account's CPU, RAM, IO, and process limits still apply.
- The application gets a local port through the
PORTvariable (andHOST=127.0.0.1). The web server forwards requests from the domain to that port. - The application is restarted automatically when it stops because of an error.
- Every settings change restarts the application.
| Runtime | How it runs | Default startup file |
|---|---|---|
| Node.js | node <startup file>, NODE_ENV follows the mode | app.js |
| Python | gunicorn (2 workers) with a WSGI entry point, in a virtualenv | passenger_wsgi.py, entry point application |
| Ruby | Puma with config.ru, RACK_ENV follows the mode | config.ru |
The application must listen on PORT
A Node.js application must read its port from the PORT variable, not use a fixed port. Example: app.listen(process.env.PORT). For Python and Ruby, gunicorn and Puma handle this.
Creating an application
Click New Node.js app, New Python app, or New Ruby app for the runtime you need.
Fill in the form:
Field Notes Application directory (in home) The application folder in your home folder, outside public_html, e.g.apps/api. Created if missing.Domain The domain the application answers on. URL path The path on the domain, e.g. /api. Empty means the domain root.Runtime version (e.g. Node.js version) The Node.js, Python, or Ruby version installed on the server. Mode (Node.js, Ruby) productionordevelopment.WSGI entry point (Python) The WSGI object name, e.g. applicationorapp.Startup file The file to run, e.g. app.js,passenger_wsgi.py, orconfig.ru.Environment variables One NAME=valueper line. Names may only contain letters, digits, and underscores.Click Create.
If the folder does not exist yet, the panel creates it. A sample startup file is only created for the default names app.js, passenger_wsgi.py, and config.ru when that file is missing. Existing files are not overwritten.
Any other startup file (e.g. server.js) must already exist and must not be empty. Otherwise creating or changing the application is refused with "startup file ~/… not found; upload the application first or check the application root" or "startup file ~/… is empty; upload the application or pick its real startup file". Upload your application first, or fix the Application directory so it points to the folder with the real startup file. For Python, the panel also creates a virtualenv with gunicorn. For Ruby, the panel prepares a gem folder with Puma.
The application then answers on https://myshop.com/api (matching the domain and path you chose).
Location rules
- The application folder cannot be inside
public_html, in a dot folder (e.g..config), or in a system folder of your home. - Each domain and URL path pair must be unique.
- The URL path cannot be under
/.well-known. - An application at the domain root replaces that website's PHP and static files.
Installing dependencies
After uploading your code (with the File Manager, SFTP, or Git), click the dependency button on the application row:
| Runtime | Button | File read |
|---|---|---|
| Node.js | npm install | package.json |
| Python | pip install -r | requirements.txt |
| Ruby | gem install -g Gemfile | Gemfile |
The command runs as your account's user, and its output is shown in the panel.
Starting, stopping, and restarting
The application table shows the Application, Runtime, and Status:
| Status | Meaning |
|---|---|
| running | The application is active. |
| starting | The application is starting up. |
| stopped | The application is turned off. |
| crashed | The application stopped because of an error. Check the log. |
Buttons on each row:
- Start to start a stopped application;
- Restart and Stop for a running application;
- Log to see the application log (output and errors);
- Edit to change settings, then Save and restart;
- Remove to delete the application.
Application crashed?
Open the Log first. Common causes: dependencies not installed, a wrong startup file, or the application not listening on PORT.
INFO
Remove only removes the application from the panel and the web server. The files in the application folder stay in your home folder.
CloudLinux servers
On CloudLinux servers, Node.js and Python use the CloudLinux selector, while Ruby still uses the MoorCP runtime. The page and steps are the same. The Log button is only available for applications run by the MoorCP runtime.
Applications moved from cPanel
When your account is imported from cPanel, Node.js, Python, and Ruby applications from the cPanel Application Manager or the CloudLinux selector are registered again with the same directory, domain, URL, startup file, mode, and environment variables. Check them on this page after the move. If the old application root pointed to the wrong folder, creating it is refused as described in Creating an application; fix the folder or the startup file, then create it again.
