Build Commands
Overview
Section titled “Overview”Build commands are the heart of VPS Deployer. Each project has an ordered list of shell commands that run sequentially during deployment.
Adding Commands
Section titled “Adding Commands”On the project details page:
- Scroll to the Commands section
- Enter your command
- Click Add
Commands are numbered starting from 1 and execute in order.
Example Command Sequence
Section titled “Example Command Sequence”For a typical Node.js application:
1. git pull origin main2. npm install3. npm run build4. pm2 restart appFor a Docker-based deployment:
1. git pull origin main2. docker compose down3. docker compose build4. docker compose up -dImportant Rules
Section titled “Important Rules”Each Command Runs Independently
Section titled “Each Command Runs Independently”Commands do not share state. A cd in command 1 will not affect command 2. If you need to change directories, chain it:
cd /var/www/myapp && npm installWorking Directory
Section titled “Working Directory”All commands run inside the project workspace directory (<working-dir>/<project-id>/). This is where your repository is cloned.
PATH Environment Variable
Section titled “PATH Environment Variable”Custom paths configured in Settings → Path Settings are prepended to the system $PATH. This allows you to use tools installed in non-standard locations (e.g., Node.js via nvm, custom binaries) without needing to specify full paths in your commands.
For example, if you add /home/user/.nvm/versions/node/v24.14.0/bin to Path Settings, you can simply use node instead of the full path.
Timeout
Section titled “Timeout”Each command has a 5-minute timeout. If a command runs longer than that, it’s killed with SIGKILL and the deployment is marked as failed.
Dangerous Commands
Section titled “Dangerous Commands”The following are blocked:
rm -rf /shutdownrebootmkfs- Fork bombs (
:(){ :|:& };:)
This is a basic string-matching check, not a full security sandbox.
Exit Codes
Section titled “Exit Codes”- Exit code
0= success, next command runs - Non-zero exit code = failure, deployment stops
Reordering Commands
Section titled “Reordering Commands”You can reorder commands through the UI. The sequence number determines execution order.
Editing Commands
Section titled “Editing Commands”Click on any command to edit it. Changes take effect on the next deployment.