Skip to main content

Deploy

The DEPLOY tab manages application deployments, process management via PM2, and script-based deploys — all over SSH.

Overview

Each server can have multiple app definitions. An app definition stores:

  • App name and working directory
  • Deploy command (e.g. git pull && npm install && pm2 restart myapp)
  • Environment (optional label)

Once defined, deploy with one click and watch the log stream live.

Adding an App

  1. Click + ADD APP in the DEPLOY tab
  2. Fill in:
FieldDescription
NameDisplay name (e.g. frontend, api)
Working directoryAbsolute path on server (e.g. /var/www/myapp)
Deploy commandShell command to run on deploy
Startup commandCommand to start the app (for PM2 auto-detect)
  1. Click SAVE

Deploying

Click ▶ DEPLOY on any app card. A log panel opens and streams the deploy command output in real time.

If the deploy command exits with a non-zero code, the status shows FAILED and the full output is preserved in history.

PM2 Integration

If PM2 is installed on the server, KoreShell detects it and shows PM2 process controls on each app card:

ButtonPM2 command
STARTpm2 start <app>
STOPpm2 stop <app>
RESTARTpm2 restart <app>
RELOADpm2 reload <app> (zero-downtime)
LOGSStreams pm2 logs <app> to the panel

The PM2 process list refreshes automatically. Status badges show online, stopped, or errored per process.

Rollback

If a deploy fails or you need to revert, click ↩ ROLLBACK:

  1. KoreShell shows the last N deploy commands run
  2. Select a previous state to roll back to
  3. Confirm — the rollback command runs and streams output

:::tip Zero-downtime rollback For Node.js apps, use pm2 reload instead of restart in your deploy command to avoid connection drops during rollback. :::

Deploy History

Each app keeps a history of all deploys: timestamp, command, exit code, and full log. Click an app → HISTORY to review past deployments.

Example Deploy Commands

Node.js (PM2)

cd /var/www/myapp && git pull origin main && npm ci --omit=dev && pm2 reload myapp

Python / Gunicorn

cd /var/www/myapi && git pull && pip install -r requirements.txt && systemctl restart myapi

Docker Compose

cd /opt/myapp && git pull && docker compose pull && docker compose up -d

Static site (Nginx)

cd /var/www/html && git pull && nginx -s reload

Tip: Use Scripts for Complex Deploys

For multi-step deployments, define the logic in a Script and call it from the deploy command:

bash /home/ubuntu/scripts/deploy-myapp.sh

Scripts can use secret variables for tokens and passwords without exposing them in the deploy command.