BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk / Raspberry Pi Buster - Local Server problem with Docker setup

Hi,
I’m trying to set up a Local Server on a Raspberry Pi 3B+ with Buster (tried both with desktop and headless and with Raspian Stretch). I am following the steps outlined here:


When I get to the install step of installing Docker:
and try to run:

docker run -p 8080:8080 -p 9443:9443 mpherg/blynk-server

I get the following message:

docker: Error response from daemon: driver failed programming external connectivity on endpoint romantic_hawking (cbe1ac94637156f66daae071f65006efbcd7b5d805c7bf4ec185288613cbbf06): Error starting userland proxy: listen tcp 0.0.0.0:9443: bind: address already in use.

ERRO[0001] error waiting for container: context canceled

I can’t find a way to get past this step. Any words of wisdom?

well,
looks like the port 9443 is already used on your machine. Try to map the container port to a different external port:

docker run -p 8080:8080 -p 9444:9443 mpherg/blynk-server

Thanks for your reply! But:

I start the Blynk server:

pi@raspberrypi:~ $ java -jar server-0.41.11-java8.jar -dataFolder /home/pi/Blynk

Blynk Server successfully started.
All server output is stored in folder ‘/home/pi/logs’ file.

Then I try:
pi@raspberrypi:~ $ docker run -p 8080:8080 -p 9444:9443 mpherg/blynk-server

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.

See ‘docker run --help’.

and tried with sudo:

sudo docker run -p 8080:8080 -p 9444:9443 mpherg/blynk-server

docker: Error response from daemon: driver failed programming external connectivity on endpoint friendly_carson (d58e16b50ac497a062722a232a5b2a8438e3f86a6d9c746ae4a1606995674971): Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already in use.

ERRO[0001] error waiting for container: context canceled

Ideas?

sure, the first error is a simple permission issue - you’re user pi probably does not belong to the docker group and thus is unable to access docker unix socket.
You figured it out by using sudo.
The other error is now complaining about the other port 8080 - to overcome this, you want to map this to other port too.

Anyway, from your description I have no idea what you’re trying to achieve.
Why are you starting up 2 servers?
The first one you started with the java command took the ports (8080, 9443), so obviously, the docker is unable to map the internal ports to them.
either use -p 8081:8080 -p 9444:9443 or just don’t run the first server using java.

Thanks.
I am following the Blynk Local Server Setup guide here - https://github.com/blynkkk/blynk-server#blynk-server

so, I think a takeaway from your post is that I can’t start the blynk server and run the docker container at the same time. In other words I should be able to stop the blynk server and start it via the docker container. Is this the right way to think about it.

As you can surmise I am new to this and don’t really know wtf I’m doing.

thanks again.

correct.
you have 2 options on how to run the server - directly by running java, or dockerized, where the java is ran from the container.
If you happen to need multiple blynk servers running on the same machine, you got to make them use unique ports.

1 Like