Local Mirror

This page contains information on how to run your own private Gentoo mirror.

Setting up your own rsync mirror
Many users run Gentoo on several machines and need to sync the portage trees on all of them. Using public mirrors is simply a waste of bandwidth at both ends. Syncing only one machine against a public mirror and all others against that computer would save resources on Gentoo mirrors and save users' bandwidth.

The same holds true for organizations who would like to control the rsync mirror their servers and workstations sync against. Of course, they usually also want to save on bandwidth and traffic costs.

All you need to do is select which machine is going to be your own local rsync mirror and set it up. You should choose a computer that can handle the CPU and disk load that an rsync operation requires. Your local mirror also needs to be available whenever any of your other computers syncs its portage tree. Besides, it should have a static IP address or a name that always resolves to your server. Configuring a DHCP and/or a DNS server is beyond the scope of this guide.

Setting up the server
There is no extra package to install as the required software is already on your computer. Setting up your own local rsync mirror is just a matter of configuring the  daemon to make your  directory available for syncing. Create the following configuration file:

You do not need to use the  and   options. By default, all clients will be allowed to connect. The order in which you write the options is not relevant. The server will always check the  option first and grant the connection if the connecting host matches any of the listed patterns. The server will then check the  option and refuse the connection if any match is found. Any host that does not match anything will be granted a connection. Please read the man page for more information.

Now, start your rsync daemon with the following command as the root user:

Let's test your rsync mirror. You do not need to try from another machine but it would be a good idea to do so. If your server is not known by name from all your computers, you can use its IP address instead.

You should see the content of /usr/portage on your mirror.

Your rsync mirror is now set up. Keep running  as you have done so far to keep your server up-to-date. If you use cron or similar facilities to sync regularly, remember to keep it down to a sensible frequency like once or twice a day.

Configuring your clients
Now, make your other computers use your own local rsync mirror instead of a public one using Project:Portage/Sync.