5.8 KiB
5.8 KiB
🐧 VIP Coordinator - Ubuntu Installation Guide
Deploy VIP Coordinator on Ubuntu in just a few commands!
Prerequisites
First, ensure Docker and Docker Compose are installed on your Ubuntu system:
# Update package index
sudo apt update
# Install Docker
sudo apt install -y docker.io
# Install Docker Compose
sudo apt install -y docker-compose
# Add your user to docker group (to run docker without sudo)
sudo usermod -aG docker $USER
# Log out and back in, or run:
newgrp docker
# Verify installation
docker --version
docker-compose --version
Quick Install (One Command)
# Download and run the interactive setup script
curl -sSL https://raw.githubusercontent.com/your-repo/vip-coordinator/main/setup.sh | bash
Manual Installation
If you prefer to download and inspect the script first:
# Create a directory for VIP Coordinator
mkdir vip-coordinator
cd vip-coordinator
# Download the setup script
wget https://raw.githubusercontent.com/your-repo/vip-coordinator/main/setup.sh
# Make it executable
chmod +x setup.sh
# Run the interactive setup
./setup.sh
What the Setup Script Does
The script will interactively ask you for:
- Deployment Type: Local development or production with custom domain
- Domain Configuration: Your domain names (for production)
- Security: Generates secure passwords or lets you set custom ones
- Google OAuth: Your Google Cloud Console credentials
- Optional: AviationStack API key for flight data
Then it automatically generates:
- ✅
.env- Your configuration file - ✅
docker-compose.yml- Docker services configuration - ✅
start.sh- Script to start VIP Coordinator - ✅
stop.sh- Script to stop VIP Coordinator - ✅
update.sh- Script to update to latest version - ✅
README.md- Your deployment documentation - ✅
nginx.conf- Production nginx config (if needed)
After Setup
Once the setup script completes:
# Start VIP Coordinator
./start.sh
# Check status
docker-compose ps
# View logs
docker-compose logs
# Stop when needed
./stop.sh
Access Your Application
- Local Development: http://localhost
- Production: https://your-domain.com
Google OAuth Setup
The script will guide you through setting up Google OAuth:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 Client ID credentials
- Add the redirect URI provided by the script
- Copy Client ID and Secret when prompted
Ubuntu-Specific Notes
Firewall Configuration
If you're using UFW (Ubuntu's firewall):
# For local development
sudo ufw allow 80
sudo ufw allow 3000
# For production (if using nginx proxy)
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 22 # SSH access
Production Deployment on Ubuntu
For production deployment, the script generates an nginx configuration. To use it:
# Install nginx
sudo apt install nginx
# Copy the generated config
sudo cp nginx.conf /etc/nginx/sites-available/vip-coordinator
# Enable the site
sudo ln -s /etc/nginx/sites-available/vip-coordinator /etc/nginx/sites-enabled/
# Remove default site
sudo rm /etc/nginx/sites-enabled/default
# Test nginx configuration
sudo nginx -t
# Restart nginx
sudo systemctl restart nginx
SSL Certificates with Let's Encrypt
# Install certbot
sudo apt install certbot python3-certbot-nginx
# Get certificates (replace with your domains)
sudo certbot --nginx -d yourdomain.com -d api.yourdomain.com
# Certbot will automatically update your nginx config for HTTPS
System Service (Optional)
To run VIP Coordinator as a system service:
# Create service file
sudo tee /etc/systemd/system/vip-coordinator.service > /dev/null <<EOF
[Unit]
Description=VIP Coordinator
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/path/to/your/vip-coordinator
ExecStart=/usr/bin/docker-compose up -d
ExecStop=/usr/bin/docker-compose down
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
EOF
# Enable and start the service
sudo systemctl enable vip-coordinator
sudo systemctl start vip-coordinator
# Check status
sudo systemctl status vip-coordinator
Troubleshooting
Common Ubuntu Issues
Docker permission denied:
sudo usermod -aG docker $USER
newgrp docker
Port already in use:
# Check what's using the port
sudo netstat -tulpn | grep :80
sudo netstat -tulpn | grep :3000
# Stop conflicting services
sudo systemctl stop apache2 # if Apache is running
sudo systemctl stop nginx # if nginx is running
Can't connect to Docker daemon:
# Start Docker service
sudo systemctl start docker
sudo systemctl enable docker
Viewing Logs
# All services
docker-compose logs
# Specific service
docker-compose logs backend
docker-compose logs frontend
# Follow logs in real-time
docker-compose logs -f
Updating
# Update to latest version
./update.sh
# Or manually
docker-compose pull
docker-compose up -d
Performance Optimization
For production Ubuntu servers:
# Increase file limits
echo "fs.file-max = 65536" | sudo tee -a /etc/sysctl.conf
# Optimize Docker
echo '{"log-driver": "json-file", "log-opts": {"max-size": "10m", "max-file": "3"}}' | sudo tee /etc/docker/daemon.json
# Restart Docker
sudo systemctl restart docker
Backup
# Backup database
docker-compose exec db pg_dump -U postgres vip_coordinator > backup.sql
# Backup volumes
docker run --rm -v vip-coordinator_postgres-data:/data -v $(pwd):/backup ubuntu tar czf /backup/postgres-backup.tar.gz /data
Support
- 📖 Full documentation: DEPLOYMENT.md
- 🐛 Issues: GitHub Issues
- 💬 Community: GitHub Discussions
🎉 Your VIP Coordinator will be running on Ubuntu in under 5 minutes!