Setting up a NuGet server with ProGet

Ever wondered how to setup your own NuGet server? nuget.org have a guide and I actually hosted a couple of feeds that way in the past. At my day job we implement a lot of micro services. Some of these services distribute client libraries through NuGet and they all gets deployed to different environments using Octopus deploy. Octopus is based on NuGet as well, why we need to be able to host multiple private feeds for various purposes. Having wet dreams about build environments already, made this an excellent challenge for a guy like me: settings up multiple NuGet feeds to support both private feeds and Octopus.

I began looking at different technologies to implement this:

  • Nexus: supports NuGet, but it is pretty expensive.
  • MyGet: provides NuGet feeds in the cloud. Big companies like eBay doesn’t really like hosting anything outside its own cloud.
  • Self-hosted feeds: quickly becomes a pain, because I would need multiple web projects hosted on an IIS, in order to get multiple feeds.
  • Implementing it myself: would be fun but too time consuming.

That’s when a co-worker mentioned ProGet. What is ProGet?

ProGet is a NuGet package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds.

Great! Someone already build the tool I have wanted to build since NuGet launched. Let’s look at how to setup a new ProGet installation:

  1. Navigate to http://inedo.com/proget/overview and download ProGet.
  2. For starters check the Free Edition:
  3. Input your email and name:
  4. Just accept the default installation directory, unless you have some weird perversion about where to put your files.
  5. ProGet can run entirely self-hosted or using external ressources. In this installation I’m choosing to use an embedded SQL Express:
  6. Like in the previous step, I’m choosing to use the integrated web server. ProGet can run on IIS as well but in my case, I just want a simple setup without external dependencies. As default ProGet wants to run on port 81. I’ve changed the port to 80, because ProGet will be the only HTTP aware process on the host:
  7. ProGet is hosted as a Windows Service. In the account settings, I’m going with the default settings, which is running the service as Network Service:
  8. Review the settings and hit Install:
  9. That’s it. ProGet were successfully installed. Hit the slightly oversized Launch ProGet button:
  10. The frontpage of ProGet is actually pretty useless for my purpose. I always use Visual Studio and NuGet Package Explorer to browse packages. Adding packages to ProGet, is something I would like to do as a build step on TeamCity or similar. Hit the Gear icon in the upper right corner:
  11. Login and you will be presented by the great part of ProGet. The admin lets you setup system settings, user and roles and probably the most exciting feature: feeds. Click the Manage Feeds link:
  12. The feeds page shows a list of all your NuGet feeds. As default ProGet adds a single feed named Default. You can setup multiple feeds, which in my case is used to make individual feeds for third-party packages, internal packages and deployment packages. Hit the small pencil icon next the Default feed:
  13. The Feed Properties page lets you configure the Default feed. ProGet have a great feature, where it will actually cache all downloaded packages locally. This way you can use ProGet as a proxy/cache of the unstable nuget.org.
  14. The Connectors paragraph makes it possible to add multiple NuGet sources to the Default feed. This way you can use ProGet to aggregate NuGet packages from multiple sources. Unfortunately, ProGet doesn’t support the NuGet feed published by TeamCity, because Jetbrains choose not to support NuGet version 2.

There you have it. A walk through of the basic ProGet features. ProGet turned out as a great product, able to host internal packages, cache third-party packages and aggregate multiple feeds.