set up a self-booting node.js server on a raspberry pi 3 using pm2, nginx, dataplicity, and your mac

Andrew Nease
Jul 20, 2017 · 4 min read

Get SSH terminal access to your Raspberry Pi

Install Node.js and your server on the Pi

Open Cyberduck and click on File — Open Connection.
Choose SFTP from the dropdown box, then fill out the fields as follows:
Server: your Pi's local IP
Port: 22
Username: the username of your Pi, typically Pi
Password: the password of your Pi
Uncheck the box for Anonymous Login.
Hit Connect

Make your server load when the Pi reboots

Connect your server to the outside world

server {
listen 80;
server_name whatever;location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade