Source Code Installation Guide (Docker Compose)
This guide is for developers who want to run backend services from source code using Docker Compose. This approach combines the convenience of containerization with the flexibility of building from source, making it ideal for customization and development.
⚠️ IMPORTANT: Advanced Users Only
This installation method is designed for experienced developers with strong knowledge of Docker, Node.js, and backend systems. Due to the complexity and customization potential of building from source:
- ✋ We cannot provide item support for issues related to this installation method
- ✋ Self-troubleshooting is required for most configuration and build issues
- ✋ Production use at your own risk — we recommend the pre-built Docker installation for official support
If you need guaranteed support, please use the Docker Installation Guide (Pre-built) instead.
📋 Overview
Unlike the pre-built Docker deployment, this method:
- Builds all services from source code using Docker Compose
- Allows full customization of backend services
- Uses the NX monorepo workspace structure
- Provides hot-reload capabilities for development
- Maintains production-ready containerization
✅ Prerequisites
Before starting, ensure you have:
- Ubuntu 22.04 LTS (or compatible Linux distribution)
- Static IP address (required for license validation)
- Root or sudo access to the server
- Downloaded package from CodeCanyon (the full source code ZIP)
- At least 4GB RAM and 10GB free disk space
🐳 Step 1: Install Docker & Docker Compose
If Docker is not already installed on your system, run:
curl -sSL https://get.docker.com | shVerify the installation:
docker --version
docker compose versionEnable Docker to start on boot:
sudo systemctl enable docker
sudo systemctl start docker📦 Step 2: Extract the Source Code
- Upload the downloaded ZIP from CodeCanyon to your server
- Extract the package:
unzip package.zip -d /root
cd /rootThe extracted folder should contain:
docker-compose.yaml(ordocker-compose.yml).env.example(environment template)- NX workspace structure with
apps/andlibs/folders package.jsonand workspace configuration files
⚙️ Step 3: Configure Environment Variables
Create Your Environment File
Copy the example environment file:
cp .env.example .envEdit Critical Configuration
Open the .env file and update the following required values:
nano .env🔑 Essential Variables to Update
# ========================================
# SERVER URLs - Replace 127.0.0.1 with your server's IP
# ========================================
GATEWAY_SERVER_URL=http://YOUR_SERVER_IP:3333
RIDER_SERVER_URL=http://YOUR_SERVER_IP:3001
DRIVER_SERVER_URL=http://YOUR_SERVER_IP:3002
ADMIN_SERVER_URL=http://YOUR_SERVER_IP:3000📝 Important Notes
- Replace
YOUR_SERVER_IPwith your actual server IP address (e.g.,192.168.1.100or your public IP) - Do NOT use
127.0.0.1orlocalhostin production unless testing locally - Keep your
.envfile secure — never commit it to version control - For local development, you can use
127.0.0.1orlocalhost - For production, use your static IP or domain name (with SSL setup)
🏗️ Step 4: Understanding the Docker Compose Setup
The docker-compose.yaml file in your package defines all services:
services:
mysql: # Database service
redis: # Cache and queue service
admin-api: # Backend for admin panel
rider-api: # Backend for customer app
driver-api: # Backend for driver app
payment-gateways: # Payment processor
nginx: # Web server and reverse proxyEach service is configured to build from source using the NX workspace.
🚀 Step 5: Build and Start Services
Initial Build
Build all services from source (this may take 10-15 minutes on first run):
docker compose buildStart All Services
docker compose up -dThe -d flag runs services in detached mode (background).
Verify Services Are Running
Check the status of all containers:
docker compose psYou should see all services with status Up or healthy.
View Logs
To monitor service logs:
# View all logs
docker compose logs -f
# View specific service logs
docker compose logs -f admin-api
docker compose logs -f rider-api
docker compose logs -f mysqlPress Ctrl+C to stop following logs.
🔍 Step 6: Initial Setup & Configuration
Access the Admin Panel
Once all services are running, access the admin panel:
http://YOUR_SERVER_IP/admin/Or if using a domain:
https://yourdomain.com/admin/Complete First-Time Setup
The admin panel will guide you through:
- License Validation — Enter your CodeCanyon purchase code
- Database Migration — Automatic schema creation
- Admin Account Creation — Set up your first admin user
- Basic Configuration:
- Google Maps API key
- Firebase configuration for push notifications
🛠️ Development Workflow
Making Code Changes
When you modify code in the source:
- Edit files in
apps/orlibs/directories - Rebuild the affected service:
docker compose build admin-api
docker compose up -d admin-apiOr rebuild all services:
docker compose build
docker compose up -dHot Reload for Development
For active development with hot reload, you can run services locally using NX:
- Stop the Docker service you want to develop:
docker compose stop admin-api- Install dependencies locally:
npm install- Run the service with NX:
npx nx serve admin-apiThis runs the service outside Docker with hot reload enabled.
📊 Managing Services
Stop All Services
docker compose stopStart Stopped Services
docker compose startRestart a Specific Service
docker compose restart rider-apiRemove All Containers (keeps data)
docker compose downRemove Everything Including Volumes (⚠️ deletes database)
docker compose down -v🗄️ Database Management
Access MySQL Console
docker compose exec mysql mysql -u root -pEnter the password you set in .env.
Backup Database
docker compose exec mysql mysqldump -u root -p bettersuite > backup.sqlRestore Database
docker compose exec -T mysql mysql -u root -p bettersuite < backup.sql🔧 Troubleshooting
Services Won't Start
Check logs for errors:
docker compose logsCommon issues:
- Port conflicts — Ensure ports 80, 443, 3000-3006, 3306, 6379 are not in use
- Permission errors — Run with
sudoor add user to docker group - Memory issues — Ensure at least 4GB RAM available
License Validation Fails
- Verify
PURCHASE_CODEis correct in.env - Ensure using a static IP address
- Contact support if IP was recently changed
Database Connection Errors
- Check
DB_*variables in.env - Ensure MySQL container is running:
docker compose ps mysql - Check MySQL logs:
docker compose logs mysql
Service-Specific Errors
Admin API won't start:
docker compose logs admin-apiCheck for:
- Database migration failures
- Missing environment variables
- Port conflicts
Payment gateway issues:
- Verify
payment-gatewaysservice is running - Check API credentials in admin panel
- Review payment service logs
Rebuilding from Scratch
If you encounter persistent issues:
# Stop and remove all containers
docker compose down
# Remove all images (forces rebuild)
docker compose down --rmi all
# Rebuild and start fresh
docker compose build --no-cache
docker compose up -d🔄 Updating the System
Pull Latest Source Code
- Backup your database (see Database Management section)
- Download new package from CodeCanyon
- Extract to a new directory or overwrite (backup
.envfirst!) - Rebuild services:
docker compose build
docker compose up -dMigrations will run automatically on admin-api startup.
🌐 Production Deployment
Enable HTTPS/SSL
For production, configure SSL using:
- Cloudflare (recommended) — See HTTPS & SSL Setup
- Let's Encrypt with Certbot
- Reverse proxy with SSL termination
Performance Optimization
Increase container resources in docker-compose.yaml:
services:
admin-api:
deploy:
resources:
limits:
cpus: '2'
memory: 2GEnable production mode in .env:
NODE_ENV=productionMonitoring & Logs
Set up log rotation:
docker compose logs --tail=100 -f > /var/log/bettersuite.logMonitor resource usage:
docker stats🎯 Next Steps
After successful installation:
- ✅ Configure regions and pricing in Admin Panel
- ✅ Set up payment gateways via Settings → Payments
- ✅ Configure SMS provider for OTP
- ✅ Set up Firebase for push notifications
- ✅ Build and deploy mobile apps — See Building & Running Flutter Apps
- ✅ Configure SSL/HTTPS — See HTTPS & SSL Setup
- ✅ Test end-to-end workflows with driver and customer apps
📞 Support & Assistance
⚠️ Limited Support Notice
Source code installations are not covered under standard item support. We cannot provide technical assistance for build issues, custom configurations, or problems arising from this installation method.
Self-Help Resources
If you encounter issues, please refer to:
- 📖 Common Errors & Resolutions — General troubleshooting guide
- 🐳 Docker Documentation — Official Docker resources
- 📦 NX Documentation — NX workspace and monorepo guides
- 🔍 Docker community forums and Stack Overflow
When Support Is Available
Customers may receive guidance for:
- License validation issues (not build-related)
What we do NOT support:
- ❌ Custom code modifications or build errors
- ❌ Environment-specific problems
- ❌ Performance tuning for custom setups
- ❌ Third-party integration issues
Need Full Support?
If you require comprehensive technical support, we strongly recommend using:
- 🚀 Docker Installation Guide (Pre-built) — Officially supported
- 📧 Contact contact@lumeagency.io for Pro Plus upgrade inquiries
Ready for production? Proceed to Deployment Options Overview for mobile app publishing guides.
