Setup Node.js App in DirectAdmin
Summary
This guide explains how to deploy and manage Node.js applications using the Setup Node.js App tool in DirectAdmin. This feature allows you to run Node.js apps without SSH, using a simple interface to configure versions, environment variables, startup files, and process management.
Overview
Setup Node.js App allows you to:
- Create and manage Node.js applications
- Select Node.js versions
- Set application root and startup file
- Install npm dependencies
- Manage environment variables
- Start, stop, and restart apps
- View logs
It is ideal for Express.js, Next.js, Nuxt, Strapi, APIs, and custom Node projects.
Requirements
- DirectAdmin user-level access
- Node.js support enabled by your hosting provider
- A domain or subdomain for the app
- Application files uploaded to your hosting account
Step-by-Step Instructions
1. Access Setup Node.js App
- Log in to DirectAdmin
- Go to Extra Features → Setup Node.js App
- Click “Create Application”
You will see a configuration form.
2. Choose Node.js Version
Select the Node.js version your app requires.
Common options include:
- 14.x
- 16.x
- 18.x
- 20.x
Choose the version your project was built for.
3. Set Application Root
This is the folder where your Node.js project lives. Examples:
- /domains/yourdomain.com/public_html/app
- /domains/yourdomain.com/nodeapp
- /home/username/myapi
Upload your project files to this directory before starting the app.
4. Set Application URL
Choose the domain or subdomain that will serve your Node.js app:
- yourdomain.com
- api.yourdomain.com
- app.yourdomain.com
You can also use a custom port if needed.
5. Set Startup File
This is the main file that runs your app. Common examples:
- app.js
- server.js
- index.js
- main.js
For frameworks:
- Next.js → server.js or next start
- Nuxt → npm run start
- Strapi → npm run start
6. Install Dependencies
Inside the Node.js App panel:
- Click “Install NPM Packages”
This runs:
npm install
It installs all dependencies from package.json.
7. Set Environment Variables
Click “Environment Variables” to add:
- PORT
- NODE_ENV
- API keys
- Database credentials
Example:
NODE_ENV = production
PORT = 3000
8. Start the Application
- Click “Start”
- The app will launch using the selected Node.js version
You can also:
- Stop
- Restart
- Rebuild
9. View Logs
Click “Logs” to see:
- Console output
- Errors
- Startup messages
Useful for debugging:
- Missing modules
- Syntax errors
- Port conflicts
Troubleshooting
App Not Starting
- Wrong startup file
- Missing dependencies
- Syntax errors in code
- PORT already in use
Run “Install NPM Packages” again if needed.
404 or Blank Page
- Wrong application root
- Wrong domain mapping
- App not listening on the correct port
Use:
app.listen(process.env.PORT)
NPM Install Fails
- Missing package.json
- Incorrect permissions
- Unsupported Node version
Switch to a different Node.js version if required.
Environment Variables Not Working
- Restart the app after changes
- Check spelling and case sensitivity
Next.js / Nuxt Not Working
- Ensure you run the production build
- Use npm run build before starting
- Set correct startup file
Security Notes
- Never expose API keys in code
- Use environment variables for secrets
- Keep Node.js updated
- Remove development tools before deployment
- Use HTTPS for all API endpoints
Related Articles
- [Setup Python App](ca://s?q=Setup_Python_App)
- [Select PHP Version](ca://s?q=Select_PHP_Version)
- [Terminal](ca://s?q=Terminal)
- [File Manager](ca://s?q=File_Manager)
- [Site Summary & Logs](ca://s?q=Site_Summary_and_Logs)