Deploying Node.js applications
Node.js on Ploi Cloud
Ploi Cloud provides comprehensive support for Node.js applications, from simple Express APIs to complex Next.js applications. Deploy your Node.js apps with confidence using our optimized container infrastructure.
Supported frameworks
Ploi Cloud supports any Node.js framework or application, including:
- Express.js - Fast, unopinionated web framework
- Next.js - Full-stack React framework
- Nuxt.js - Vue.js framework
- Nest.js - Progressive Node.js framework
- Fastify - High-performance web framework
- Static site generators - Gatsby, VitePress, Docusaurus
- Build tools - Vite, Webpack, Parcel
- Custom Node.js applications - Any application that runs on port 3000
Deployment modes
Node.js applications can be deployed in two modes:
Runtime mode (with start command)
Your application runs as a Node.js server on port 3000. Perfect for:
- APIs and backend services
- Server-side rendered applications
- Real-time applications with WebSockets
- Applications requiring server-side logic
Static mode (without start command)
Your built files are served by Nginx on port 8080. Ideal for:
- Single-page applications (SPAs)
- Pre-built static sites
- Generated documentation
- Client-side only applications
Start command configuration
The start command determines how your application runs:
Common start commands:
npm run start
- Default, uses the start script from package.jsonnode server.js
- Direct Node.js executionnode dist/index.js
- For TypeScript applicationsnpx next start
- Next.js production serveryarn start
- Using Yarn package manager
Leave the start command empty for static file serving.
Automatic configuration
When you create a Node.js application, Ploi Cloud automatically:
- Sets Node.js version 22 as default
- Configures build commands for your application
- Sets the default start command to
npm run start
- Installs both npm and yarn package managers
- Configures the correct port based on your deployment mode
Build commands
Build commands run during the deployment process:
npm ci
npm run build
You can customize these in the Build Configuration section. Common patterns:
- npm:
npm ci && npm run build
- yarn:
yarn install --frozen-lockfile && yarn build
Database connections
Add database services to your Node.js application:
- Navigate to your application's Services tab
- Click "Add service" and select your database type
- Connection details are automatically injected as environment variables
Worker services
Run background jobs or long-running processes:
- Add a Worker service in your application
- Set the command (e.g.,
node worker.js
) - Workers share the same code and storage volumes