smbcloud-deploy-nextjs

Deploy Next.js standalone builds to smbCloud via rsync, PM2, and Nginx.

7|6|Updated Feb 3, 2023
One-click install
npx skills add https://github.com/smbcloudXYZ/smbcloud-cli --skill smbcloud-deploy-nextjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smbcloud-deploy-nextjs
Source: https://github.com/smbcloudXYZ/smbcloud-cli/tree/main/.agents/skills/smbcloud-deploy-nextjs
Command: npx skills add https://github.com/smbcloudXYZ/smbcloud-cli --skill smbcloud-deploy-nextjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Deploying and debugging Next.js apps on smbCloud, especially SSR workflows, can be manual and error-prone.

Core Features & Use Cases

  • Build locally producing a standalone bundle for Next.js.
  • Transfer .next/standalone, .next/static, and public assets to the remote server via rsync, then restart the app with PM2 over SSH.
  • Use Nginx as a reverse proxy to route traffic to the local PM2 process.

Quick Start

Run the smbcloud deploy workflow for your Next.js app configured with nextjs-ssr.

Frequently Asked Questions about smbcloud-deploy-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Next.js SSR app to smbCloud using rsync and PM2?

Configure Next.js standalone output and smbCloud config.toml with kind = "nextjs-ssr". The workflow rsyncs .next/standalone, static, and public assets, restarts PM2 over SSH, and proxies traffic through Nginx.

What is the nextjs-ssr deployment flow for Next.js standalone builds?

The nextjs-ssr flow builds a standalone bundle locally, transfers .next/standalone, static, and public assets via rsync, restarts PM2 over SSH, and routes production traffic through an Nginx reverse proxy.

Do I need output standalone in Next.js to deploy with smbCloud?

Yes, output: "standalone" is required. The deployment workflow depends on a standalone Next.js build to correctly transfer .next/standalone, .next/static, and public assets via rsync to the remote server.

What smbCloud config.toml settings are required for Next.js deployment?

The config.toml must set kind = "nextjs-ssr", source, path, pm2_app, and deployment_method. These fields configure the rsync transfer, PM2 restart over SSH, and Nginx reverse proxy setup.

Why is Nginx used as a reverse proxy for Next.js PM2 deployments?

Nginx routes production traffic to the local PM2 process. After rsync transfers standalone assets and PM2 restarts the Next.js app, Nginx serves as a reverse proxy to handle incoming requests.