I have added a line to /etc/rc.local that starts a node process after reboot:
/usr/local/bin/node /home/ubuntu/app/index.js &
the problem is that the process is running as root.
How can I specify non-root user to run the node process as?
Telling the system to run your process as a different user than root would be a question more suitable for the Ubuntu Forums or the Unix SE site.
As to how to change the user to a non-privileged user from within the Node.js process, you can use process.setuid() and process.setgid() to change the user and group IDs, respectively.
Note that once you change these to non-root values, you cannot go back to the elevated root privileges.
I would try this, but I haven't tested it in your context:
exec sudo -u nodejs /usr/local/bin/node /home/ubuntu/app/index.js &
You can run it with another user with this line:
su -c "/usr/local/bin/node /home/ubuntu/app/index.js" & -s /bin/sh <username>