Can we use Caddy alongside IIS on same machine?

1. The problem I’m having:

Not so much as a problem as a question before I head down this rabbit hole. I am just wondering if it is possible to run Caddy Web Server alongside of IIS(Internet Information Services) on the same physical web server machine. Currently we have several internal, private, not public facing websites running with IIS on this machine.

I am currently fighting with the configuration of one of them and am starting to wonder if I might have better luck with Caddy for this specific site. So I am wondering if I can fire up Caddy to serve this one specific internal site without it causing any issues with the other sites on IIS? The domain I want to move looks like ‘example.domain.local’. And it will be using HTTPS with a local, trusted cert that I have created. Setting up and configuring HTTPS properly is actually the problem I am having with this site currently.

I have had previous experience with Caddy in other situations and have enjoyed using it. I like it better than IIS for sure! :slight_smile:

You can run as many webservers on the same machine as you like, as long as neither of them listens on the same IP:PORT as the other one.

For example, if your server has only one IP address, then you can run IIS on port 80 and Caddy on port 81. If your server has multiple IP addresses, you can run IIS on IP1 port 80, and Caddy on IP2 port 80.

In other words, you cannot run both IIS and Caddy on the same IP address and the same port.

What I would do, if I wanted to run Caddy but needed IIS as well:

  • configure IIS to listen on port 8080
  • configure Caddy to listen on port 80 and 443
  • configure Caddy to act as a reverse proxy for those sites you want being served by IIS
2 Likes

Thank you.

Does the IP address matter that much if all these sites are internal? I just assumed I could serve ‘example1.domain.local’ and ‘example2.domain.local’ on IIS and ‘example3.domain.local’ on Caddy. We reach these sites on our internal network with those .local addresses.

It doesn’t matter how you’re going to access the site. I mean it does matter but not in this phase yet. When you starting a webserver application, it needs to bind to a certain IP address and certain port. Two webserver applications cannot bind to the same IP:PORT. So, if you have only one IP address on your server, you won’t be able to bind two different application to the same port. Your webservers wouldn’t be able to start. One of them would, the other one would give you an error saying that the port is already occupied.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.