deployship
Docs
Environment Variables

Environment Variables

Adding Variables

  1. Go to your Project page
  2. Click the Environment tab
  3. Add your key-value pairs
  4. Save — changes take effect on the next deployment

How Variables Are Injected

Environment variables are not written to a .env file on disk. They are:

  1. Stored encrypted (AES-256-GCM) in the DeployShip database
  2. Decrypted in memory at deploy time
  3. Exported as shell environment variables before each command runs
  4. Embedded in the PM2 ecosystem configuration so they persist across process restarts

This means your secrets are never written to the filesystem in plaintext, never appear in shell history, and are never visible in ps output.

The PORT Variable

DeployShip automatically sets PORT to the port assigned to your project. Do not add PORT manually — DeployShip manages it and it will always override any value you set.

Bulk Import

You can paste the contents of a .env file directly into the import field. DeployShip parses it and creates all variables at once.


Was this page helpful?