Jump to content
43oh

Alternative to BlueMix for Free NodeJS hobbyist


Recommended Posts

Looking at the tutoria that uses BlueMix,

http://energia.nu/creating-an-iot-connected-sensor-with-energia-mqtt/

 

I loved BlueMix, but my trial expired... was wondering if there was another Platform As A Service / Host that allows you to develop Node.JS apps using Node-RED and host them for free?   Sounds like alot to ask, but for learning I only need a few MBs of storage, and a few MB of bandwidth.   

 

I've searched thru quite a few, but not at all sure if they are the same as BlueMix ?

 

If not, is there a low-cost leader for simple, node.js hosting? Google Cloud Platform, AWS, Heroku , Modulus, AppFog, Azure, DotCloud, EngineYard, OpenShift, CloudFoundry, NodeJitsu, etc?

Link to post
Share on other sites

Hello Blipton,

 

I have not used BlueMix nor Node-RED, but for the usage of simple hosting I'd highly recommend Amazon AWS. There is an offer of free-tier for 1 year of use. You may want to read this link. The terms are quite complicated but in brief:

  • 1 year free VM running time enough for 24x7 non-stop for 365 days
  • from my experience enough bandwidth for personal use, occasionally may get charged for a few cents for moving VM around and large downloads, but that's very rare.
  • required a valid VISA card to create account (just in case the free-tier quotas are exceeded, the charges will apply to this card)
  • required a valid phone number for activating account (a six (?) digit code sent to this number in message format for AWS account activation).
  • perhaps there is already pre-built image on BlueMix for Node-Red, but I haven't find something similar to it on AWS, so have to be installed by yourself and do a little configuration, and that means the more familiar with SSH and unix commands, package installation, etc the better.

From personal experience, I am very satisfied with the versatility and service offered from AWS. Yes it is not free for life, but one year is the most generous offer on the market.

 

To run Node-RED on AWS, first of all is to get the free tier account from the above link. Afterwards, login to the AWS console and try the following setup:

 

  1. Select the availability zone from the top upper right corner (next to your username), the closer to where you live the better. AWS is a global service and have the concept of availability zone that means geographic region.
    post-286-0-62617500-1462087250_thumb.png
     
  2. Open the "EC2" link on the upper left of the console home screen (the first one, with description of "Virtual Servers in the cloud"). Then click "Launch instance" to bring the next screen. Select "Ubuntu Server 14.04 LTS (HVM), SSD Volume Type". You may want other flavors of OS. Note that "Free tier eligible" label means this type of instance is under cover for free tier. Not all of them are.
    post-286-0-06933900-1462087350_thumb.png
     
  3. Now, for simple setup just click "Review and Launch". For a little more details I'll click "Next:.." for some more manual setup.
    post-286-0-88969100-1462087512_thumb.png
     
  4. In particular at Step 6 (of the AWS console wizard, not the steps here), add a custom rule of opening 1880 which is the port needed for Node-RED. Please bear in mind, this setting means 1880 is open to the world. Later in step 14 below, I'll show how not to open this but use a local tunnel in putty. If you choose a more secure fashion, do not do this step now but do the step (14) instead.
    post-286-0-86065100-1462087624_thumb.png
     
  5. Now, this is an important step in AWS instance - creating a key pair.
    post-286-0-56801000-1462087750_thumb.png
     
  6. In the following screen, choose "Create a new key pair", give it a name, and click "Download Key Pair".
    post-286-0-90677500-1462087776_thumb.png
     
  7. The key file will then be downloaded. This is the only opportunity so keep this file safe.
    post-286-0-27986600-1462087858_thumb.png
     
  8. Use Putty key generator (puttygen), load the Private key file downloaded
    post-286-0-58332500-1462087972_thumb.png
     
  9. Click Save private key and confirm not using password. The output file will be used by putty in subsequent login to the AWS instance.
    post-286-0-84764900-1462088043_thumb.png
     
  10. Export this output file and keep it safe. Do not share this file with others.
    post-286-0-13416800-1462088094_thumb.png
     
  11. Back to the AWS console, click on the instance number to check the details.
    post-286-0-37686000-1462088199_thumb.png
     
  12. Copy the "Public IP", this is the IP address for this instance available to the world. By the way, the free tier included one "elastic IP" address per account (need to register elsewhere on the AWS console). With elastic IP, you can have a stable IP address to assign to any instance under your account. The default public IP address assigned will be changed when the instance terminate.
    post-286-0-59407700-1462088248_thumb.png
     
  13. Go back to Putty to set this IP address, then at "Connection -> Data" input ubuntu at the Auto-login username, and then at "Connection -> SSH -> Auth", Browse to the key file back in step 10 to login.
    post-286-0-80187700-1462088386_thumb.pngpost-286-0-72414000-1462088395_thumb.png
     
  14. For more security, if you choose to have the 1880 port in tunnel instead opening to the world, in putty, set "Connection -> SSH -> Tunnels": add 1880 in Source Port, add "localhost:1880" in Destination port, then click "Add". Finally, save this session in Putty so that we can reuse this setting later.
    post-286-0-03106500-1462088634_thumb.png
     
  15. Now it's time to login the new instance. Using putty with the above setup, the following console should be available without any need to login since we are using key pairs.
    post-286-0-55686100-1462088713_thumb.png
     
  16. Now it's time to run several commands.
        sudo apt-get update
        sudo apt-get install node.js
        sudo apt-get install npm
        sudo npm install -g --unsafe-perm node-red
        sudo ln -s /usr/bin/nodejs /usr/bin/node
        node-red
    post-286-0-41843800-1462088856_thumb.png
    post-286-0-59618200-1462088866_thumb.png
    post-286-0-48380500-1462088878_thumb.png
     
  17. If everything's alright, the last command will be showing like this which means Node-RED is running on the AWS instance you just created.
    post-286-0-01047700-1462088886_thumb.png
     
  18. Open the browser, depends whether step 4 or step 14 is selected, point the browser to the public IP port 1880 (for step 4) or localhost:1880 (for step 14). Node-RED should be showing up.
    post-286-0-56785800-1462089064_thumb.png

Again I have not used Node-RED nor BlueMix before so can't compare the difference in experience but do hope this might help in getting something started on AWS if it is considered as an alternative.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...