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
- Click + ADD APP in the DEPLOY tab
- Fill in:
| Field | Description |
|---|---|
| Name | Display name (e.g. frontend, api) |
| Working directory | Absolute path on server (e.g. /var/www/myapp) |
| Deploy command | Shell command to run on deploy |
| Startup command | Command to start the app (for PM2 auto-detect) |
- 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:
| Button | PM2 command |
|---|---|
| START | pm2 start <app> |
| STOP | pm2 stop <app> |
| RESTART | pm2 restart <app> |
| RELOAD | pm2 reload <app> (zero-downtime) |
| LOGS | Streams 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:
- KoreShell shows the last N deploy commands run
- Select a previous state to roll back to
- 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.