Failed to connect to localhost port 8081: Connection refused - Docker install #2425

Closed
opened 2026-02-28 01:11:44 -05:00 by deekerman · 1 comment
Owner

Originally created by @UKnau22 on GitHub (Aug 9, 2023).

I have MotionEye installed in Docker and an rtsp camera connected to it. Within MotionEye I can access the camera stream, save motion triggered events/movies to my NAS etc... Everything is working great.

When I try to access the stream through the streaming URL 192.xxx.x.xxx:8081 in any web browser the "ERR_CONNECTION_REFUSED" message comes up.

In HomeAssistant I can access the stream through port 192.xxx.x.xxx:8765, however when I tap on the picture entity card to expand the stream a broken link shows up.

I'm running out of ideas how to fix this...
Untitled
Untitled1

Any help, pointing me in the right direction would be appreciated

Originally created by @UKnau22 on GitHub (Aug 9, 2023). I have MotionEye installed in Docker and an rtsp camera connected to it. Within MotionEye I can access the camera stream, save motion triggered events/movies to my NAS etc... Everything is working great. When I try to access the stream through the streaming URL 192.xxx.x.xxx:8081 in any web browser the "ERR_CONNECTION_REFUSED" message comes up. In HomeAssistant I can access the stream through port 192.xxx.x.xxx:8765, however when I tap on the picture entity card to expand the stream a broken link shows up. I'm running out of ideas how to fix this... ![Untitled](https://github.com/motioneye-project/motioneye/assets/114884846/57b19e16-7f48-4176-8dcf-49fa01343885) ![Untitled1](https://github.com/motioneye-project/motioneye/assets/114884846/592acd21-c3c3-4816-9736-24eca93b911e) Any help, pointing me in the right direction would be appreciated
Author
Owner

@eregnier commented on GitHub (Dec 9, 2024):

by default motion configuration file sets motion to listen localhost only for both web app and video stream.
It looks like you were able to see video from local software on device hosting motion or something like this, but not from another device by reaching the motion device from a 192.168.x.x lan address.

the principle here is to set stream_localhost off (instead of on) and webcontrol_localhost off (instead of on) in the motion configuration file located in /etc/motion/motion.conf

if you are in a docker execution context depending on how is build motion image, you might be able to mount the configuration file as a volume and update it's content before launching the container.

@eregnier commented on GitHub (Dec 9, 2024): by default motion configuration file sets motion to listen localhost only for both web app and video stream. It looks like you were able to see video from local software on device hosting motion or something like this, but not from another device by reaching the motion device from a 192.168.x.x lan address. the principle here is to set stream_localhost off (instead of on) and webcontrol_localhost off (instead of on) in the motion configuration file located in /etc/motion/motion.conf if you are in a docker execution context depending on how is build motion image, you might be able to mount the configuration file as a volume and update it's content before launching the container.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/motioneye#2425
No description provided.