How to Deploy Node.js Shopify Apps to Digital Ocean

A comprehensive guide to deploying your Node.js Shopify App to a production-grade Digital Ocean server

Table of Contents

Why Digital Ocean


Creating a Digital Ocean Droplet

Digital Ocean Dashboard — Selecting a Droplet
Digital Ocean Dashboard — Selecting a droplet
Digital Ocean Dashboard — Selecting a region

Configuring DNS

Configuring the Shopify Partner Dashboard App Setup

Configuring the Shopify Partner Dashboard App Setup

Setting up a non-root user and firewall

Installing NGINX

sudo apt update
sudo apt install nginx
sudo ufw allow 'Nginx Full'
NGINX welcome message
sudo nano /etc/nginx/sites-available/
server {
listen 80;
listen [::]:80;
server_name; location / {
proxy_pass http://localhost:8080;
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;
sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
sudo systemctl restart nginx


sudo add-apt-repository ppa:certbot/certbot
sudo apt install python-certbot-nginx
sudo certbot --nginx -d

Install Node.js

cd ~
curl -sL -o
sudo bash
sudo apt install nodejs

Install NVM

curl -o- | bash
nvm install v11.3.0

Clone your project using Git

cd ~
git clone

Setup Environmental Variables

sudo nano shopify-demo/.env

Build the Project

cd shopify-demo
npm install
npm run build

Test Your Project By Running Node.js Directly

PORT=8080 npm run start
Node.js Shopify App working!

Upgrade to PM2

npm install -g pm2
PORT=8080 pm2 start npm --name "shopify-demo" -- start
pm2 startup systemd
sudo env PATH=$PATH:/home/chris/.nvm/versions/node/v11.3.0/bin /home/chris/.nvm/versions/node/v11.3.0/lib/node_modules/pm2/bin/pm2 startup systemd -u chris --hp /home/chris

Running Multiple Apps

What’s Next

Software developer and teacher

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store