Comprehensive TeX Archive Network

Be­com­ing A CTAN Mir­ror

Hav­ing a … CTAN mir­ror will change your life. – M. Doob

You can help out the TeX com­mu­nity by run­ning a mir­ror of the Com­pre­hen­sive TeX Archive Net­work. This page con­tains di­rec­tions on how to be­come an of­fi­cial CTAN mir­ror. They should suf­fice if you run Linux and prob­a­bly also if you run Mac­in­tosh OS X. (If you write up in­struc­tions for a Win­dows sys­tem, please, let us know.)

CTAN has two core sites, which in­stall new pack­ages and pack­age up­dates. There are also a fair num­ber of sites that par­tic­i­pate as mir­rors, who copy our hold­ings ev­ery night and then makes those files avail­able to oth­ers in the TeX com­mu­nity. At the core sites we redi­rect re­quests for file down­loads to our mir­rors, thereby re­duc­ing the load on the pri­mary sites. We do this by send­ing users to web ad­dresses be­gin­ning with mirror.ctan.org, which sends the user to a ran­domly-se­lected of­fi­cial mir­ror in their re­gion.

If you de­cide to be­come a mir­ror then once you have it set up, it mostly runs it­self. So this is a low-im­pact way to help out. You need a per­ma­nent IP ad­dress and at least 20 GB of hard drive space free (30 GB leaves room to grow). The traf­fic is not too much, but if we have enough mir­rors then of course each of them help­ing a lit­tle re­sults in an over­all help that is big.

Th­ese are the steps to set­ting up a mir­ror. More on each is in a sec­tion be­low.

  • Giv­ing vis­i­tors ac­cess to files means run­ning ei­ther a web or FTP de­mon, or both.
  • Get the files to hold from us by run­ning rsync.
  • Up­date those files ev­ery day. This means run­ning rsync as a cron job.
  • Sign up to be an of­fi­cial mir­ror.


The two most pop­u­lar way to of­fer the files to your vis­i­tors are over HTTP and over FTP. To keep the dis­cus­sion straight­for­ward, the ex­am­ples be­low as­sume that you keep the archive in the /var/ftp/pub/tex-archive di­rec­tory.

If you will of­fer the ma­te­ri­als over HTTP then you must have a web server. We use Apache. Set­ting up the web server is be­yond this doc­u­ment's scope. How­ever, here are a few sug­ges­tions to con­sider.

  • One way to make the archive avail­able is by putting a soft link in­side your doc­u­ment root. With the de­fault Apache setup, this
     ln -s /var/ftp/pub/tex-archive
    makes http://www.example.com/tex-archive give the page show­ing the top level di­rec­tory for the archive.
  • You want to keep files in the archive that hap­pen to be named index.html from be­ing served by your Apache as the in­dex of that di­rec­tory's page. Put some­thing like this in your con­fig­u­ra­tion file.
    <Directory />  # prevent web visitors from seeing outside the web tree
      Order Deny, Allow
      Deny from all
    <Directory /var/www/html>  # allow web visitors to see in the web tree
      Order Allow, Deny
      Allow from all
      Options +FollowSymLinks
    <Directory /var/www/html/tex-archive> # soft link to CTAN tree
      Order Allow, Deny
      Allow from all
      Options -ExecCGI, +FollowSymLinks, -Includes, -IncludesNOEXEC, +Indexes
      DirectoryIndex      # no value, so 'index.html' is not used

To of­fer ma­te­ri­als over FTP, you must have an FTP de­mon run­ning. We use vs­ftpd but there are many oth­ers. Set­ting up the de­mon is be­yond our scope, but if your doc­u­men­ta­tion does not cover how to al­low anony­mous ac­cess then just get new server soft­ware.


To keep your ma­te­ri­als up to date run rsync. This pro­gram does the trans­fers ef­fi­ciently, sav­ing both us and you a great deal of net­work traf­fic.

You must mir­ror from one of these pri­mary CTAN nodes. The ex­am­ple be­low uses the first but you should pick the one near­est to you.

Site Lo­ca­tion
rsync://rsync.cam.ctan.org/CTAN Eng­land
rsync://rsync.dante.ctan.org/CTAN Ger­many

The com­mand be­low will get ev­ery­thing on CTAN and put it on your hard drive. Use it the first time you get from the archive, and also for later up­dates. Note that the first time you run it the com­mand can take quite a long time — hours, per­haps, de­pend­ing on the con­nec­tion speed.

  rsync -av --delete rsync://rsync.cam.ctan.org/CTAN /var/ftp/pub/tex-archive

A sum­mary of what the op­tions mean:

  • -a puts you in archive mode so that you look through di­rec­to­ries re­cur­sively, pre­serve times­tamps, etc.
  • -v is for ver­bose out­put that re­ports the files down­loaded and deleted
  • --delete will delete files that used to be on CTAN but are no longer there.

Be­fore you run the above com­mand, you can check that you will get the re­sult that you ex­pect by us­ing the -n op­tion, as in rsync -avn --delete ... This will say what would be done with­out do­ing it.


You must run the above com­mand ev­ery day. At the com­mand line ask for crontab -e and in the ed­i­tor that ap­pears en­ter a line like this.

  31 2 * * * rsync -a --delete rsync://rsync.cam.ctan.org/CTAN /var/ftp/pub/tex-archive
The data at the start of that line means that your sys­tem will run the rsync com­mand

  • at 31 min­utes past the hour
  • of the 2-th hour of the day
  • on ev­ery day of the month
  • and dur­ing ev­ery month of the year
  • and ev­ery day of the week (that is, Sun­day thru Satur­day).

Please change these num­bers when you set yours up, so that not ev­ery­one in the world hits us at the same in­stant. Pick a time that is in the mid­dle of the night at the lo­ca­tion of the archive that you are mir­ror­ing.


This doc­u­ment is based on a pre­sen­ta­tion by M. Doob at the 2001 meet­ing of the TeX Users Group. Writ­ten 2001-Sep-11 by J. Hef­feron, up­dated 2009-July-02.


Once you have got­ten the files, and the cron job is work­ing, and you have checked that you are of­fer­ing pub­lic ac­cess, then you can be­come an of­fi­cial mir­ror by fill­ing out the form be­low.

Your mir­ror's in­for­ma­tion

Fields marked with an as­ter­isk(*) are re­quired. You must give an ad­dress for at least one of FTP, HTTP, or RSYNC (any that you are not of­fer­ing leave blank).

Name (usually: your host name, such as 'joshua.smcvt.edu')*

Name of the contact person*

Email of the contact person*

Country containing your mirror*

Region within the country

City within the country

Mirror from*

Address for FTP (such as 'joshua.smcvt.edu/tex-archive').

Address for HTTP (such as 'joshua.smcvt.edu/tex-archive').

Address for Rsync (such as 'rsync.joshua.smcvt.edu/CTAN').


You will be en­rolled in the low-traf­fic mail­ing list for our mir­ror main­tain­ers.

Note: we mon­i­tor mir­rors to check that they are up to date. If your mir­ror falls be­hind then mirror.ctan.org will not redi­rect to it, and we shall have to re­move it from the of­fi­cial list.

Guest Book Sitemap Contact