./package-deployment.shThis creates gamblecodez-deployment.tar.gz with all necessary files.
scp gamblecodez-deployment.tar.gz user@your-server.com:/home/user/ssh user@your-server.com
tar -xzf gamblecodez-deployment.tar.gz
cd gamblecodez-deployment
./deploy.shDATABASE_URL="postgresql://user:pass@host:5432/gamblecodez"
REPLIT_DOMAINS="your-domain.com"
REPL_ID="your-repl-id"
SESSION_SECRET="your-random-secret"
NODE_ENV="production"
PORT=3000- Go to Replit Console
- Create OAuth application
- Set redirect URL:
https://your-domain.com/api/callback - Copy REPL_ID to .env file
- CPU: 1 core
- RAM: 512MB
- Storage: 2GB
- OS: Ubuntu 20.04+ / CentOS 8+
- Node.js: 18+
- PostgreSQL: 13+
- CPU: 2 cores
- RAM: 2GB
- Storage: 10GB SSD
- Bandwidth: Unlimited
- Install Node.js 20+
- Install PostgreSQL
- Configure nginx reverse proxy
- Use PM2 for process management
docker-compose up -dfly launch
fly deploy- SSL certificate installed
- Firewall configured (allow 80, 443, 22 only)
- Strong database passwords
- Session secret is random and secure
- Regular backups configured
- Server updates enabled
- Enable gzip compression
- Set proper cache headers
- Configure rate limiting
- Enable HTTP/2
- Configure connection pooling
- Set up read replicas if needed
- Regular VACUUM and ANALYZE
- Monitor query performance
- Application: PM2 logs
- Web server: nginx access/error logs
- Database: PostgreSQL logs
- Application endpoint:
/api/health - Database connectivity
- SSL certificate expiry
- Disk space usage
# Database backup
pg_dump gamblecodez > backup_$(date +%Y%m%d_%H%M%S).sql
# File backup
tar -czf files_backup_$(date +%Y%m%d_%H%M%S).tar.gz /path/to/appPort 3000 already in use
sudo lsof -i :3000
sudo kill -9 <PID>Database connection failed
# Check PostgreSQL status
sudo systemctl status postgresql
sudo systemctl start postgresqlPermission denied
# Fix file permissions
chmod +x deploy.sh
chown -R www-data:www-data /path/to/appSSL certificate issues
# Using Let's Encrypt
sudo certbot --nginx -d your-domain.comHigh memory usage
- Check for memory leaks in logs
- Restart application:
pm2 restart gamblecodez - Monitor with:
pm2 monit
Slow database queries
- Enable query logging in PostgreSQL
- Analyze slow queries
- Add database indexes if needed
- Load balancer (nginx/HAProxy)
- Multiple app instances
- Shared session storage (Redis)
- CDN for static assets
- Increase server resources
- Optimize database configuration
- Enable caching layers
- Monitor error logs daily
- Update dependencies monthly
- Database maintenance weekly
- Security updates immediately
- Application crash: PM2 auto-restart
- Database issues: Restore from backup
- Security breach: Rotate secrets immediately
- High traffic: Scale horizontally
For additional support, check the main README.md file or create an issue in the repository.