---
title: "Setting Up a Custom NuGet Server in IIS on Windows Server"
description: "Learn how to set up a custom NuGet server in IIS on Windows Server with this hands-on, example-driven tutorial."
canonical: "https://adamtheautomator.com/nuget-server/"
---

# Setting Up a Custom NuGet Server in IIS on Windows Server

> Learn how to set up a custom NuGet server in IIS on Windows Server with this hands-on, example-driven tutorial.

Source: https://adamtheautomator.com/nuget-server/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Setting Up a Custom NuGet Server in IIS on Windows Server](https://adamtheautomator.com/wp-content/uploads/2026/08/5136_featured_image.webp)

# Setting Up a Custom NuGet Server in IIS on Windows Server

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)15 December 20205 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Microsoft Windows Server](/tag/microsoft-windows-server/)[NuGet](/tag/nuget/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Creating a Visual Studio Project](#creating-a-visual-studio-project)
*   [Installing the Windows features NuGet Server (IIS)](#installing-iis)
*   [Prepping the Web Config](#prepping-the-web-config)
*   [Configuring IIS](#configuring-iis)
*   [Changing the Packages Directory](#changing-the-packages-directory)
*   [Setting an API Key in web.config](#setting-an-api-key-in-web-config)
*   [Updating NuGet.Server](#updating-nuget-server)
*   [Next Steps](#h-next-steps)

So you’ve developed code. Great! Now you have to publish it to your users. But how? There are many ways to accomplish this but one of the most used is [NuGet](https://docs.microsoft.com/en-us/nuget/what-is-nuget). [NuGet](https://adamtheautomator.com/nuget-package-manager/ "NuGet") is a technology that allows you to publish code in the form of packages for others. A NuGet server is a way to make it happen.

Not a reader? Watch this related video tutorial!

**_Not seeing the video? Make sure your ad blocker is disabled._**

NuGet has become popular mostly due to its widespread adoption as a package manager and its integration with Microsoft’s developer tools. The NuGet packaging system allows developers to bundle code into _packages_ that you can then easily distribute for others to use.

NuGet has two main components; a client and a server. A NuGet server hosts a repository which then contains packages for distribution. The NuGet client is a client-based component that is used to create local packages and upload them to server repositories. Various clients then download these packages over HTTP/HTTPS.

NuGet.Server is the basis of all of the other NuGet products you’ll be learning about here. It’s important to first learn about NuGet.Server and how to set it up before diving into other alternatives.

By setting up plain ol’ NuGet.Server with IIS will give you a lot of background knowledge about how the other NuGet server products behave.

## **Prerequisites**

Before we get too far, you’re going to need a few things to get NuGet.Server set up.

*   [Visual Studio](https://visualstudio.microsoft.com/downloads/) – 2017 or newer is preferred and the Community Edition will work. This can be installed on a workstation and does not need to be installed on the server.
*   [ASP.NET and web development](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio?view=vs-2019) workload for Visual Studio.
*   [Windows Server](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019) – Any currently supported version of Windows Server version will work, but all of the screenshots have been taken on Windows Server 2019 Standard.

> _Note that you do not need [NuGet.Server](https://github.com/NuGet/NuGet.Server) itself upfront. You are not required to manually download this ahead of time because it will be installed using the NuGet package manager integrated into Visual Studio._

## **Creating a Visual Studio Project**

To get started creating a NuGet.Server, you’ll need to first create a project in Visual Studio. To do so, create a new project in Visual Studio with the _ASP.Web Application (Visual C#)_ template as shown below.

You can name the app whatever you want except for NuGet.Server. If you name your app NuGet.Server, it will cause a name conflict with the package that you will download later causing headaches down the road.

![Creating an ASP.NET Web Application in Visual Studio](/wp-content/uploads/2019/09/visual-studio-asp-application.png)

Creating an ASP.NET Web Application in Visual Studio

Next, select the empty template. This will create an empty web app, which you will use to install the NuGet.Server package into. To do this, right-click on the project in the Solution Explorer and select _Manage NuGet Packages_ as shown below_._

![Manage NuGet Packages](/wp-content/uploads/2019/09/manage-nuget-packages.png)

Manage NuGet Packages

On the window that opens, search for NuGet.Server and select the version you want to install. Once selected, Visual Studio will start to download and install the dependencies into the project.

Once that is done, change the project from _Debug_ to _Release_ so that the final server does not include the debug logging.

![Setting the Visual Studio project to Release](/wp-content/uploads/2019/09/visual-studio-debug-release.png)

Setting the Visual Studio project to _Release_

Next, build the project by clicking on the _Build_ tab and selecting _Build Solution_.

![Building NuGet.Server project](/wp-content/uploads/2019/09/visual-studio-build-solution.png)

Building NuGet.Server project

If you left the repo location as default, the application will be built at _C:\\Users\\<username>\\source\\repos\\<AppName>\\<AppName>._ The folder will look something like what is shown below. You will need this project folder to copy to your web server.

![NuGetServerApp project directory](/wp-content/uploads/2019/09/nuget.server-setup.png)

NuGetServerApp project directory

If you’re unsure of where your project folder is at, you can always see it in your properties for the project.

![Visual Studio project folder location](/wp-content/uploads/2019/09/visual-studio-project-folder.png)

Visual Studio project folder location

## **Installing the Windows features NuGet Server** (IIS)

Next, install the Windows features NuGet.Server requires on the server. To install all the needed roles on your server, launch an administrative PowerShell session and run the `Install-WindowsFeature` cmdlet with all of the necessary features as shown below.

```powershell
Install-WindowsFeature Web-Server,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Filter,Web-ISAPI-Ext -IncludeManagementTools
```

Once the IIS role and other features are installed, copy over the project folder (probably _C:\\Users\\<username>\\source\\repos\\<AppName>\\<AppName>)_ to a directory on your web server. The default location for web apps is _C:\\inetpub\\wwwroot_. This is the directory I will be assuming your project is in.

## **Prepping the Web Config**

Next, you’ll need to inspect the _web.config_ file on the web server. This file will be in the root of the build folder you copied to your web server. Open the _web.config_ file with your favorite text editor. You will see two similar lines that start look like the following:

```xml
<compilation debug="true" targetFramework="<version>" />
```

For example, see below.

![web.config file](/wp-content/uploads/2019/09/webconfigfile.png)

web.config file

Remove one of the compilation lines and leave the one with the newer version.

> _Note: If you fail to do this, you will receive an internal server error message when you launch your webpage._

## **Configuring IIS**

Now that you have the NuGet.Server files on your web server, open _IIS manager,_ right-click on the default web site and select _New Application_ as shown below.

![Adding an IIS application](/wp-content/uploads/2019/09/iis-add-application.png)

Adding an IIS application

Provide a name for the application. You can see an example of what you’ll be looking at below.

![Adding an IIS application](/wp-content/uploads/2019/09/iis-add-applicaton.png)

Adding an IIS application

Now if you navigate to your web server URL you should see something like below.

![NuGet.Server packages page](/wp-content/uploads/2019/09/nuget-server.png)

NuGet.Server packages page

Take note of the package URI on the page. In the above example, it is _http://172.16.8.132/NuGet/nuget_. You will need this for later.

## **Changing the Packages Directory**

By default, packages are stored in _C:\\inetpub\\wwwroot\\<AppName>\\Packages._ If you’d rather change that location, you can do so in the _web.config_ file.

You can also map the package folder to another path. This could be used when you have a small drive that you have the web server files on, but you have another drive that is larger for containing the packages. To change the package path change the _packagesPath_ value in the _web.config_.

Once you are done making your changes to the _web.config_ file, restart the website to  load the new settings. To do this, from _IIS Manager_, right-click on the website and select _Manage Website_ and then on _Restart_ as shown below.

![Restarting NuGet.Server in IIS](/wp-content/uploads/2019/09/restart-iis-site.png)

Restarting NuGet.Server in IIS

## **Setting an API Key in web.config**

Take a look at the _web.config_ file snippet below. By default, the API key is blank. That’s a problem.

![API key in web.config file](/wp-content/uploads/2019/09/web-config-api-ky.png)

API key in web.config file

If you’d like to password protect your NuGet packages, you can add an API key here. When an API key is added, you will be required to use this every time you need to add or delete packages from the repository.

Once the key is added to the _value_ for _apiKey_ save the file. You can instead change the value for _requireApiKey_ to _false_ to not need an API key to add or delete packages.

## Updating NuGet.Server

Now you have your NuGet.Server set up, what’s next? NuGet.Server is a Nuget package manager and has frequent updates that you will want to take advantage of.

To update a NuGet.Server, open your previous project. This is the same path where your project is built that you located earlier. Or if you open Visual Studio, it may be listed in your recent projects.

Once it is opened right-click on the project in the _Solution Explorer_ and select _Manage NuGet Packages_. From here you can see all the packages that have updates. Select NuGet.Server and click update as shown below.

![Updating NuGet.Server in Visual Studio](/wp-content/uploads/2019/09/nuget.server-setup-1.png)

Updating NuGet.Server in Visual Studio

This will update NuGet.Server and all the dependencies that require updates. It’s that easy!

## Next Steps

At this point, you should now have a brand new NuGet.Server instance running on your machine. Congratulations on setting that up! But this step is just the beginning.

Continue your journey and check out all of the [other NuGet articles](https://adamtheautomator.com/tag/nuget/) we have here on ATA!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fnuget-server%2F&text=Setting%20Up%20a%20Custom%20NuGet%20Server%20in%20IIS%20on%20Windows%20Server)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fnuget-server%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fnuget-server%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-design-4.png)

### [Disabling Windows Firewall: A Comprehensive Guide](/disable-windows-firewall/)

Learn various methods to disable the Windows firewall, including GUI tools, PowerShell, command-line, and group policy.

![](https://adamtheautomator.com/wp-content/uploads/2020/01/suit-673697_1920.jpg)

### [Master NIC Teaming with PowerShell and GUI](/nic-teaming/)

Learn about NIC Teaming, its benefits, and how to deploy it using PowerShell or GUI. Improve your networking skills and VM performance.

![](https://adamtheautomator.com/wp-content/uploads/2019/12/chocolatey.jpeg)

### [Chocolatey Installation: A Step-by-Step Guide](/install-chocolatey/)

Install Chocolatey and master the basics of this powerful Windows package manager. Simplify software management and boost your IT efficiency.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
