# Error DK0031: Port 80 and 443 is used

**URL:** https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101
**Category:** Bug Reports
**Created:** [January 18, 2021, 11:34pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101 "2021-01-18T23:34:14Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ElliottMangham](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/elliottmangham/32/79_2.png) [@ElliottMangham](https://community.kinsta.com/u/ElliottMangham)
#### Post date: [January 18, 2021, 11:34pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/1 "2021-01-18T23:34:14Z")

</div>

Hello,

**The problem**  
During the initial installation I get the following error:  
“Error DK0031: Port 80 and 443 is used”

Screenshot below:

 ![Screenshot 2021-01-18 at 11.28.08 pm](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/0078193a9cc43393ecdfb2e39297412c62378810.jpeg)

I am only given the opportunity to “Retry”, but cannot do anything else about it.

**Computer information:**  
This is a macOS v11.1. I do have Local by Flywheel also installed, which I suspect may be conflicting with the ports.

**Closing notes:**  
I noticed another post about this:

> [@Installation Stops Due to Port Use](https://community.kinsta.com/t/installation-stops-due-to-port-use/63):
>
> Hey all! I started installing DevKinsta this morning but I hit a wall, getting the error that Port 80 or 443 is in use. The Docker suggested solution of killing whatever is on port 80 doesn’t work, and when I kill what’s listening on 443, I still get the error - screenshot below. Is there a way to use this on a separate port that isn’t already used by HTTP/HTTPS? I’m using an iMac Pro running macOS Catalina 10.15.7

> [@Set DevKinsta ports to other than 80/443](https://community.kinsta.com/t/set-devkinsta-ports-to-other-than-80-443/76):
>
> Please allow users to specify ports other than 80 for HTTP and 443 for HTTPS.

Thank you.

---

<div class="post-metadata">

### Author: ![ElliottMangham](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/elliottmangham/32/79_2.png) [@ElliottMangham](https://community.kinsta.com/u/ElliottMangham)
#### Post date: [January 18, 2021, 11:44pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/2 "2021-01-18T23:44:56Z")

</div>

Update: I managed to complete the installation by killing all processes on port 80, however, I have no idea if this is a long-term fix (presumably not).

Mac:

```auto
# find & kill processes which are using port 80
sudo lsof -i tcp:80 | grep LISTEN | awk '{print $2}' | xargs kill -9

```

Windows:

```auto
# find processes which are using port 80
netstat -ano | findstr :80

# kill process by PID. replace "<PID>" with result from the above command.
taskkill /PID <PID> /F

```

Support: [DevKinsta Error Codes - Kinsta](https://kinsta.com/knowledgebase/devkinsta/error-codes/#dk0031)

Best,

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [January 18, 2021, 11:56pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/3 "2021-01-18T23:56:58Z")

</div>

Thanks again for posting a workaround! 🙂  
We’ll have more information on this soon!

---

<div class="post-metadata">

### Author: ![jcasabona](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jcasabona/32/40_2.png) [@jcasabona](https://community.kinsta.com/u/jcasabona)
#### Post date: [January 19, 2021, 1:07am UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/4 "2021-01-19T01:07:22Z")

</div>

Thanks for sharing! Alas I came across and tried this solution but to no avail. There’s _something_ (2 things actually) running on my machine over port 80 that cannot be killed.

---

<div class="post-metadata">

### Author: ![jhcruzr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jhcruzr/32/147_2.png) [@jhcruzr](https://community.kinsta.com/u/jhcruzr)
#### Post date: [January 21, 2021, 7:45pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/5 "2021-01-21T19:45:46Z")

</div>

I followed the same advise given by the online documentation and still have the same issue whenever I close DevKinsta and re-open it. Everytime I start the app I have to use the terminal to kill all tasks using port 80 before it will run properly. Too bad I was not able to test it as I wanted to.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [January 21, 2021, 8:00pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/6 "2021-01-21T20:00:09Z")

</div>

Hi @jhcruzr . Welcome to DevKinsta and apologies for the trouble you’re having. [There’s a feature request to be able to change the ports](https://community.kinsta.com/t/set-devkinsta-ports-to-other-than-80-443/76/4). We hope to have a fix for this soon. Stay tuned!

---

<div class="post-metadata">

### Author: ![kadso](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@kadso](https://community.kinsta.com/u/kadso)
#### Post date: [January 29, 2021, 9:03pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/7 "2021-01-29T21:03:06Z")

</div>

> [@ElliottMangham](#):
>
> `sudo lsof -i tcp:80 | grep LISTEN | awk '{print $2}' | xargs kill -9`

failed to work.  
I look forward to a solution.  
keep up the good work.

---

<div class="post-metadata">

### Author: ![Zach\_Townsend](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/zach_townsend/32/222_2.png) [@Zach\_Townsend](https://community.kinsta.com/u/Zach_Townsend)
#### Post date: [February 1, 2021, 8:59am UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/8 "2021-02-01T08:59:29Z")

</div>

To those who have had trouble killing certain tasks, try putting “sudo” in front of xargs - this worked for me

---

<div class="post-metadata">

### Author: ![kadso](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@kadso](https://community.kinsta.com/u/kadso)
#### Post date: [February 1, 2021, 6:29pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/9 "2021-02-01T18:29:19Z")

</div>

Thanks for the suggestion. I’m not a coder by trade, do you mean:

sudo lsof -i tcp:80 | grep LISTEN | awk ‘{print $2}’ | sudo xargs kill -9

---

<div class="post-metadata">

### Author: ![kadso](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@kadso](https://community.kinsta.com/u/kadso)
#### Post date: [February 1, 2021, 6:43pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/10 "2021-02-01T18:43:12Z")

</div>

@michael any updates that can be shared getting this basic addressed?

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [February 1, 2021, 8:16pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/11 "2021-02-01T20:16:18Z")

</div>

@kadso We’ll have an update on this available shortly. Sorry for the wait!

---

<div class="post-metadata">

### Author: ![ChrisBuck-Harness](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@ChrisBuck-Harness](https://community.kinsta.com/u/ChrisBuck-Harness)
#### Post date: [February 1, 2021, 8:20pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/12 "2021-02-01T20:20:00Z")

</div>

The source of this error is having apache running.

Use the following command:  
sudo apachectl stop

That’s why DevKinsta worked on a different machine with a clean install. Apache wasn’t already running.

---

<div class="post-metadata">

### Author: ![kadso](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@kadso](https://community.kinsta.com/u/kadso)
#### Post date: [February 1, 2021, 9:23pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/13 "2021-02-01T21:23:57Z")

</div>

Thanks for the quick update.

---

<div class="post-metadata">

### Author: ![kadso](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@kadso](https://community.kinsta.com/u/kadso)
#### Post date: [February 1, 2021, 9:28pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/14 "2021-02-01T21:28:32Z")

</div>

> [@ChrisBuck-Harness](#):
>
> sudo apachectl stop

Nice Work Chris! That did it for me.  
Thank you!

---

<div class="post-metadata">

### Author: ![jhcruzr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jhcruzr/32/147_2.png) [@jhcruzr](https://community.kinsta.com/u/jhcruzr)
#### Post date: [February 9, 2021, 5:07pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/15 "2021-02-09T17:07:29Z")

</div>

Has this update been done yet?

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [February 9, 2021, 6:15pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/16 "2021-02-09T18:15:07Z")

</div>

@jhcruzr Not yet I’m afraid. Sorry for the wait!

---

<div class="post-metadata">

### Author: ![omarniu](https://avatars.discourse-cdn.com/v4/letter/o/3be4f8/32.png) [@omarniu](https://community.kinsta.com/u/omarniu)
#### Post date: [February 13, 2021, 4:19pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/17 "2021-02-13T16:19:03Z")

</div>

This did the trick for me:  
`sudo lsof -i tcp:80 | grep LISTEN | awk '{print $2}' | sudo xargs kill -9`

---

<div class="post-metadata">

### Author: ![jhcruzr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jhcruzr/32/147_2.png) [@jhcruzr](https://community.kinsta.com/u/jhcruzr)
#### Post date: [February 13, 2021, 6:05pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/18 "2021-02-13T18:05:18Z")

</div>

Are you installing on a windows machine or apple?

---

<div class="post-metadata">

### Author: ![omarniu](https://avatars.discourse-cdn.com/v4/letter/o/3be4f8/32.png) [@omarniu](https://community.kinsta.com/u/omarniu)
#### Post date: [February 13, 2021, 7:25pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/19 "2021-02-13T19:25:34Z")

</div>

On Mac

For windows there are the following instructions which I am not sure if they solve the issue:

```auto
# find processes which are using port 80
netstat -ano | findstr :80

# kill process by PID. replace "<PID>" with result from the above command.
taskkill /PID <PID> /F

```

---

<div class="post-metadata">

### Author: ![Cheesegrits](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/cheesegrits/32/467_2.png) [@Cheesegrits](https://community.kinsta.com/u/Cheesegrits)
#### Post date: [April 21, 2021, 3:38pm UTC](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101/20 "2021-04-21T15:38:30Z")

</div>

Hey @michael, any update on being able to use different ports for nginx?

This is a show stopper for me. I’m trying to create a workflow for migrating client sites from Joomla to WP, so the Joomla sites live in my host’s native web service. I figured using DevKinsta was a quick way to get the new WP sites installed, work on them locally, and pushed back to Kinsta.

I can’t move the main web service ports, as I have a lot of existing infrastructure and development toolchains that expect them to be on the native ports.

This is pretty fundamental stuff. The DevKinsta containers are literally guests. They shouldn’t assume they can just usurp the default service ports on the host.

I’ve tried changing them in the nginx config in the container, but the container just crashes when I try and restart nginx. I’d be happy with that as a solution for now, if you have any suggestions on how to move the ports by hand while we wait for it to be a built in feature.

Hugh

[Next page](https://community.kinsta.com/t/error-dk0031-port-80-and-443-is-used/101.md?page=2)
