Welcome to Meetzy !
Introduction
This guide explains how to deploy the Meetzy backend on a VPS (Virtual Private Server). You'll set up the server, install all required tools, configure the database, and run Meetzy securely in production. VPS deployment is the recommended method because it gives full control over performance, scaling, security, and custom configurations.
1. System Setup
After connecting to your VPS via SSH, start by updating your server and installing required packages.
- sudo apt update && sudo apt upgrade -y
- sudo apt install curl wget git unzip -y
This installs essential utilities needed later to fetch and manage Meetzy backend files and dependencies.
2. Install Node.js Runtime
The Meetzy backend is built on Node.js. Install the latest LTS version:
- curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
- sudo apt-get install -y nodejs
- node --version
- npm --version
Confirming the version ensures Node.js and npm installed successfully.
3. Install and Configure Database
Meetzy uses MySQL for storing user data, messages, calls, posts, and media.
- sudo apt install mysql-server -y
- sudo mysql_secure_installation
Create a dedicated database and user for Meetzy:
- CREATE DATABASE meetzy;
- CREATE USER 'meetzy_user'@'localhost' IDENTIFIED BY 'your_password';
- GRANT ALL PRIVILEGES ON meetzy.* TO 'meetzy_user'@'localhost';
- FLUSH PRIVILEGES;
Using a dedicated database user improves security and simplifies management.
4. Deploy the Application Code
Upload the Meetzy backend folder or clone it directly from your repository:
- git clone <your-repo-url>
- cd meetzy-backend
- npm install --production
After installation, create a .env file and add all required backend configuration values.
Example
- PORT=4000
- DB_HOST=localhost
- DB_USER=meetzy_user
- DB_PASSWORD=your_password
- DB_NAME=meetzy
- JWT_SECRET=your_jwt_secret
- SMTP_HOST=smtp.gmail.com
- SMTP_USER=your_email
- SMTP_PASS=email_password
The .env file ensures the backend loads settings securely and consistently across environments.
5. Process Management
To keep Meetzy running continuously and auto-restart on errors, use PM2:
- sudo npm install -g pm2
- pm2 start server.js --name meetzy-backend
- pm2 save
- pm2 startup
PM2 ensures uptime, handles crashes, and provides clean logging tools.
6. Reverse Proxy Setup (Nginx)
Meetzy runs on an internal port (e.g., 4000), so you need Nginx to route traffic from your domain.
Create an Nginx config file:
- sudo nano /etc/nginx/sites-available/meetzy
Add the following configuration:
- server {
- listen 80;
- server_name your-domain.com;
- location / {
- proxy_pass http://localhost:4000;
- 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;
- }
- }
Enable and restart Nginx:
- sudo ln -s /etc/nginx/sites-available/meetzy /etc/nginx/sites-enabled/
- sudo nginx -t
- sudo systemctl restart nginx
Your Meetzy backend will now be available through your domain.
7. Enable SSL (HTTPS)
Secure your API with a free Let’s Encrypt SSL certificate:
- sudo apt install certbot python3-certbot-nginx -y
- sudo certbot --nginx -d your-domain.com
Set up auto-renewal:
- 0 12 * * * /usr/bin/certbot renew --quiet
8. Testing and Verification
Visit your domain (e.g., https://your-domain.com/api) to confirm Meetzy is running correctly.
Check logs with:
- pm2 logs meetzy-backend
Verify API responses, media upload paths, authentication, and real-time events.
9. Maintenance & Updates
To update your Meetzy backend in the future:
- git pull origin main
- npm install
- pm2 restart meetzy-backend
It is recommended to monitor CPU, RAM, disk usage, database health, and system logs regularly.
Summary
By following this guide, your Meetzy backend will be fully deployed on a VPS with a secure, scalable, and production-ready environment. This deployment method ensures reliable performance, smooth real-time messaging with Socket.io, and fast audio/video calling using WebRTC.
What's Next?
Let’s continue — your social world lives on Meetzy!