DirectAdmin Manual

Helping you get the most out of DirectAdmin and your web!

Prepare and upload a Node.js project

Requirements

  • a domain or subdomain pointing to the correct server,
  • a project with package.json and preferably a lock file,
  • DirectAdmin and, depending on the method, Terminal or SSH access,
  • a Node.js version supported by both the project and server.

Application location

Use a dedicated account directory, for example:

/home/USERNAME/domains/DOMAIN/app/

The source can remain outside public_html. Public static assets belong in the framework's public directory or a dedicated document root.

  • Upload sources, package.json and one lock file.
  • Create node_modules on the server; never copy it from Windows or another platform.
  • Do not upload development caches, local logs or .git unless required.
  • A .env file can contain secrets. Keep it out of the public web directory with secure permissions.

Install and build

cd ~/domains/DOMAIN/app
node -v
npm -v
npm ci
npm run build

Use npm ci with a current package-lock.json. Otherwise use npm install and commit the resulting lock file. The build must succeed before the application is created or restarted.

Run commands in the selected Node.js runtime. With CloudLinux Selector, use the environment activation command displayed by the application.

Before production

  • Set production mode and all required environment variables.
  • Do not run a built-in development server in production.
  • Never put secrets directly in package.json, a URL or a public repository.
  • Back up the application, configuration and database.
Back to chapter overviewContact Euroserver support