Node.js hosting
JavaScript runtime for APIs and server applications. Deploy to a dedicated VPS in seconds — database auto-created, SSL installed, firewall locked down from the first boot.
20, 22, 24
Versions
MongoDB
Database
MERN
Category
What is Node.js?
Node.js is an open-source, cross-platform JavaScript runtime built on Google's V8 JavaScript engine. It allows JavaScript code to run outside the browser and is widely used for APIs, web applications, backend services, command-line tools, automation, real-time applications and network services.
Node.js uses an event-driven architecture with asynchronous, non-blocking I/O APIs. This makes it well suited for applications that spend significant time waiting for network, database, filesystem or other I/O operations.
A Node.js application can expose HTTP APIs, process webhooks, communicate with databases, handle WebSocket connections, run background workers and integrate with external services. Applications can be built directly with Node.js or with frameworks such as Express, Fastify, NestJS and other JavaScript or TypeScript frameworks.
SharkCluster provides the server environment around your Node.js application. You can deploy a Node.js project, select the required runtime version, install dependencies, configure environment variables, run the application with a process manager, connect a database, configure your domain and enable HTTPS.
Quick facts
- Version
- 20, 22, 24
- Database
- MongoDB
- Category
- MERN
- SSL included
- Firewall locked
- DB auto-created
- Live in minutes
Why Node.js on SharkCluster?
JavaScript on the server
Run JavaScript outside the browser and use the same language across frontend and backend applications.
Asynchronous architecture
Node.js provides asynchronous and non-blocking I/O APIs that are well suited to network-intensive and I/O-heavy applications.
API development
Build REST APIs, GraphQL services, backend applications and microservices using Node.js and its large ecosystem.
Real-time applications
Build chat applications, notifications, collaboration tools, dashboards and other real-time services using WebSockets and compatible libraries.
Large package ecosystem
Use npm and the broader JavaScript ecosystem to integrate frameworks, libraries, database drivers, authentication systems and other application components.
TypeScript support
Node.js applications can be developed with TypeScript using an appropriate build or runtime toolchain.
Background workers
Run queue workers, scheduled tasks, data processors and other long-running backend processes alongside web applications.
Production deployment
Run Node.js applications behind nginx or another reverse proxy with a process manager, HTTPS, environment configuration and monitoring.
What you get with Node.js
Node.js 20, 22 and 24 runtime options
npm package manager
Automatic dependency installation
Environment variable configuration
Process manager configuration
Automatic application restart
Application log access
nginx reverse proxy
HTTPS with a free SSL certificate
Custom domain and subdomain support
REST API deployment
Webhook endpoint support
WebSocket and real-time application support
Background worker support
Scheduled task support
Git-based deployment
Custom start command support
Production environment configuration
Dedicated application system user
Firewall and server-level security controls
Application port configuration
Database connection support
What Node.js is built for
REST APIs
Build backend APIs for web applications, mobile applications, SaaS products and external integrations.
Real-time applications
Build chat systems, live dashboards, notifications, collaboration tools and other applications that require persistent or low-latency connections.
SaaS applications
Run Node.js backends for multi-user SaaS platforms, dashboards, authentication services and business applications.
Webhooks
Receive and process webhook events from payment providers, Git platforms, communication tools and other external services.
Microservices
Deploy independent backend services that communicate through HTTP APIs, queues or other application protocols.
Background workers
Run queue workers, email processors, data processing services and other long-running backend jobs.
Automation services
Create automation APIs, scheduled services, integrations and command-line applications using Node.js.
Full-stack JavaScript
Use Node.js as the backend runtime for applications whose frontend and backend are both built with JavaScript or TypeScript.
Server specs for
Node.js
Not sure which plan to pick? The panel warns you before you deploy so you can choose the right size the first time.
- Minimum specs shown before deploy
- Panel blocks deploy if server is undersized
- Upgrade path available inside the panel
- Node.js
- Node.js 22+ or a supported LTS version.
- Operating system
- Linux recommended for production deployments.
- Web server
- nginx recommended as a reverse proxy.
- Database
- MongoDB, MySQL, PostgreSQL, or another supported database.
- Memory
- 2 GB RAM minimum; 4 GB+ recommended for production.
- CPU
- 1–2 vCPU minimum; 2+ vCPU recommended for production.
- Storage
- 10 GB+ SSD recommended, depending on application and data.
How Node.js fits together
Domain
Your application domain or subdomain points to the SharkCluster server through DNS.
nginx
nginx receives HTTP and HTTPS requests, handles TLS termination and reverse-proxies application traffic to the Node.js process.
Node.js runtime
Node.js executes the application's JavaScript or compiled JavaScript code using the V8 JavaScript engine.
Application
Your Node.js application handles HTTP requests, business logic, authentication, APIs, webhooks, database operations and integrations.
Process manager
A process manager such as PM2 can keep the Node.js application running, restart it after failures and provide process and log management.
npm
npm is commonly used to install and manage application dependencies defined in package.json.
Database
Node.js applications can connect to MongoDB, PostgreSQL, MySQL, Redis, SQLite and other supported data stores through appropriate drivers or libraries.
Environment configuration
Environment variables can be used for application settings, database connections, API credentials, ports and other runtime configuration.
Background workers
Separate Node.js processes can handle queues, scheduled jobs, email processing and other background workloads.
Match your runtime to Node.js
Use an LTS release
For production applications, use an actively supported Node.js LTS release whenever possible. The Node.js project recommends Active LTS or Maintenance LTS releases for production applications.
Node.js 24
Node.js 24 is an LTS release and is a suitable choice for new applications when application dependencies support it.
Node.js 22
Node.js 22 is an LTS release and is suitable for production applications that require this runtime generation.
Node.js 20
Node.js 20 reached End-of-Life on March 24, 2026. It should generally be treated as a legacy runtime and should not be selected for new production applications unless there is a specific compatibility requirement.
Node.js 18 and 16
Node.js 18 and 16 are also End-of-Life. Existing applications may require them temporarily, but migration to a supported Node.js release should be planned.
Check dependencies before upgrading
Before changing Node.js versions, verify package compatibility, native modules, framework requirements, build tooling and application-specific dependencies.
After your Node.js deploy
- 1
Choose a server
Select a server size and region based on expected traffic, API workload, WebSocket connections, background jobs and memory requirements.
- 2
Select Node.js
Choose a Node.js version compatible with your application dependencies. Use an actively supported LTS release for new production applications.
- 3
Configure the domain
Point your application domain or subdomain to the server IP address using the appropriate DNS record.
- 4
Deploy the application
Upload or clone the Node.js project and install the dependencies defined in package.json.
- 5
Configure environment variables
Set production environment variables such as database connections, application secrets, API credentials, ports and other runtime settings.
- 6
Build the application
Run the application's production build command when the project uses TypeScript, bundling or another build process.
- 7
Configure the start command
Configure the command used to start the production Node.js application, such as the project's defined npm start script.
- 8
Configure the process manager
Run the application under a process manager such as PM2 so it can restart after failures and remain available after terminal sessions end.
- 9
Configure the reverse proxy
Configure nginx to proxy requests from the public domain to the Node.js application port.
- 10
Enable HTTPS
Install and configure the SSL certificate and verify that HTTPS requests reach the application correctly.
- 11
Test the application
Test API endpoints, authentication, database connections, webhooks, background jobs, WebSocket connections and important application workflows before launch.
Ship Node.js your way
Select Node.js version
Use an actively supported LTS version for new production deployments and select an older release only when application compatibility requires it.
Application source
Deploy the application from Git or upload the application files to the configured application directory.
Install dependencies
Install production dependencies using the package manager and lockfile appropriate for the project.
Environment variables
Configure production environment variables without committing secrets or credentials to the application repository.
Build application
Run the required production build command before starting applications that use TypeScript, frontend bundling or another build step.
Start command
Verify the production start command defined by the application and make sure it listens on the configured interface and port.
Application port
Configure the Node.js application to listen on an internal server port and expose it publicly through the reverse proxy rather than opening the application port unnecessarily.
Process manager
Run long-lived Node.js applications through a process manager such as PM2 and configure automatic startup where required.
Reverse proxy
Configure nginx to forward requests from the public domain to the Node.js application.
HTTPS
Enable HTTPS with a free SSL certificate and verify HTTP-to-HTTPS redirection where appropriate.
File permissions
Use a dedicated application user and configure secure ownership and permissions for application files.
Database
Configure the required database connection and verify that the application can authenticate and communicate with the selected database service.
Logs
Configure application and process-manager logs and monitor them for startup errors, request failures and unexpected application exits.
Background jobs
Configure workers or scheduled jobs separately when the application requires asynchronous processing.
Test before launch
Test authentication, API endpoints, database operations, webhooks, file uploads, background jobs and external integrations before production launch.
Keeping Node.js fast
Asynchronous I/O
Use Node.js's asynchronous APIs for network, filesystem and database operations to avoid unnecessary blocking of the event loop.
Avoid blocking the event loop
CPU-heavy or synchronous operations can block the Node.js event loop. Move expensive workloads to worker threads, separate processes or background workers when appropriate.
Process management
Use a process manager or service manager to keep production applications running and restart them when necessary.
Horizontal scaling
Applications that support multiple processes or instances can scale across CPU cores and multiple servers when their architecture supports shared state and load balancing.
Database optimization
Use appropriate indexes, connection pooling and efficient queries for the application's database workload.
Caching
Use an appropriate caching layer such as Redis when repeated database queries or expensive operations can benefit from cached data.
Reverse proxy
Use nginx or another reverse proxy to handle TLS, connection management, static assets and routing in front of the Node.js application.
Static assets
Serve large static assets through a CDN or optimized web-server configuration where appropriate instead of processing every static request through Node.js.
Connection management
Configure appropriate database, HTTP and WebSocket connection limits and monitor resource usage under realistic production workloads.
Before you go live
Supported Node.js LTS version selected
Application source deployed
package.json is present
Lockfile is present and appropriate for the project
Production dependencies installed
Production build completed where required
Environment variables configured
Application start command verified
Application listens on the expected port
Process manager is configured
Automatic process restart is configured
nginx reverse proxy is configured
Domain DNS points to the server
HTTPS certificate is active
Application database connection is working
Application logs are accessible
Background workers are configured where required
Scheduled jobs are configured where required
Webhook endpoints have been tested
API endpoints have been tested
Authentication has been tested
External integrations have been tested
Ready your Node.js for launch
Use a supported Node.js LTS release
Avoid EOL Node.js versions for new deployments
Keep package dependencies maintained
Use a lockfile for reproducible installations
Run the application in production mode
Keep secrets out of source control
Configure environment variables securely
Use a dedicated application system user
Run the application behind nginx or another reverse proxy
Enable HTTPS
Use a process manager or system service
Configure automatic restart
Configure application logging
Monitor CPU and memory usage
Monitor application errors
Use secure database credentials
Restrict database access where possible
Use a firewall
Keep the operating system updated
Keep Node.js and dependencies updated
Remove unused dependencies
Configure backups for application data
Test database restoration where applicable
Test API endpoints
Test authentication
Test webhooks
Test background workers
Test scheduled jobs
Working with Node.js
Check Node.js version
Display the installed Node.js version.
node -vCheck npm version
Display the installed npm version.
npm -vInstall dependencies
Install the dependencies defined in package.json.
npm installClean production install
Install dependencies from the lockfile without installing development dependencies.
npm ci --omit=devRun application
Start the application using the start script defined in package.json.
npm startRun development mode
Start the development command defined by the project.
npm run devBuild application
Run the production build command defined by the project.
npm run buildList outdated packages
Check installed packages for available updates.
npm outdatedAudit dependencies
Check installed npm dependencies for reported security vulnerabilities.
npm auditList PM2 processes
Display Node.js applications managed by PM2.
pm2 listView application logs
Display logs for PM2-managed applications.
pm2 logsRestart application
Restart a PM2-managed Node.js application.
pm2 restart <app-name>Check listening ports
Display TCP ports currently listening on the server.
ss -lntpCommon Node.js issues & fixes
502 Bad Gateway
- Cause
- nginx cannot connect to the Node.js application on the configured port.
- Solution
- Check whether the Node.js process is running, verify the application port, confirm the nginx proxy configuration and inspect application and nginx logs.
Application exits immediately
- Cause
- The start command may be incorrect, a required environment variable may be missing, a dependency may be unavailable or the application may be throwing an error during startup.
- Solution
- Run the production start command manually, inspect application logs and verify environment variables, dependencies and configuration.
Cannot connect to database
- Cause
- The database URL, credentials, network access, database service or application database configuration may be incorrect.
- Solution
- Verify the database service, connection string, credentials, network access and database-driver configuration.
Port already in use
- Cause
- Another process is already listening on the port configured for the Node.js application.
- Solution
- Identify the process using the port, stop or reconfigure the conflicting service and restart the Node.js application.
npm install fails
- Cause
- A dependency may not support the selected Node.js version, the lockfile may be inconsistent or a native dependency may require additional system libraries.
- Solution
- Check the npm error output, verify Node.js compatibility, use the correct package manager and lockfile and install required build dependencies.
Application becomes unresponsive
- Cause
- The Node.js event loop may be blocked by CPU-heavy or synchronous operations, or the application may be exhausted by memory, database or external-service workload.
- Solution
- Inspect CPU and memory usage, review application profiling and logs, identify blocking operations and move expensive workloads to workers or separate processes where appropriate.
WebSocket connection fails
- Cause
- The reverse proxy may not be forwarding WebSocket upgrade headers correctly or the application may be listening on the wrong interface or port.
- Solution
- Verify WebSocket proxy configuration, application port, firewall rules and client connection URL.
Environment variables are missing
- Cause
- Production variables may not have been configured for the process manager or service running the application.
- Solution
- Verify the environment configuration used by the production process and restart the application after changing variables.
High memory usage
- Cause
- The application may have a memory leak, large in-memory datasets, excessive caching, too many connections or unexpectedly large workloads.
- Solution
- Monitor memory usage, inspect application behavior, review heap usage and database connections and identify workloads that retain unnecessary objects.
High CPU usage
- Cause
- CPU-intensive application logic, inefficient loops, large synchronous operations or excessive concurrent processing may be blocking the Node.js process.
- Solution
- Profile the application, identify CPU-heavy operations and move suitable workloads to worker threads, background jobs or separate processes.
Webhook requests fail
- Cause
- The webhook URL, HTTPS configuration, reverse proxy, firewall or application route may be incorrect.
- Solution
- Verify DNS, HTTPS, nginx routing, application routes, request methods and application logs.
Application works locally but not in production
- Cause
- Production environment variables, Node.js version, filesystem paths, network access, database configuration or build output may differ from the development environment.
- Solution
- Compare runtime versions, environment variables, dependencies, build artifacts, filesystem paths and external service configuration between environments.
Process manager keeps restarting the application
- Cause
- The application is repeatedly exiting because of startup errors, missing configuration, memory exhaustion or an unhandled runtime failure.
- Solution
- Inspect process-manager logs and application logs, run the start command manually and fix the underlying application error before restarting repeatedly.
Hardened before your first request
Every deploy is locked down from boot — closed firewall, valid SSL, and restricted access by default.
Use an actively supported Node.js LTS release for production applications.
Avoid deploying new applications on EOL Node.js versions.
Keep npm dependencies updated and review security advisories.
Run npm audit and investigate relevant vulnerabilities.
Do not commit API keys, database passwords or application secrets to source control.
Use environment variables or an appropriate secret-management mechanism for sensitive configuration.
Run the application under a dedicated non-root system user.
Keep the Node.js application behind a reverse proxy where appropriate.
Enable HTTPS for public applications.
Use secure database credentials and restrict database network access.
Validate and sanitize untrusted input.
Implement authentication and authorization at the application level.
Configure appropriate CORS policies.
Use rate limiting for publicly exposed APIs where appropriate.
Keep the operating system and server packages updated.
Use a firewall to restrict unnecessary network access.
Monitor application and authentication logs.
Remove unused dependencies and packages.
The data layer behind Node.js
Node.js does not require a database
Node.js is a runtime rather than a database-driven application platform. A Node.js application may use a database or may operate without one depending on its architecture.
MongoDB
MongoDB is a common database choice for Node.js applications and can be connected using the official MongoDB driver or application frameworks and libraries.
PostgreSQL
PostgreSQL is suitable for Node.js applications that require relational data, transactions, complex queries and strong database consistency.
MySQL
MySQL can be used by Node.js applications through compatible drivers and libraries for relational application data.
Redis
Redis can be used for caching, sessions, queues, rate limiting and other high-speed data workloads when appropriate.
Connection management
Production applications should use appropriate connection pooling and close or release resources correctly to avoid exhausting database connections.
Database backups
Database backups should be configured according to the database technology and application's recovery requirements.
Node.js environment configuration
Production mode
Run the application using its production configuration and avoid exposing development servers directly to the public internet.
Environment variables
Store environment-specific configuration outside source code and ensure secrets are not committed to Git repositories.
Logging
Configure application and process-manager logs so startup failures, runtime errors, warnings and unexpected process exits can be investigated.
Error handling
Implement appropriate error handling for asynchronous operations, HTTP requests, database operations and external services.
Graceful shutdown
Production applications should handle termination signals and close HTTP servers, database connections, queues and other resources cleanly where appropriate.
Email and SMTP
Applications that send email should use a reliable SMTP or transactional email provider instead of relying on the server's default mail configuration.
Health checks
Expose an appropriate health-check endpoint or monitoring mechanism so the deployment environment can determine whether the application is functioning correctly.
Automations that run on schedule
Scheduled Node.js tasks
Node.js applications can perform scheduled work using a server-level cron job, a dedicated scheduler, a queue system or an application-level scheduling library.
Production recommendation
For important production jobs, prefer a scheduling mechanism that provides reliable execution, logging and failure visibility instead of relying on a process running only in an interactive terminal.
Separate workers
Long-running or resource-intensive scheduled jobs should often run as dedicated worker processes rather than blocking the main HTTP application.
Avoid duplicate jobs
When multiple Node.js application instances are running, scheduled jobs must be designed to avoid executing the same task multiple times unless duplicate execution is intentionally supported.
Lock down Node.js from day one
Use a supported Node.js LTS release
Avoid EOL Node.js versions
Keep npm dependencies updated
Run dependency security audits
Keep secrets out of source control
Use secure environment variables
Run under a dedicated application user
Enable HTTPS
Use secure database credentials
Restrict database access
Validate user input
Configure authentication and authorization
Configure CORS appropriately
Use API rate limiting where appropriate
Keep the operating system updated
Configure a firewall
Monitor application logs
Remove unused dependencies
Maintain application and data backups
A safe Node.js upgrade path
- 1
Identify the current version
Check the current Node.js version, npm version, framework version and installed dependencies before starting an upgrade.
- 2
Review dependency compatibility
Check whether the application's framework, native modules, build tools and important dependencies support the target Node.js version.
- 3
Create a backup
Back up application data, database data and configuration required to restore the production environment.
- 4
Update dependencies carefully
Review dependency changes separately from the Node.js runtime upgrade when possible so compatibility problems are easier to identify.
- 5
Test on staging
Deploy the application to a staging environment using the target Node.js version and run the application's test suite and important workflows.
- 6
Build production artifacts
Create the production build using the target Node.js version and verify that native dependencies compile correctly.
- 7
Deploy
Switch the production application to the tested Node.js runtime using a controlled deployment process.
- 8
Verify
Test APIs, authentication, database operations, webhooks, WebSockets, background workers and external integrations.
- 9
Rollback if necessary
If the upgrade introduces a critical problem, restore the previous runtime and application version using the tested rollback procedure.
Take a snapshot before every upgrade so a bad release can be rolled back in minutes.
We manage the server, you own the store
SharkCluster manages
- VPS infrastructure
- Node.js runtime
- nginx reverse proxy
- Process manager
- SSL
- Firewall
- Server-level cron
- Backups where enabled
- Application deployment infrastructure
- Server monitoring
You manage
- Node.js application code
- package.json
- Application dependencies
- Environment variables
- Application configuration
- Database schema and queries
- API authentication
- Business logic
- Webhooks
- Background workers
- Third-party integrations
Everything below the application line — from nginx to backups — is infrastructure. Your code, content and store configuration are always yours, and you keep full SSH and root access.
Frequently Asked Questions
The questions we hear most from people deploying Node.js on SharkCluster.
Contact supportNode.js is an open-source, cross-platform JavaScript runtime built on the V8 JavaScript engine. It allows JavaScript applications to run on servers and is commonly used for APIs, web applications, real-time services, automation and background processing.
For new production applications, use an actively supported LTS release. As of September 2026, Node.js 22 and 24 are supported LTS lines. Node.js 20, 18 and 16 are EOL.
No. Node.js does not require MongoDB. It can work with MongoDB, PostgreSQL, MySQL, Redis, SQLite and many other databases, or it can run without a database.
Yes. MongoDB is commonly used with Node.js applications through the MongoDB Node.js driver and compatible application libraries.
Yes. Node.js applications can connect to PostgreSQL, MySQL and other relational databases through appropriate drivers and libraries.
Yes. Node.js is widely used for HTTP APIs and backend services. Frameworks such as Express, Fastify and NestJS can be used to structure API applications.
Yes. Node.js is suitable for real-time applications such as chat, notifications and live dashboards when combined with WebSockets or compatible real-time libraries.
No. A process manager such as PM2 is a separate tool. SharkCluster can configure a process manager for production Node.js applications.
Yes. TypeScript applications can be deployed after compiling them to JavaScript or by using an appropriate production TypeScript runtime or build setup.
Yes. npm is the standard package manager distributed with Node.js and provides access to a large ecosystem of JavaScript packages.
Yes. Node.js can run separate worker processes for queues, email processing, scheduled tasks, data processing and other background workloads.
Yes. Node.js applications can be triggered by server-level cron jobs, scheduling libraries, queues or dedicated job-processing systems. The appropriate method depends on the application's architecture.
Yes, but the application dependencies, framework, native modules and build tooling should be tested against the target Node.js version before changing a production environment.
A 502 response commonly means the reverse proxy cannot connect to the Node.js application. Check whether the process is running, confirm the configured port and inspect nginx and application logs.
Production may use different Node.js versions, environment variables, dependency versions, filesystem paths, network access or database configuration. Compare these settings between the local and production environments.
Yes. In production, HTTPS is commonly terminated at nginx or another reverse proxy, which then forwards requests to the internal Node.js application.
Yes. Node.js is well suited for webhook endpoints. The application can expose HTTPS routes that receive events from payment systems, Git providers, communication platforms and other services.
Yes. Multiple applications can run on different internal ports and use separate domains or subdomains through the reverse proxy.
Usually no. A production application can listen on an internal server port while nginx handles public HTTPS traffic and proxies requests to the application.
Check dependency compatibility, back up application data, test the new Node.js version in staging, build the application, deploy the tested version and verify APIs, databases, workers and integrations before completing the production upgrade.
SharkCluster manages the server and deployment environment, including the Node.js runtime, reverse proxy, process manager, SSL, firewall and related infrastructure. Your application code, dependencies, business logic and application-level configuration remain under your control.
From deploy to live in minutes
Stack configured
Runtime, process manager and config files set up for you.
MongoDB wired
Database created with a user and credentials in your config.
SSL + firewall
Free Let's Encrypt certificate and closed-by-default UFW rules.
Deploy anytime
Push with Git, or use the built-in file manager and ZIP upload.
How do you start
with SharkCluster?
To start with SharkCluster, create an account and your first server on DigitalOcean, Contabo or OVHcloud — no credit card or lock-in contract is needed. Every account includes free self-hosted business apps, free local backups, unlimited migrations and a dedicated DevOps manager.