UnderHost
Knowledgebase Docs

Node.js on aaPanel: setup and configuration

Deploy Node.js applications on aaPanel. Learn installation, reverse proxy configuration, PM2 process management, and troubleshooting.

On this page

aaPanel makes Node.js deployment straightforward. It handles process management (PM2), reverse proxy setup (Nginx), and SSL certificates automatically. You focus on your code; aaPanel handles the infrastructure.

Requirements

  • Cloud VPS with aaPanel installed (or Dedicated Server)
  • Sufficient resources: At least 1GB RAM (2GB+ recommended)
  • Node.js app ready to deploy: Git repository or uploaded code
  • Domain name pointing to VPS (optional, can use IP initially)

Install Node.js in aaPanel

  1. Log in to aaPanel
  2. Go to App Store → Node.js
  3. Click the desired Node.js version (14.x, 16.x, 18.x recommended)
  4. Click Install
  5. Wait for installation (takes 2-5 minutes)

Create Node.js app

  1. In aaPanel, go to Websites → Node.js
  2. Click Add Node.js App
  3. Enter app name (e.g., "myapp")
  4. Select Node.js version
  5. Enter app port (e.g., 3000—keep above 1024)
  6. Choose deployment method:
    • Git: Clone from GitHub/GitLab (recommended)
    • Upload: Upload ZIP file directly
  7. If Git: Enter repository URL and branch
  8. Click Add

aaPanel automatically:

  • Creates project directory
  • Clones code (if Git)
  • Installs dependencies (npm install)
  • Starts app with PM2
  • Creates Nginx reverse proxy

PM2 process management

PM2 keeps your Node.js app running. aaPanel manages PM2 automatically:

  • Start app: Use aaPanel restart button
  • View logs: Websites → Node.js → [App] → Logs
  • Environment variables: Create .env file in project root
  • Auto-restart on failure: PM2 restarts automatically

Access PM2 via SSH (advanced):

pm2 list                    # Show all apps
pm2 logs appname            # View real-time logs
pm2 restart appname         # Restart app
pm2 stop appname            # Stop app

Nginx reverse proxy

aaPanel automatically creates Nginx reverse proxy pointing traffic to your Node.js app. For a domain:

  • User requests: yourdomain.com
  • Nginx receives on port 80/443
  • Proxies to Node.js app on port 3000 (or your configured port)
  • Response sent back to user

Bind domain to app

  1. In aaPanel, click Websites → Node.js → [App]
  2. Click Add Domain
  3. Enter your domain name (e.g., example.com)
  4. SSL certificate auto-issued (Let's Encrypt)
  5. Click Add

App now accessible at yourdomain.com (HTTPS automatically configured).

Troubleshooting

App won't start:

  • Check app logs: Websites → Node.js → [App] → Logs
  • Verify package.json exists in project root
  • Check Node.js version compatibility
  • Try manual restart via SSH: pm2 restart appname

High CPU/Memory usage:

  • Check logs for errors or infinite loops
  • Monitor with: pm2 monit
  • Increase VPS RAM if needed

Can't connect to domain:

  • Verify domain DNS points to VPS IP
  • Check firewall isn't blocking ports 80/443
  • Verify app is running: pm2 list
aaPanel simplifies Node.js deployment

Node.js apps on aaPanel are managed like web applications—no SSH command-line required. aaPanel handles PM2, Nginx configuration, SSL, and monitoring automatically.

Related: aaPanel overview | CloudPanel Node.js | VPS management

Was this article helpful?

Need aaPanel hosting?

Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.

Related articles

Back to aaPanel