Instead of making packages publicly available, you might want to release packages for only a limited audience, such as your organization or workgroup. In addition, some companies may want to restrict which third-party libraries their developers may use, and thus direct those developers to draw from a limited package source rather than nuget.org.
For all such purposes, NuGet supports setting up a private package source in the following ways:
- Local feed: Packages are simply placed on a suitable network file share, ideally using
nuget addto create a hierarchical folder structure (NuGet 3.3+). For details, see Local Feeds.
- NuGet.Server: Packages are made available through a local server through HTTP. For details, see NuGet.Server.
- NuGet Gallery: Packages are hosted on an Internet server using the NuGet Gallery Project on GitHub. NuGet Gallery provides user management and additional features such as an extensive web UI that allows searching and exploring packages from within the browser, similar to nuget.org.
There are also several other NuGet hosting products that support remote private feeds, including the following:
- Package Management from VS Team Services and TFS
- ProGet from Inedo
- NuGet Server, a community project from Inedo
- Artifactory from JFrog.
- Nexus from Sonatype.
Regardless of how packages are hosted, you access them by adding them to the list of available sources in
NuGet.Config. This can be done in Visual Studio as described in Package Sources, or from the command line using
nuget sources. The path to a source can be anything from a local folder to a network name to an Internet URL.