This directory contains Docker and Docker Compose configurations for automating CloudLinux and SWNG repository mirroring using upstream.cloudlinux.com.
Directory: complete-swng-rsync/
Complete local mirror of all SWNG repositories using RSync with automated updates via cron.
Use Case: When you need the complete SWNG repository mirror in a container.
Features:
- Complete SWNG mirror
- RSync-based synchronization
- Cron-based automated updates
- Configurable sync intervals
Directory: specific-version-rsync/
Local mirror of a specific CloudLinux version SWNG repositories (10) using RSync.
Use Case: When you only need specific CloudLinux versions in containers.
Features:
- Version-specific mirroring
- RSync-based synchronization
- Cron-based automated updates
- Supports CloudLinux 10
Directory: yum-reposync/
Local mirror of SWNG repositories using yum-reposync (reposync) with automated updates.
Use Case: When you need selective repository mirroring with YUM repository configuration in containers.
Features:
- Selective repository mirroring
- YUM repository configuration
- Automatic metadata generation
- Cron-based automated updates
Directory: combined-mirror/
Complete local mirror of both CloudLinux and SWNG repositories using RSync.
Use Case: When you need both CloudLinux and SWNG mirrors in containers.
Features:
- Combined CloudLinux and SWNG mirroring
- RSync-based synchronization
- Two sync modes: combined or separate
- Optional Nginx web server included
- Cron-based automated updates
- Docker or Docker Compose installed
- Sufficient disk space (varies by setup)
- Network access to
upstream.cloudlinux.comorrsync.upstream.cloudlinux.com
- Choose a setup based on your needs
- Navigate to the directory:
cd <setup-directory>- Create data directories:
mkdir -p mirror-data logs- Start with Docker Compose:
docker compose up -d- View logs:
docker compose logs -f| Feature | Complete SWNG RSync | Specific Version RSync | yum-reposync | Combined Mirror |
|---|---|---|---|---|
| Repository Type | SWNG only | SWNG (version-specific) | SWNG (selective) | CloudLinux + SWNG |
| Sync Method | RSync | RSync | reposync | RSync |
| Disk Space | ~200-500 GB | ~100-200 GB | Varies | ~500 GB - 1+ TB |
| Sync Speed | Fast | Fast | Moderate | Fast |
| Selectivity | Complete | Version-based | Repository-based | Complete |
| Web Server | No | No | No | Yes (optional) |
| Best For | Complete SWNG | Specific versions | Selective repos | Complete setup |
# Container logs
docker compose logs -f
# Sync log files
tail -f logs/*.log# Execute sync script
docker compose exec <service-name> /usr/local/bin/sync-script.shdocker compose downdocker compose restart- Edit configuration files
- Rebuild:
docker compose build - Restart:
docker compose up -d
All setups use Docker volumes for persistent storage:
- Mirror Data: Stored in
./mirror-data/(or subdirectories) - Logs: Stored in
./logs/
# Backup mirror data
tar -czf mirror-backup-$(date +%Y%m%d).tar.gz mirror-data/
# Backup logs
tar -czf logs-backup-$(date +%Y%m%d).tar.gz logs/- Complete SWNG: 2 CPU, 2 GB RAM
- Specific Version: 2 CPU, 2 GB RAM
- yum-reposync: 2 CPU, 2 GB RAM
- Combined Mirror: 4 CPU, 4 GB RAM
- Complete SWNG: ~500 GB
- Specific Version: 100-200 GB per version
- yum-reposync: Varies by repositories
- Combined Mirror: SWNG (~500 GB) + CloudLinux repository (3+ TB)
Recommendations:
- Use a dedicated disk or partition for mirror storage.
- In most cases, sync
repo.cloudlinux.comonly partially (only the repositories you need).
- Initial syncs can use significant bandwidth
- Consider scheduling during off-peak hours
- Use
--bwlimitin rsync scripts if needed
Ensure the following are accessible:
rsync.upstream.cloudlinux.com(port 873)upstream.cloudlinux.com(ports 80, 443)
# Check logs
docker compose logs
# Check container status
docker compose ps
# Check system resources
docker stats# Test connectivity
docker compose exec <service> rsync rsync://rsync.upstream.cloudlinux.com/
# Check disk space
docker compose exec <service> df -h
# View detailed logs
docker compose exec <service> tail -f /var/log/*.log# Check disk usage
du -sh mirror-data/
df -h
# Clean up old data if needed
docker system prune -a# Fix permissions
sudo chown -R $(id -u):$(id -g) mirror-data/ logs/Edit the cron job in the Dockerfile or modify the sync script.
Add custom scripts to the container by:
- Creating the script
- Adding
COPYcommand in Dockerfile - Making it executable
- Rebuilding the image
Each setup supports environment variables for configuration. See individual README files for details.
The combined mirror setup includes an optional Nginx service. Access mirrors at:
http://localhost/cloudlinux/http://localhost/swng/
You can add your own web server service to any docker-compose.yml:
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./mirror-data:/storage:ro
depends_on:
- <mirror-service>- Monitor Logs: Regularly check sync logs for errors
- Disk Space: Monitor disk usage and plan for growth
- Backups: Regularly backup mirror data
- Updates: Keep Docker images updated
- Resource Limits: Set appropriate resource limits
- Network: Use stable, high-bandwidth connections
- Security: Keep containers updated and use proper access controls
After setting up your mirror:
- Verify mirror is accessible via HTTP/HTTPS
- Contact CloudLinux support to add your mirror to rotation
- Monitor sync logs regularly
- Set up alerts for sync failures
For more information about adding your mirror to CloudLinux rotation, see the main ../README.md.
For issues or questions:
- Review the individual setup README files
- Check the main documentation:
../README.md - Contact CloudLinux support