Docs Home Return to Homepage
Get Started Login

How to Run a Node.js or Python App in DirectAdmin

Last updated Changelog

On this page

Besides PHP sites, your DirectAdmin account can run Node.js and Python web apps. In this example we run a Node.js app at directadmin.cranedemo.com/hello, then a Python (Flask) app at directadmin.cranedemo.com/hello-py.

Create a Node.js app

  1. Log in to DirectAdmin. In the Extra Features section, click Setup Node.js App.

    The Extra Features section with Setup Node.js App highlighted

  2. Click CREATE APPLICATION.

    The Node.js page with CREATE APPLICATION highlighted

  3. Fill in the form, then click CREATE:

    • Node.js version: pick the version your app needs. If you’re not sure, choose the newest.
    • Application mode: Production for a live site.
    • Application root: the folder for your app’s files, inside your home folder. We used hello-app.
    • Application URL: where the app shows up. We chose directadmin.cranedemo.com and typed hello. Leave the box after the domain empty to run the app on the whole domain.
    • Application startup file: the file that starts your app, such as app.js.

    The form with Node.js 24.22.1, Production, hello-app, directadmin.cranedemo.com/hello and app.js, and CREATE highlighted

  4. DirectAdmin creates the app and starts it. At the top you’ll see a command to use your app’s Node.js from SSH or Terminal, for example to run npm yourself.

    The new app with the virtual environment command highlighted

  5. Open your app’s address in a browser. Until you upload your own app, a sample app answers with It works!

    directadmin.cranedemo.com/hello in a browser, showing It works! NodeJS 24.22.1

Put your own Node.js app in place

  1. Upload your app’s files to the application root (here, hello-app) with File Manager, replacing the sample app.js. Include package.json, but leave out the node_modules folder. Your app should start its web server with app.listen(process.env.PORT || 3000) or similar, not on a fixed port.

  2. Back in Setup Node.js App, click the pencil next to your app.

    The list of apps with the hello-app row and its edit pencil highlighted

  3. Under Detected configuration files, click Run NPM Install and wait for it to finish. It installs the packages listed in your package.json.

    Run NPM Install highlighted next to package.json

  4. Scroll up and click RESTART. Your app is live.

    directadmin.cranedemo.com/hello in a browser, showing Hello from Node.js on NameCrane!

Tip: After you change your app’s files, click RESTART so the changes take effect.

Create a Python app

  1. In the Extra Features section, click Setup Python App, then CREATE APPLICATION.

    The Extra Features section with Setup Python App highlighted

  2. Choose a Python version, an Application root and an Application URL. Type passenger_wsgi.py as the Application startup file. Leave Application Entry point empty: DirectAdmin fills in application. Click CREATE.

    The Python form with 3.13.16, hello-py, directadmin.cranedemo.com/hello-py and passenger_wsgi.py, and CREATE highlighted

  3. DirectAdmin creates the app with a sample passenger_wsgi.py and starts it.

    The new Python app with the virtual environment command highlighted

Put your own Python app in place

  1. Upload your app’s files to the application root (here, hello-py), including requirements.txt. passenger_wsgi.py must provide your app as application. For a Flask app in app.py, replace its contents with this one line: from app import app as application

  2. Open your app (the pencil in the list). Under Configuration files, type requirements.txt in the box and click Add.

    requirements.txt typed in the box and Add highlighted

  3. Click SAVE at the top.

    SAVE highlighted

  4. Click Run Pip Install and choose requirements.txt. It installs your packages.

    The Run Pip Install menu with requirements.txt highlighted

  5. Click RESTART. Your app is live.

    directadmin.cranedemo.com/hello-py in a browser, showing Hello from Python on NameCrane! with Flask 3.1.3

Remove an app

Open the app and click DESTROY, then AGREE.

The confirmation: Are you sure you want to remove hello-app application? with AGREE highlighted

The app stops and disappears from the list. Its files stay in the application root: delete that folder in File Manager if you don’t need them.

Troubleshooting

Problem What to do
The app’s address shows 500 Internal Server Error Look in stderr.log in the application root: your app writes its errors there. In our test, a missing package caused it until we ran Run Pip Install.
The app’s address shows 403 Forbidden The app is stopped. Open it and click START APP.
Run Pip Install says “An error occured during installation of modules” In our test this showed up even though everything installed fine: pip only warned that a newer pip exists. Click RESTART and check your app. If it still fails, look in stderr.log.
Run Pip Install is greyed out Add requirements.txt under Configuration files and click SAVE first.
My changes don’t show up Click RESTART in Setup Node.js App or Setup Python App.
The app uses too much memory or gets slow Check Resource Usage. Apps share your plan’s memory and process limits with your website.

Snagged on something? Contact support and we’ll get you sorted.

Snagged on something?

Our sysadmins answer tickets around the clock.