Skip to main content

orphelix rebuild

Rebuild the Next.js application and restart PM2 process. This is useful after making code changes.

What it does

The rebuild command performs four steps:
  1. Update Dependencies - Checks for and updates outdated dev dependencies
  2. Build - Runs npm run build to create production build
  3. Sync Assets - Copies static assets to standalone build
  4. Restart - Restarts the PM2 process with new code

Usage

orphelix rebuild [options]

Options

OptionAliasDescription
--port-pCustom port
--name-nInstance name

Example

# Rebuild default instance
orphelix rebuild

# Rebuild specific instance
orphelix rebuild --name prod

# Rebuild with custom port
orphelix rebuild --port 8080

When to use

Use rebuild when:
  • You’ve made code changes and want to deploy them
  • You’ve pulled latest changes from git
  • You’ve updated dependencies
  • You need a fresh build

Difference from restart

CommandWhat it does
restartOnly restarts PM2 process (fast, ~1s)
rebuildBuilds + restarts (slower, ~30-60s)
Use restart for configuration changes, use rebuild for code changes.
  • start - Start Orphelix
  • restart - Quick restart without rebuild
  • stop - Stop Orphelix