Deploying a Node.js application
Developer Guides
This guide covers deploying Node.js apps (Express, Fastify, Next.js standalone, etc.) to TransPark.
1. Create your site
- Dashboard → Add Site → Select Node.js
- Choose your Node.js version (18, 20, or 22 LTS)
- Set your app port (default: 3000)
- Enter your domain → Create
CloudPanel sets up a reverse proxy: HTTPS traffic on port 443 → your app on the port you specified.
2. Upload your application
SSH into your server:
ssh [siteuser]@yoursite-com.transpark.tech cd /home/[siteuser]/htdocs/[domain]
Option A: Git (recommended)
git clone https://github.com/your/repo.git . npm install --production
Option B: SFTP
Upload your project files (excluding node_modules), then SSH in and run npm install --production.
3. Start your application
Use PM2 (pre-installed) to keep your app running:
pm2 start app.js --name "my-app" pm2 save pm2 startup
Or with an ecosystem file:
pm2 start ecosystem.config.js pm2 save
4. Environment variables
Create a .env file in your app root, or pass them through PM2's ecosystem config:
module.exports = {
apps: [{
name: 'my-app',
script: 'app.js',
env: {
NODE_ENV: 'production',
PORT: 3000,
DATABASE_URL: 'your_db_url'
}
}]
};
5. Updating your app
cd /home/[siteuser]/htdocs/[domain] git pull origin main npm install --production pm2 restart my-app
Important notes
- Your app must listen on the port you specified during site creation
- CloudPanel handles SSL termination — your app should listen on HTTP, not HTTPS
- Node.js versions are managed via NVM — you can switch with
nvm use 22 - Logs:
pm2 logs my-app