Deploying the Dashboard to Vercel
The PlugPort dashboard is a Next.js 15 application. Vercel is the optimal hosting platform since they created Next.js. Deploying is free and takes just a few clicks.
Note: This guide is for deploying the Dashboard (
packages/dashboard). The core database server (packages/server) requires a persistent runtime (like Railway, Render, or AWS) because it runs a long-running TCP wire protocol server (port 27017) and an HTTP server. Vercel is designed for serverless functions and frontend apps, so it cannot host the core database server.
Prerequisites
- Your code must be pushed to a Git repository (GitHub, GitLab, or Bitbucket)
- You must have a running PlugPort Server deployed elsewhere (e.g., Railway, Render, Fly.io, or an EC2 instance)
- A free Vercel account
Step-by-Step Deployment
1. Import Project
- Go to your Vercel Dashboard and click Add New... → Project
- Connect your Git provider and select the repository containing your PlugPort monorepo
- Click Import
2. Configure Monorepo Settings
Since PlugPort is a monorepo, you need to point Vercel to the dashboard application:
- Project Name:
plugport-dashboard(or whatever you prefer) - Framework Preset: Next.js
- Root Directory: Click "Edit" and select
packages/dashboard
Set the Root Directory to
packages/dashboardin the Vercel project settings.
3. Build Settings
Vercel usually detects Next.js settings automatically, but verify these build settings are applied under Build and Output Settings:
- Build Command:
pnpm build(or leave as defaultnext build) - Output Directory:
.next(default) - Install Command:
pnpm install(default)
4. Environment Variables
Expand the Environment Variables section. You must provide the URL of your externally hosted PlugPort core server so the dashboard knows where to connect.
Add the following variable:
| Key | Value |
|---|---|
NEXT_PUBLIC_API_URL | https://your-plugport-server-url.com |
(Make sure you do not include /api/v1 or a trailing slash in the URL)
5. Deploy
Click the Deploy button. Vercel will:
- Clone your repository
- Install
pnpmworkspace dependencies - Build the Next.js dashboard
- Deploy it to their global edge network
Troubleshooting
"API Connection Failed" Error
If your dashboard loads but shows an API connection error:
- Verify
NEXT_PUBLIC_API_URLis set correctly in Vercel settings - Ensure your hosted PlugPort server is actually running and publicly accessible
- Check that your server is exposing HTTP on port 8080 (or whatever port your reverse proxy maps to)
Build Fails (Missing Dependencies)
If the build fails finding shared packages (like @plugport/sdk or @plugport/shared), ensure Vercel is treating the project as a monorepo. It usually handles pnpm workspaces automatically as long as the install command runs from the workspace root (which it does when you set the Root Directory correctly in Step 2).