[Raspberry] Setting host-port with "docker-run -p" does not work (defaults to 80) #1930

Closed
opened 2025-10-09 17:36:49 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @Timeeee on GitHub.

I'm using the raspberry-image.

Using the docker-run command from the wiki doesn't set the containers host port correctly.

running

docker run -d --name bitwarden -v /bw-data/:/data/ -p 8080:8080 bitwardenrs/server:raspberry

adds the container with exposed port 8080, but the host port is set to 80. This leads to issues as I have another service running with host-port 80.

I didn't try using a fixed IP with port, as this is not possible in my environment.

Originally created by @Timeeee on GitHub. I'm using the raspberry-image. Using the docker-run command from the wiki doesn't set the containers host port correctly. running > docker run -d --name bitwarden -v /bw-data/:/data/ -p 8080:8080 bitwardenrs/server:raspberry adds the container with exposed port 8080, but the host port is set to 80. This leads to issues as I have another service running with host-port 80. I didn't try using a fixed IP with port, as this is not possible in my environment.
Author
Owner

@Timeeee commented on GitHub:

I assumed there is a way to change the host port itself (not the forwarding) with -p as well. So there is no way to change the host port, which is in this case fixed to 80, right?

edit: I will play around some more with the settings, looks like I might have messed up something. Will give feedback once I did that. Sorry for creating the issue in the first place @mprasil !

Fantastic work btw :)

@Timeeee commented on GitHub: I assumed there is a way to change the host port itself (not the forwarding) with `-p` as well. So there is no way to change the host port, which is in this case fixed to `80`, right? edit: I will play around some more with the settings, looks like I might have messed up something. Will give feedback once I did that. Sorry for creating the issue in the first place @mprasil ! Fantastic work btw :)
Author
Owner

@Timeeee commented on GitHub:

Thank you very much, I finally got it running!

@Timeeee commented on GitHub: Thank you very much, I finally got it running!
Author
Owner

@mprasil commented on GitHub:

Well you were asking about the host side port as that's where the conflict is. I assume that bitwarden_rs will never conflict with the default port 80 inside the container as it's the only thing running inside the container.

If for some reason you really want to change the port where bitwarden_rs listens inside the container, you can do that by setting the ROCKET_PORT variable. But you'd have adapt the port forward as well: -e ROCKET_PORT=2345 -p 8080:2345

@mprasil commented on GitHub: Well you were asking about the host side port as that's where the conflict is. I assume that `bitwarden_rs` will never conflict with the default port `80` inside the container as it's the only thing running inside the container. If for some reason you _really_ want to change the port where `bitwarden_rs` listens inside the container, you can do that by setting the `ROCKET_PORT` variable. But you'd have adapt the port forward as well: `-e ROCKET_PORT=2345 -p 8080:2345`
Author
Owner

@mprasil commented on GitHub:

-p sets the port forwarding. So if you want to expose port 80 in the container as 8080 on the host you need to do -p 8080:80.

@mprasil commented on GitHub: `-p` sets the port forwarding. So if you want to expose port `80` in the container as `8080` on the host you need to do `-p 8080:80`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1930