Skip to main content
This guide covers deploying VIJ Admin to production environments, including Vercel, Docker, and self-hosted infrastructure.

Deployment Options

Vercel

One-click deployment with zero configuration

Docker

Containerized deployment for any infrastructure

Self-Hosted

Deploy on your own servers with full control

Deploy to Vercel

Vercel provides the easiest deployment path for Next.js applications.
1

Prepare your repository

Ensure your VIJ Admin code is in a Git repository (GitHub, GitLab, or Bitbucket):
2

Connect to Vercel

  1. Go to vercel.com and sign in
  2. Click Add New Project
  3. Import your VIJ Admin repository
  4. Select the repository and click Import
3

Configure environment variables

In the Vercel project settings, add environment variables:Required Variables:
Optional Variables:
Use MongoDB Atlas or another cloud MongoDB provider. Vercel cannot connect to localhost.
4

Deploy

Click Deploy and wait for the build to complete.
Your VIJ Admin dashboard will be live at https://your-project.vercel.app
5

Configure custom domain (optional)

  1. Go to SettingsDomains
  2. Add your custom domain (e.g., vij.yourdomain.com)
  3. Update DNS records as instructed
  4. Update NEXT_PUBLIC_BASE_URL environment variable

Vercel Configuration

Create vercel.json for advanced configuration:
vercel.json

Vercel Environment Variables

string
required
MongoDB Atlas connection string.Example:
Getting Started with MongoDB Atlas:
  1. Create free account at mongodb.com/atlas
  2. Create a cluster (free tier available)
  3. Add Vercel IP addresses to IP whitelist (or use 0.0.0.0/0 for all IPs)
  4. Create database user
  5. Get connection string
string
required
Your Vercel deployment URL.
Vercel automatically redeploys on every push to your main branch. Use preview deployments for testing.

Docker Deployment

Deploy VIJ Admin using Docker for consistent, portable deployments.

Dockerfile

Create a Dockerfile in your project root:
Dockerfile

Docker Compose

Create docker-compose.yml for local development or deployment:
docker-compose.yml

Build and Run

1

Build Docker image

2

Run with Docker Compose

VIJ Admin will be available at http://localhost:3000
3

View logs

4

Stop services

Production Docker Deployment

For production, use environment-specific compose files:
docker-compose.prod.yml
Deploy:

Self-Hosted Deployment

Deploy VIJ Admin on your own infrastructure.

Prerequisites

  • Node.js 18+ installed
  • MongoDB 5.0+ running
  • Nginx or Apache for reverse proxy (recommended)
  • PM2 or systemd for process management

Deployment Steps

1

Prepare the server

2

Clone and build

3

Start with PM2

VIJ Admin is now running on port 3000
4

Configure Nginx reverse proxy

Create Nginx configuration:
/etc/nginx/sites-available/vij-admin
Enable site:
5

Setup SSL with Certbot

Your VIJ Admin is now accessible at https://vij.yourdomain.com

PM2 Configuration

Create ecosystem.config.js:
ecosystem.config.js
Start with configuration:

Systemd Service (Alternative to PM2)

Create systemd service file:
/etc/systemd/system/vij-admin.service
Enable and start:

Kubernetes Deployment

Deploy VIJ Admin on Kubernetes clusters.

Kubernetes Manifests

k8s/deployment.yaml
k8s/secrets.yaml
Deploy to Kubernetes:

Post-Deployment

Health Checks

Verify your deployment is healthy:

Monitoring

Set up monitoring for your VIJ Admin instance:
Use services like UptimeRobot or Pingdom:Monitor URL: https://vij.yourdomain.comCheck interval: 5 minutesAlert on: Status code != 200

Backup Strategy

Implement regular backups:
backup.sh
Schedule with cron:

Security Considerations

Add authentication middleware to protect your VIJ instance:
middleware.ts
Force HTTPS in production:
  • Use MongoDB authentication
  • Whitelist IP addresses
  • Use SSL/TLS for connections
  • Enable audit logging
  • Never commit .env.local to version control
  • Use secret management (AWS Secrets Manager, Vault)
  • Rotate API keys regularly
  • Use environment-specific keys
.gitignore

Scaling

Horizontal Scaling

VIJ Admin can be horizontally scaled:

Database Optimization

For high-traffic deployments:

Next Steps

Environment Variables

Complete environment configuration reference

Dashboard Features

Explore all dashboard capabilities

Monitoring

Set up monitoring and analytics

Security

Implement authentication and security