This guide takes you through the steps to get Node-RED running on an AWS EC2 instance.
Log in to the AWS EC2 console
Click ‘Launch Instance’
In the list of Quick Start AMIs, select Ubuntu Server
Select the Instance Type -
t2.micro is a good starting point
On the ‘Configure Security Group’ tab, add a new ‘Custom TCP Rule’ for port 1880
On the final ‘Review’ step, click the ‘Launch’ button
The console will prompt you to configure a set of SSH keys. Select ‘Create a new key pair’ and click ‘Download key pair’. Your browser will save the
.pem file - keep that safe. Finally, click ‘Launch’.
After a couple of minutes your EC2 instance will be running. In the console you can find your instance’s IP address.
The next task is to log into the instance then install node.js and Node-RED.
Follow the AWS guide for connecting to your instance.
Once logged in you need to install node.js and Node-RED
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs build-essential sudo npm install -g node-red
At this point you can test your instance by running
node-red. Note: you may
get some errors regarding the Serial node - that’s to be expected and can be
Once started, you can access the editor at
To get Node-RED to start automatically whenever your instance is restarted, you can use pm2:
sudo npm install -g pm2 pm2 start `which node-red` -- -v pm2 save pm2 startup
Note: this final command will prompt you to run a further command - make sure you do as it says.
This guide barely scratches the surface of how you may choose to configure your instance to run in EC2. Node-RED is ‘just’ a node.js application that exposes an HTTP server - on that principle, there are many online guides you can use to learn what else is possible.