Create separate IIS sites for different services

Hi there

Our .NET 5 solution (built on the framework) is a single solution with several hosts which need to be run on their own port or sub-domain.


I’ve successfully got them built in TC and then pushed to Octopus. What has caught me out is how to get each running as it’s own IIS website.

Is there a recommended way to do this that I haven’t spotted? They should really all deploy at the same time rather than have separate builds/releases I think.


Hello @david4,

Thanks for reaching out!

To make sure I understand correctly, are you creating a single package that contains the solution with all of your hosts, or are you creating a separate package for each of the hosts in your solution?

Best regards,
Mark Butler

Yes. It’s currently it’s just a single package, created from a single TC .NET build step and pushed to octopus.

Structure is like this

Shout\aspnet-core\Shout.sln (main solution we build)
Shout\aspnet-core\src\Shout.IdentityServer\Shout.IdentityServer.csproj (port 1234)
Shout\aspnet-core\src\Shout.HttpApi.Host\Shout.HttpApi.Host.csproj (port 4321)

Hi David,

Thanks for following up and clarifying that! I’m jumping in here for Mark as he’s currently offline as part of our US-based team.

I believe the best solution to deploy multiple IIS sites from one package would be to set up an IIS step for each individual website. Where you’d select the same package for each, but each pointing to a different website and relative path under the package installation directory.

I’m wondering if that would do the trick for you? Happy to reconsider if I’ve by chance misinterpreted anything. :slight_smile:

Best regards,


Hello @david4,

Along with what Kenny had suggested, you could also take advantage of the IIS Website - Create community step template for this.

In your deployment process, you could create a Deploy to IIS step that would create an initial website, take care of any variable transformations, and deploy the package to your server resulting in a single directory being created for the content of the package.

You could then create subsequent steps using the IIS Website - Create community step for each remaining website referencing the directory created in the first deploy step for the site’s home directory combined with the relative path for the site.

This would allow you to create individual IIS sites with unique bindings but only deploy the package once.

Please let me know if you have any further questions or need any clarification.

Best regards,
Mark Butler

Thanks for that, we’ve got everything working now. Quite pleased with end end result!

1 Like