Deploying a Node.js application

Developer Guides

This guide covers deploying Node.js apps (Express, Fastify, Next.js standalone, etc.) to TransPark, step by step.

Two things trip people up most often — get these right and the rest is easy:

  • Your app files must live in your site's web root — the htdocs/[your-domain]/ folder — not loose in your home directory. If your app is somewhere else, it won't be served.
  • Your app must listen on the exact port assigned to your site. Each Node site is given a specific port (shown in your site's settings). If your app defaults to 3000 but your site was assigned, say, 3007, set PORT=3007 or nothing will connect.

1. Create your site

  1. Dashboard → Add Site → Select Node.js
  2. Choose your Node.js version (18, 20, or 22 LTS — pick one that satisfies your project's engines field)
  3. Note the app port assigned to your site — you'll need it in step 4
  4. Enter your domain → Create

Our platform automatically puts your site behind HTTPS and forwards traffic to your app on its assigned port — you don't configure any web server yourself.

2. Upload your application into the web root

Put your project inside htdocs/[your-domain]/. You can upload with the File Manager in your control panel, or over SSH:

ssh [siteuser]@yoursite-com.transpark.tech
cd /home/[siteuser]/htdocs/[domain]

Option A: Git over HTTPS (recommended) — works even on networks that block SSH port 22, since Git uses port 443:

git clone https://github.com/your/repo.git .
# for a private repo, use a Personal Access Token when prompted for a password

Option B: File Manager / SFTP

Upload your project files (you can safely leave out node_modules — you'll install it next). Make sure the files land in htdocs/[your-domain]/, not your home folder.

3. Select your Node version and install dependencies

From your app folder, choose your Node version and install:

nvm use 22        # or 18 / 20 — match your project's requirement
npm install

(If you excluded node_modules from your upload, this step recreates it.)

4. Set the port, then start your app

Make sure your app listens on your site's assigned port. Most apps read it from a PORT environment variable — set it in your .env file:

PORT=3007   # use YOUR site's assigned port

Then start it with PM2 (pre-installed) so it stays running and restarts automatically:

# if your project has an npm start script:
pm2 start "npm run start" --name "my-app"

# or point directly at your entry file:
pm2 start app.js --name "my-app"

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

6. View it, then go live

Once your app is running on its assigned port, it's served on your site's preview address (yoursite-com.transpark.tech). Check it there first. When everything looks good, use the Go Live button on your site in the dashboard to switch from the preview address to your production domain.

Important notes

  • Your app must listen on your site's assigned port (set PORT to match) — a mismatch is the most common reason a new app shows an error page.
  • Our platform handles SSL/HTTPS for you — your app should listen on plain HTTP, not HTTPS.
  • Starting an app (npm install, pm2 start) requires a terminal session, which uses SSH. The File Manager can upload your files but can't run these commands — if your network blocks SSH, reply to a support ticket and we can start it for you once.
  • Node.js versions are managed via NVM — switch with nvm use 22.
  • Logs: pm2 logs my-app.

Still need help?

Our team responds within a few hours during business days.

Open a Support Ticket →