How to create public mirrors for CentOS
Contents
CentOS welcomes new mirror sites.
If you are considering setting up a public mirror site for CentOS please follow these guidelines to make sure that your mirror is consistent with the other mirror sites.
As a first step, we'd like you to be subscribed to the following lists:
the CentOS-mirror mailing list: https://lists.centos.org/mailman/listinfo/CentOS-mirror (where you can post and announce your public mirror)
the CentOS-mirror-announce mailing list: https://lists.centos.org/mailman/listinfo/centos-mirror-announce (low traffic, moderated and for announcements by the CentOS team going out to the admins of public CentOS mirrors)
CentOS Linux (All versions) and CentOS Stream 8
As CentOS Stream 8 and CentOS Linux 7 will be going EOL in 2024, and that we already have enough mirrors in the current pool, we'll not add any other mirror anymore
For hard disk space requirements, please refer to the dir_sizes files in the root directory of http://mirror.centos.org/. Please note that at point release times (such as 6.8 -> 6.9) both the old and new releases will be kept on mirrors for a few weeks. 400 GB of storage space is probably sufficient for the next few years.
For your first mirror synchronization, you must use one of the external mirrors providing rsync access. You can find that list here: https://centos.org/download/mirrors/
You should also set up a cron job to sync your mirror from that external mirror periodically. Once you have verified that your mirror syncs properly and all your mirror URLs work, please email the centos-mirror mailing list with your mirror details. Once we have verified that your mirror matches the requirements, we will add you to our list of mirror sites and you can switch to rsyncing from rsync://msync.centos.org/CentOS/
Before submitting your mirror, you should check that all your mirror URLs work properly from outside your organization. Firewall problems are surprisingly common. If your mirror has an IPv6 address, you should check IPv4 and IPv6 separately. Both curl and rsync have -4 and -6 options for selecting the protocol.
In your mirror submission, please provide all relevant URLs (http/https/rsync) as well as how often you are synchronizing from the mirror network. Please include what city/state/country you are in and what your bandwidth (speed) is. Also please give a name and link to the sponsoring organization so we can give proper credit. If the best contact point for your mirror is not the address you are subscribed to the mailing list with, please provide the email address of your preferred contact as well.
Next step is to open a CentOS Infra ticket using the 'mirror-request-legacy' Issue type (sign in using your CentOS Account, which is required to create ticket). This will start a template for you to fill out with the required details and once submitted someone from the "infra and releng" team will work on your mirror proposal.
We are currently concentrating on HTTP and RSYNC mirrors. We no longer accept FTP URLs for new mirrors. HTTPS is currently not used for mirrors, but we have started collecting HTTPS URLs for possible future inclusion to the mirrorlist. If you set up HTTPS, please do not redirect HTTP requests to HTTPS. There may be organizations that allow outbound HTTP connections but not HTTPS connections, and any redirects may cause problems for them.
Public mirrors should synchronize ~6 times per day and this should be run via cron. We highly recommend the use of lock files in your cron script so that you don't spawn multiple connections which is hard on our servers and on your mirror. If you don't know how to do this, please ask the list.
Once your server has been added to the mirrors database, and your IP allowed (and so ticket being worked on), the best way to keep your mirror updated directly from a centos.org machine would be to use the following script (to give you an idea):
rsync -aqzH --delay-updates --delete-after msync.centos.org::CentOS /path/to/local/mirror/root
- There are actually two rsync targets/modules that people can sync from :
- ::CentOS : Contains the traditional CentOS linux distributions and updates for x86_64 and i386
::altarch : Contains the additional platforms built and maintained by CentOS AltArch SIG: aarch64, armhfp, i386, power9, ppc64, ppc64le.
If you mirror AltArch, you must put CentOS and altarch content into different directories, e.g. /var/www/html/centos and /var/www/html/centos-altarch. Sharing a single directory for main CentOS content and AltArch content is not possible. The altarch rsync target is not a superset of CentOS, i.e. altarch contains only alternative architecture content.
NOTE:
msync.centos.org is resolved automatically by our GeoIP enabled dns setup. So that means that you'd get a node in your country/continent if it exists, or from nearest one
TIP: If you are using >= 2.6.4 version of rsync, you might want to specify the --delay-updates switch to the above line in your cron job)
CentOS Stream 9
Starting with CentOS Stream 9 we are managing mirrors using Fedora's Mirrormanager. You may already have a site configured if you mirror EPEL or any of the Fedora releases. If you are not yet registered in mirrormanager, visit the above link and sign in using your CentOS Account to set up a new site.
Once you have a site, please open a CentOS Infra ticket using the 'mirror-request' Issue type. This will start a template for you to fill out with the name of your site and a few more details so that we can enable the CentOS categories on your mirror.
We have a separate RSYNC target to seed from for CentOS Stream releases from 9 on:
rsync -aqzH --delay-updates --delete-after rsync.stream.centos.org::CentOS-Stream-All /path/to/local/mirror/root
If you choose to, you can exclude Source RPMs:
rsync -aqzH --delay-updates --delete-after rsync.stream.centos.org::CentOS-Stream-nosrc /path/to/local/mirror/root
You can also exclude debuginfo RPMs:
rsync -aqzH --delay-updates --delete-after rsync.stream.centos.org::CentOS-Stream-nodebug /path/to/local/mirror/root
General notes
NOTE: If you have a data cap which is lower than 15 TB (depending on region), please don't try to add that machine as a mirror. Please also note: If you are in a country which already has a lot of mirrors (like most western countries do, but also some Asian countries), please refrain from trying to add mirrors which have less than 100Mbit/s. If there aren't that many mirrors in your country, we will also accept lower speeds, naturally.
Please alert the CentOS-mirror mailing list if anything about the server changes like location, contact email address, URLs, sponsor, IP addresses etc.
Please note that U.S. Export Administration Regulations prohibit exporting CentOS software to some countries and consequently, we can't add mirrors from those countries. The current list of restricted countries can be seen on the CentOS Legal page, first paragraph.
We also maintain a presence on Freenode IRC channel #centos-mirror in case you have questions. Adding new mirrors or changes to the existing ones should still be handled via the mailing list so that we would have a record of the requests.