You have no idea what Node.js hosting needs to be covered for your application?
Looking for the best Node.js hosting platform?
In this article, we will take an in-depth look at all the aspects and subtleties that you need to analyse to choose the best option.
We will also provide a step-by-step tutorial on how to get Node.js applications hosted in the cloud on the Ghost publishing platform example.
Why developers and businesses prefer Node.js
Because of its simplicity, Node.js is becoming increasingly popular among developers around the world.
The JavaScript code is fairly easy to understand, even for non-professionals, and the open-source platform facilitates the application development process.
In addition, the Node package manager includes tons of pre-built modules, which further accelerate development speed. Scalability, reduced response time and the ability to use the same language on the server and client side are also proven advantages of Node.js.
Today, most companies and industries choose Node.js to develop their projects. Such a runtime environment is perfect for modern applications because it scales very well without additional investments in hardware.
REST APIs, real-time applications, single pages and more can be easily built and run on almost any known platform.
Choosing the best Node.js hosting provider
In general, once your Node.js application is ready to go live, you start looking for reliable and secure hosting for it.
In this guide, we will review the main aspects you need to evaluate before choosing the right hosting platform.
Not all providers offer support for an event-driven JavaScript runtime environment and development framework. So you need to do some thorough research to find the best Node.js hosting for your application.
- First of all, you should ask yourself if you have enough time and skills for the system administration routine. If so, you can get a cloud VM or VPS and install, deploy and manage everything yourself. But if you prefer to focus on the application code, a cloud managed hosting platform would be a perfect choice.
- Estimate the expected traffic. The more traffic your site gets, the higher the requirements. VPS or some shared servers are a good and cheap way to start, but your investments will continue to grow as the traffic increases.
- Make sure the services you are looking for are reliable. The right cloud hosting platform should be located in data centres with proven reliability.
- Check the location of data centres to get the fastest access.
- Be aware of the support site and the cost of vertical and horizontal scaling.
- Ensure that clustering is supported to avoid failed transactions, error-filled baskets and loss of user work.
- Take into account technological changes and other possible modifications in order to have a portable website without any lock-in.
- Plan for the integrated tools and frameworks you may need for site management and monitoring.
- Compare the additional benefits you can get from each Node.js hosting provider, e.g. SSL certificates, domains, etc.
- Check the uptime and downtime performance of each supplier analysed.
Why choose Hidora Cloud hosting?
In this section you will 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.
The Hidora multi-cloud platform is fully compliant with the Node.js hosting requirements mentioned above and offers a wide range of features, including :
- Deploy Node.js applications from tar, tar.gz, tar.bz2, zip packages or via git-push-deploy on multiple nodes.
- Automatic detection of the application startup script
- On-the-fly code changes with the support supervisor
- Automatic vertical and horizontal scaling
- High availability Node.js cluster with load balancing installed in a few clicks
- Intelligent redirection from the shared load balancer to any other port listened to by the node server.
- All the features of the Node package manager
- Automatic memory configuration of Node.js
- Troubleshooting Node.js servers
Node.js Deployment Example: Ghost Publishing Platform Configuration on Hidora Cloud
Let’s check out how easy deploying a Node.js application can be with the Hidora cloud platform by taking the example of the popular publishing platform - Ghost.
Log into your Hidora dashboard and click the New Environment button.
Select the Node.js tab in the dialog box that appears, add the MySQL database and specify the resource limits for the environment. After that, name your environment and click Create.
Download the required version of Ghost from its GitHub.
Return to the Hidora dashboard and download the archive via the deployment manager.
Deploy the package in the environment you created earlier.
Configure the MySQL database via phpMyAdmin (use the credentials you obtained when creating the MySQL node by email to log in).
Create the new database in the phpMyAdmin dashboard.
Configure your Node.js server via the configuration file manager :
- In the file defaults.json, change the url and server sections to the link to your environment and the IP address of your Node.js server. Replace port 2368 with 8080.
{
"url": "",
"server": {
"host": "",
"port": 8080
}
}
In the file config.development.json, replace the following:
"url": "http://localhost:2368",
"database": {
"client": "sqlite3",
"connection": {
"filename": "content/data/ghost-dev.db"
},
"debug": false
}
// Replace 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” - url of the environment
“client”: “mysql” - type of database used
“Host”: “10.102.10.105” - internal IP address of the database node platform
“user”: “root” - the user name of the database from the e-mail
“password”: “RRLlxp22173” - the database password from the e-mail
“database”: “ghost” - the name of your database
In the file config.production.json, also replace the following parameters:
"database": {
"client": "mysql",
"connection": {
"host": “127.0.0.1",
"user": "root",
"password" : "",
"database" : "ghost"
}
}
// Replace with
"database": {
"client": "mysql",
"connection": {
"host" : "10.102.10.105",
"user” : "root",
"password” : “RRLlxp22173",
"database” : "ghos"
}
}
9. Connect to your Node.js server via Web SSH and run the following commands one by one to configure the database migration tool for knex (a query builder for MySQL):
cd ROOT
sudo npm install -g knex-migrator
knex-migrator init
10. Restart the Node.js server to apply the changes you have made.
It’s done! Your Ghost application has been successfully hosted on the Hidora platform. Just click Open in the browser and you can start.
We hope this tutorial will help you find the best Node.js hosting solution for your application. If your application requires other specific hosting options and features, please contact our support team We are always happy to help you.