Vyral Docs
Getting Started

Installation Guide

Quick setup using setup.sh script, Docker containers, and SSL configuration

Vyral Installation Guide

Get your Vyral social media platform running in minutes with our automated setup script.

Prerequisites

Before starting, ensure you have:

  • Ubuntu 18.04+ or similar Linux distribution
  • Root or sudo access
  • Domain names (e.g., example.com and api.example.com)
  • SSL certificates for your domains
  • At least 2GB RAM and 20GB storage

Quick Installation

Upload and Extract Files

Upload the deploy.zip file to your server, then run this command:

# Check if already extracted, then extract and set permissions
[ ! -d "deploy" ] && unzip deploy.zip && cd deploy/ && chmod +x setup.sh config.sh || cd deploy/

This command will:

  • Check if deploy/ directory already exists
  • Extract the zip file only if not already extracted
  • Navigate to the deploy directory
  • Make setup.sh and config.sh executable (if just extracted)

Configure Domains

Edit the configuration file:

nano config.sh

Set your domains (replace with your actual domains):

export FRONTEND_DOMAIN="example.com"
export API_DOMAIN="api.example.com"

Create SSL Certificates (Cloudflare)

SSL Certificate

  1. Log in to your Cloudflare Dashboard
  2. Select your domain
  3. Navigate to SSL/TLS > Origin Server
  4. Click Create Certificate
  5. Configure the certificate:
    • Private key type: RSA (2048)
    • Hostname: Add your main domain (example.com) and API subdomain (*.example.com)
    • Certificate validity: 15 years (maximum)
  6. Click Create

Save the certificates to your server:

# Create certs directory
mkdir -p ./certs/

# Copy your SSL certificates from where you downloaded them
cp ~/Downloads/fullchain.pem ./certs/
cp ~/Downloads/privkey.pem ./certs/

# Set correct permissions
chmod 600 ./certs/*

Save Certificate Files (Cloudflare Users)

After creating the certificate in Cloudflare:

  1. Copy the Origin Certificate and save it as fullchain.pem
  2. Copy the Private Key and save it as privkey.pem
  3. Upload both files to your deploy/certs/ directory

Important!

Do not close the Cloudflare window until you have saved both files. The private key will not be shown again.

Configure DNS Records (Cloudflare)

Set up your domain to point to your server:

DNS Configuration

  1. Go to DNS > Records in your Cloudflare dashboard
  2. Create an A record for your main domain (example.com) pointing to your server IP
  3. Create an A record for your API domain (api.example.com) pointing to the same server IP
  4. Enable the proxy status (orange cloud) for both records

Run Installation Script

Execute the automated setup script:

chmod +x setup.sh
sudo ./setup.sh

The script will automatically:

  • ✅ Install Docker and Docker Compose
  • ✅ Verify required files (deploy-api binary, frontend directory)
  • ✅ Check SSL certificates
  • ✅ Create Docker configurations
  • ✅ Set up Nginx reverse proxy
  • ✅ Configure environment variables
  • ✅ Start all services

Verify Installation

After installation completes, check if services are running:

# View service status
docker compose ps

# Check logs
./logs.sh

# Test endpoints (replace with your domains)
curl -k https://api.example.com/health
curl -k https://example.com

Directory Structure

Your installation directory should look like this:

deploy/
├── deploy-api             # Go backend binary
├── frontend/              # Next.js frontend application
├── certs/                 # SSL certificates
│   ├── fullchain.pem
│   └── privkey.pem
├── config.sh             # Domain configuration
├── setup.sh              # Installation script
├── docker-compose.yml    # Generated Docker configuration
├── nginx.conf            # Generated Nginx configuration
├── .env                  # Backend environment variables
├── .env.local            # Frontend environment variables
├── start.sh              # Start services script
├── stop.sh               # Stop services script
└── logs.sh               # View logs script

Services Overview

The installation creates these Docker services:

ServiceDescriptionPortURL
FrontendNext.js web application3000https://example.com
APIGo backend server8080https://api.example.com
MongoDBDatabase storage27017Internal only
RedisCache and real-time data6379Internal only
NginxReverse proxy & SSL80,443Routes traffic

Management Commands

After installation, use these scripts to manage your Vyral instance:

./start.sh

Starts all Docker services and shows status.

./stop.sh

Gracefully stops all services.

# View all logs
./logs.sh

# View specific service logs
./logs.sh api       # API logs only
./logs.sh frontend  # Frontend logs only
./logs.sh mongodb   # Database logs
./logs.sh redis     # Cache logs
./logs.sh nginx     # Proxy logs
./stop.sh && ./start.sh

Restart all services (useful after configuration changes).

Configuration Files

Backend Environment (.env)

Contains API server configuration:

  • Database connections
  • JWT secrets
  • CORS settings
  • Upload limits
  • Rate limiting

Frontend Environment (.env.local)

Contains web app configuration:

  • API endpoints
  • WebSocket URLs
  • Feature flags
  • External service keys

Troubleshooting

Common Issues

Docker not starting

sudo systemctl start docker
sudo usermod -aG docker $USER
# Logout and login again

SSL certificate errors

# Verify certificate files exist and have correct permissions
ls -la ./certs/
chmod 600 ./certs/*

Services won't start

# Check Docker logs
docker compose logs

# Restart services
./stop.sh && ./start.sh

Port conflicts

# Check what's using ports
netstat -tulpn | grep :80
netstat -tulpn | grep :443

# Stop conflicting services
sudo systemctl stop apache2  # if Apache is running
sudo systemctl stop nginx    # if system Nginx is running

Getting Help

  • Check service logs: ./logs.sh [service-name]
  • Monitor system resources: htop or docker stats
  • Verify network connectivity: curl -k https://your-domain.com/health

Security Considerations

Security Checklist

  • Change default JWT secrets in .env
  • Use strong SSL certificates
  • Keep system updated: sudo apt update && sudo apt upgrade
  • Monitor logs regularly: ./logs.sh
  • Backup database regularly: docker exec -it mongodb mongodump

Updates

To update your Vyral installation:

  1. Stop services: ./stop.sh
  2. Backup database and files
  3. Replace deploy-api binary and frontend/ directory
  4. Restart services: ./start.sh

Next Steps

Configuration Required

Your Vyral platform should now be running at:

Continue with the configuration guides to complete your setup: