OpenSky-commerce / Documentation

Other Deployment Options

Open Sky Commerce is a standard Next.js application and runs anywhere Node.js 18+ is supported. Below are guides for three additional deployment targets beyond DigitalOcean App Platform and Vercel.


Railway

Railway is a developer-friendly platform that provisions both the app server and a PostgreSQL database in one place, making it one of the fastest ways to get a full-stack deployment running.

Steps

  1. Create an account at railway.app.
  2. Click New Project → Deploy from GitHub and select your repository.
  3. Add a PostgreSQL plugin to the project. Railway automatically injects DATABASE_URL into your app.
  4. In your service's Variables tab, add the remaining environment variables:
    NEXTAUTH_URL=https://yourapp.up.railway.app
    NEXTAUTH_SECRET=your-secret
    NEXT_PUBLIC_SITE_URL=https://yourapp.up.railway.app
  5. Railway will detect Next.js and set the build command to npm run build and start command to npm start automatically.
  6. After the first deploy, run migrations from your local machine:
    DATABASE_URL="postgresql://..." npx prisma migrate deploy

Custom Domain

In your service settings, go to Settings → Domains and add your custom domain. Railway provides DNS instructions and handles SSL automatically.

Notes

  • Railway's free tier has usage limits — suitable for development and low-traffic sites. Production sites should use a paid plan.
  • Railway uses ephemeral filesystems. All media uploads must be configured to go to DigitalOcean Spaces or another external service.

Self-Hosted VPS (Ubuntu / Debian)

If you want full control over your server environment, you can run Open Sky Commerce on any VPS (DigitalOcean Droplet, Linode, Hetzner, AWS EC2, etc.) using Node.js and a process manager.

Prerequisites

  • A VPS running Ubuntu 22.04 or Debian 12
  • A domain name pointed at your server's IP address
  • PostgreSQL installed on the server or a managed database

Steps

1. Install Node.js

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

2. Install PM2 (process manager)

sudo npm install -g pm2

3. Copy your code to the server

# Option A: SCP from your machine
scp -r ./open-sky-commerce user@your-server-ip:/var/www/

# Option B: Clone your private repo on the server
git clone https://github.com/yourname/yourrepo.git /var/www/open-sky-commerce

4. Install dependencies and build

cd /var/www/open-sky-commerce
cp .env.example .env
# Edit .env with your production values
nano .env

npm install
npx prisma migrate deploy
npm run build

5. Start with PM2

pm2 start npm --name "open-sky-commerce" -- start
pm2 save
pm2 startup   # follow the on-screen command to enable startup on reboot

6. Configure Nginx as a reverse proxy

sudo apt install nginx -y
# /etc/nginx/sites-available/open-sky-commerce
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        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/open-sky-commerce /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

7. Enable HTTPS with Certbot

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Certbot automatically renews certificates. HTTPS will be active immediately.

8. Update your environment for the live URL

NEXTAUTH_URL=https://yourdomain.com
NEXT_PUBLIC_SITE_URL=https://yourdomain.com

Rebuild the app after changing environment variables:

npm run build
pm2 restart open-sky-commerce

Updating the App

cd /var/www/open-sky-commerce
git pull origin main          # or copy new files
npm install
npx prisma migrate deploy     # if migrations changed
npm run build
pm2 restart open-sky-commerce

Docker

Open Sky Commerce does not ship with a Dockerfile by default, but containerization is straightforward. A minimal example:

# Dockerfile
FROM node:20-alpine AS base

WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev

COPY . .
RUN npx prisma generate
RUN npm run build

EXPOSE 3000
CMD ["npm", "start"]
# Build and run
docker build -t open-sky-commerce .
docker run -p 3000:3000 --env-file .env open-sky-commerce

For production Docker deployments, use Docker Compose or Kubernetes to manage the app container alongside PostgreSQL and run prisma migrate deploy as an init container or entrypoint step before the app starts.


Which Option Should I Choose?

PlatformBest forEffortCost
DigitalOcean App PlatformMost stores — recommended defaultLowFrom $5/mo
VercelFastest deploys, preview URLs, Next.js team behind itVery lowFree tier, then $20/mo
RailwayFull-stack in one place, good developer UXVery lowFree trial, then usage-based
Self-hosted VPSFull control, lowest cost at scaleHighFrom $4/mo (server only)
DockerExisting container infrastructureMediumDepends on host