We consider problems of provisioning an excludable public good amongst n potential members of a peer-to-peer system who are able to communicate information about their private preferences for the good. The cost of provisioning the good in quantity Q depends on Q, and may also depend on n, or on the final number of participating peers m. Our aim is to maximize the expected social welfare in a way that is incentive compatible, rational and budget-balanced. Although it is unfortunately almost never possible to calculate or implement a truely optimal mechanism design, we show that as the number of participants becomes large the expected social welfare that can be obtained by the optimal design is at most a factor 1+O(1/n) or 1+O(1/√n) greater than that which can be obtained with a very simple scheme that requires only payment of a fixed contribution from any agent who joins the system as a participating peer. Our first application is to a model of file sharing, in which the public good is content availability; the second concerns a problem of peering wireless local area networks, in which the public good is the availability of connectivity for roaming peers. In both problems, we can cope with the requirement that the payments be made in kind, rather than in cash.