Node.js
The Node.js component gives you a standard runtime for JavaScript or TypeScript backends. Reach for it when you need an API, webhook processor, or background worker built with the Node ecosystem. Diploi builds and deploys your code while keeping environment variables and dependencies managed.
Add to your project
Section titled “Add to your project”Paste this entry into the components list in diploi.yaml to add Node.js to your project.
components: - name: Node.js identifier: node package: https://github.com/diploi/component-nodejs#v24.14.0Node.js reference
Section titled “Node.js reference”Readme
Section titled “Readme”Start a demo environment (No card or registration needed) https://diploi.com/component/node
A generic Node.js component that can be used to run any Node.js app.
Uses the official node Docker image.
Operation
Section titled “Operation”Getting started
Section titled “Getting started”- In the Dashboard, click Create Project +
- Under Pick Components, choose Node.js
- In Pick Add-ons, you can add one or multiple databases to your app
- Choose Create Repository, which will generate a new GitHub repo
- Lastly, click Launch Stack
Link to guide (includes additional information) https://diploi.com/blog/hosting_node_apps
Development
Section titled “Development”Will run npm install when component is first initialized, and npm run dev when deployment is started.
Production
Section titled “Production”Will build a production ready image. Image runs npm install & npm build when being created. Once the image runs, npm start is called.
- If you are using packages that use native libraries (like
node-canvase.g.), it is a good idea to switch theDockerfileandDockerfile.devto usenode:XXinstead ofnode:XX-slim. You can also add any missing libraries withRUN apt update && apt install -y <package>in the dockerfiles.