Change Port from 443

Hi all,

I am attempting to get my instance running and all works when using the following code:

docker run -d --name bitwarden \
-e ROCKET_TLS='{certs="/ssl/live/.../fullchain.pem",key="/ssl/live/.../privkey.pem"}'  \
-e ADMIN_TOKEN=... \
-v /etc/letsencrypt/:/ssl/ \
-v /bw-data/:/data/ \
-p 443:80 \
bitwardenrs/server:latest

However, when I go to change that port from 443 to any other port (so that I can also have an outbound facing web server) I’m unable to visit the page using, for example: https://bitwarden.example.com:445. I’ve verified it’s not a firewall issue and the port is accessible from the outside. Any ideas?

Or if not possible for some reason, what I would optimally like is to only be able to access my bitwarden from the bitwarden.example.com NOT example.com. I assume this could be done through Apache although I’ve never worked with reverse proxies.

Its possible but why are you trying to use port 80 as the public facing for the container? That will definitely get probed by something, and will probably not switch to an ssl connection which would be horribly silly if youre publicly hosting your instance. I have my run command i used on my dual boot, will post an example here soon but im guessing you probably have something else running on port 80

Ok, apparently i have the same thing.

docker run --restart=always
–name bitwarden
-e ROCKET_TLS=’{certs="/data/ssl/",key="/data/ssl/"}’
-e SIGNUPS_ALLOWED=false
-e ADMIN_TOKEN=*
-v /mnt/data/bitwarden/bw-data/:/data/
-p 443:80
-d bitwardenrs/server:latest

I then have a port forward in my router with a different port to port 443

I’m not that familiar with Docker to be honest, I guess I could always host it without Docker.

the -p is mapping the ports, id say try leaving it as -p 443:80 and then map some other port in your router to the servers ip mapping it to 443 of the docker server ip.

fwiw i loathe docker, to me it just adds another layer of complexity to things. i do get the ease of having a container that is just the same across platforms though.

Where are you running this instance (home ISP or external provider)? You can use a different port (445 is probably not a good example since it’s used for SMB and frequently blocked for security reasons), but running behind a reverse proxy would be recommended in any case. You should also make sure to set your DOMAIN URL correctly (it should include the port, if non-standard).

Thank you everyone, I was able to get it working, I think it was a combination of things on my end with docker.