how to solve the server error - Ports are not available: #8798

Closed
opened 2026-02-21 18:27:44 -05:00 by yindo · 1 comment
Owner

Originally created by @dsbdsb26 on GitHub (Mar 1, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

when i docker compose up -d,run error:(HTTP code 500) server error - Ports are not available: exposing port TCP 0.0.0.0:80 -> 127.0.0.1:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @dsbdsb26 on GitHub (Mar 1, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce when i docker compose up -d,run error:(HTTP code 500) server error - Ports are not available: exposing port TCP 0.0.0.0:80 -> 127.0.0.1:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:27:44 -05:00
yindo closed this issue 2026-02-21 18:27:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 1, 2025):

I found some similar discussions that might help you resolve the server error related to port availability:

  1. How to change the default ports of nginx 80 and 443 - This discussion suggests stopping the service currently using port 80 or modifying the port mapping in your docker-compose.yaml file to use a different port, such as 8080 [1].

  2. How can I use the docker setup behind an nginx proxy? - This discussion addresses conflicts with port 80 and suggests similar solutions [2].

To resolve your issue, you can try the following steps:

  1. Identify and Stop the Service Using Port 80:

    • Use the command sudo netstat -tuln | grep :80 to find the process using port 80.
    • Stop the service with commands like sudo service apache2 stop or sudo service nginx stop.
  2. Modify Port Mapping in docker-compose.yaml:

    • Change the port mapping from 80:80 to another port, such as 8080:80.
  3. Restart Docker Containers:

    • After making the changes, restart your Docker containers with docker compose up -d.

These steps should help resolve the port conflict issue during your local deployment [3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 1, 2025): <!-- Answer --> I found some similar discussions that might help you resolve the server error related to port availability: 1. [How to change the default ports of nginx 80 and 443](https://github.com/langgenius/dify/discussions/13998) - This discussion suggests stopping the service currently using port 80 or modifying the port mapping in your `docker-compose.yaml` file to use a different port, such as 8080 <sup>[[1]](https://github.com/langgenius/dify/discussions/13998)</sup>. 2. [How can I use the docker setup behind an nginx proxy?](https://github.com/langgenius/dify/discussions/12229) - This discussion addresses conflicts with port 80 and suggests similar solutions <sup>[[2]](https://github.com/langgenius/dify/discussions/12229)</sup>. To resolve your issue, you can try the following steps: 1. **Identify and Stop the Service Using Port 80**: - Use the command `sudo netstat -tuln | grep :80` to find the process using port 80. - Stop the service with commands like `sudo service apache2 stop` or `sudo service nginx stop`. 2. **Modify Port Mapping in `docker-compose.yaml`**: - Change the port mapping from `80:80` to another port, such as `8080:80`. 3. **Restart Docker Containers**: - After making the changes, restart your Docker containers with `docker compose up -d`. These steps should help resolve the port conflict issue during your local deployment <sup>[[3]](https://github.com/langgenius/dify/issues/14602)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fc7f4316-03ba-4108-ab05-d05ea93e476d?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8798