Node.js Hosting Requirements & Service Provider Selection Tips

Node.js Hosting Requirements & Service Provider Selection Tips

node.js hosting requirements

Having no idea what Node.js hosting requirements should be covered for your app?

Looking for the best Node.js hosting platform?

In this post, we’ll take an-indepth look at all the aspects and subtleties you should analyze to choose the best option.

Also we’ll provide a step-by-step tutorial on how to get Node.js applications hosted in the cloud on the example of Ghost publishing platform. 

Why Developers and Enterprises Prefer Node.js

Due to its simplicity, Node.js is gaining more and more popular among developers all over the world.

JavaScript code is quite easy-to-understand even for non-professionals, as well as the open-source platform facilitates the application development process.

Moreover, the Node Package Manager includes tons of pre-built modules, which accelerate development speed even more. Scalability, reduced response time and the ability to use the same language on server and client sides are also the proven benefits of Node.js. 

As for now most businesses and industries choose Node.js for building their projects. Such a runtime environment is perfect for modern applications because it scales quite well without additional investments into hardware.

REST APIs, real-time apps, single-pages and more can be easily built and executed on almost all known platforms. 

Choosing the Best Node.js Hosting Provider

Usually, once your Node.js application is ready to go live, you start looking for reliable and secure hosting for it.

In this guidance, we’ll go through the main aspects you should weigh before choosing the right hosting platform.

Not all the providers support an event-driven JavaScript runtime environment and development framework, so you should do careful research to find the best Node.js hosting for your app.

  • First of all, you should realize if you have enough time and skills for the system administration routine. If yes, you can get some cloud VM or VPS and install, deploy and manage everything on your own. But, if you prefer to focus on application code than a managed cloud hosting platform would be a perfect choice.
  • Estimate the expected traffic. The busier your site is the greater requirements should be set. VPS or some shared servers are a good and cheap solution for the start, but your investments will continue to rise along with the traffic.
  • Ensure the reliability of services you research. The right cloud hosting platform should be located in data centers with proven reliability.
  • Check data center locations in order to get the fastest access. 
  • Mind the support and the cost of vertical and horizontal scaling.
  • Ensure the clustering is supported to prevent failed transactions, error-filled shopping carts and lost work of the users.
  • Consider technology shifts and other possible modifications to have a portable website without any lock-in.
  • Foresee the in-built tools and frameworks you may need for site management and monitoring.
  • Compare additional benefits you can get from each Node.js hosting provider, e.g: SSL certificates, domains, etc.
  • Check out the uptime and downtime performance of each analyzed provider.

Why Hidora Cloud Hosting?

In this section, you’ll find some more details on how you can benefit from a reliable Node.js cloud hosting platform in terms of application development and management automation.

Hidora multi-cloud platform is fully in-line with the mentioned above Node.js hosting requirements and provides a really wide set of features, among which:

  • Node.js app deployment from tar, tar.gz, tar.bz2, zip packages or though git-push-deploy across multiple nodes
  • Automatiс application startup script detection
  • Code changes on the fly with supervisor support
  • Automatic vertical and horizontal scaling
  • Highly-available Node.js cluster with load balancing installed in a few clicks
  • Smart redirect from the shared load balancer to any other port which is listened by the node server
  • All the functionalities of Node Package Manager
  • Automatic Node.js memory configuration
  • Node.js server troubleshooting 

Node.js Deployment Sample: Ghost Publishing Platform Setup on Hidora Cloud

Let’s check out how easy Node.js app deployment can be with Hidora cloud platform on the example of the popular publishing platform – Ghost.

  1. Log into your Hidora dashboard and click the New Environment button.
  2. Select the Node.js tab in the appeared dialog, add MySQL database and specify the resource limits for the environment. After that name your environment and click Create.

Node.js Deployment
3. Download the needed
Ghost release from its repository at GitHub.

GitHub TryGhost

  1. Go back to the Hidora dashboard and upload the archive via the Deployment manager.Hidora dashboard Deployment manager
  2. Deploy the package to the environment you’ve created earlier.Hidora Deployment Manager
  3. Configure MySQL database via phpMyAdmin (use the credentials you’ve got while creating MySQL node by email to sign in).Configure MySQL Database
  4. Create the new database in the phpMyAdmin dashboard.
    Create the new database in the phpMyAdmin dashboard.
  5. Configure your Node.js server via Configuration File Manager:Configure your Node.js Server
  • In the /home/jelastic/ROOT/core/server/config/defaults.json file change url and server sections by replacing <environment URL> with the link to your environment and <internal IP of Node.js container> with the IP address of your Node.js server. Replace port 2368 with 8080.
{
“url”: “<environment URL>”,
  “server”: {
      “host”: “<internal IP of NodeJS container>”,
      “port”: 8080
  }
}
  • Node.js Server Configuration
    In the
    /home/jelastic/ROOT/core/server/config/env/config.development.json file replace the following:
“url”: “http://localhost:2368”,
  “database”: {
      “client”: “sqlite3”,
      “connection”: {
          “filename”: “content/data/ghost-dev.db”
      },
      “debug”: false
  }

with

“url”: “http://ghost.hidora.com”,
  “database”: {
      “client”: “mysql”,
      “connection”: {
          “host” : “10.102.10.105”,
          “user” : “root”,
          “password” : “RRLlxp22173”,
          “database” : “ghost”
      }
  }

Where:

“url”: “http://ghost.hidora.com” – environment url

“client”: “mysql” – used database type

“Host”: “10.102.10.105” – platform internal IP address of database node

“user”: “root” the database username from email

“password”: “RRLlxp22173” the database password from email

“database”: “ghost” – your database name

Node.js Hosting Configuration

  • In the /home/jelastic/ROOT/core/server/config/env/config.production.json file also replace the next parameters:

“database”: {
      “client”: “mysql”,
      “connection”: {
          “host” : “127.0.0.1”,
          “user” : “root”,
          “password” : “”,
          “database” : “ghost”
      }
  }

with

“database”: {
      “client”: “mysql”,
      “connection”: {
          “host” : “10.102.10.105”,
          “user” : “root”,
          “password” : “RRLlxp22173”,
          “database” : “ghost”
      }
  }
  1. Connect to your Node.js server via Web SSH and execute the following commands one-by-one in order to setup database migration tool for knex (a query builder for MySQL):
cd ROOT
sudo npm install -g knex-migrator
knex-migrator init

Connect to you Node.js via Web SSH
Application Servers Web SSH

  1. Restart the Node.js server to apply the changes you’ve made.Restart the Node.js Server

That’s it! Your Ghost application has been successfully hosted within the Hidora platform. Just click Open in Browser and you can get started.

Ghost Application within the Hidora PlatformGhost the professional publishing platform
We hope this tutorial will help to find the best Node.js hosting solution for your application. If your app requires any other specific hosting options and features do not hesitate to contact
our support team, we’re always happy to help.