For a Node.js website, you put your app's code on the server and click Deploy. The platform installs the packages, builds the app and puts it live as soon as it responds.
Before you start
- The website was created as a Node.js website.
- Your code has a lockfile (package-lock.json, pnpm-lock.yaml or yarn.lock).
- Your app listens on the port in the environment variable
PORT.
Steps
- Go to Websites and open the website.
- Go to Website › Node.js.
- Under Version and commands, set:
- Kind of app: Node.js or Next.js;
- Source of the code: Upload (SFTP into source/);
- the Node.js version, the Build command and the Start command.
- Click Save.
- Put your code in the
source/folder via SFTP. - Click Deploy.
Good to know
- Deploying usually takes a few minutes. Your website stays available; the new version only takes over once it responds.
- If it fails, the current version keeps running. The log is under Last deploy.
- Under Kept versions, use Back to this version to go back to an earlier version.
- You put passwords and keys for your app under Environment variables.