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
andapi.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)
- Log in to your Cloudflare Dashboard
- Select your domain
- Navigate to SSL/TLS > Origin Server
- Click Create Certificate
- 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)
- 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:
- Copy the Origin Certificate and save it as
fullchain.pem
- Copy the Private Key and save it as
privkey.pem
- 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:
- Go to DNS > Records in your Cloudflare dashboard
- Create an
A
record for your main domain (example.com
) pointing to your server IP - Create an
A
record for your API domain (api.example.com
) pointing to the same server IP - 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:
Service | Description | Port | URL |
---|---|---|---|
Frontend | Next.js web application | 3000 | https://example.com |
API | Go backend server | 8080 | https://api.example.com |
MongoDB | Database storage | 27017 | Internal only |
Redis | Cache and real-time data | 6379 | Internal only |
Nginx | Reverse proxy & SSL | 80,443 | Routes 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
ordocker 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:
- Stop services:
./stop.sh
- Backup database and files
- Replace
deploy-api
binary andfrontend/
directory - Restart services:
./start.sh
Next Steps
Configuration Required
Your Vyral platform should now be running at:
- Frontend: https://example.com (replace with your domain)
- API: https://api.example.com (replace with your domain)
Continue with the configuration guides to complete your setup:
- Configure SMTP Settings - Set up email delivery
- Configure Storage - Set up file uploads
- Configure Branding - Customize your platform
- Configure Localization - Add languages
- Install CoTURN Server - Enable video calls