I’m wanting to install this via a Raspberry Pi 4 Model B and I have Nginx on another machine that’s running websites.
I’m wanting to use Docker compose to accomplish this and don’t want vaultwarden to be using port 80. I’m still learning and messing around with both Nginx and Docker along with networking. Honestly it’s been a pain trying to learn it.
Basically what I’m after is to run VaultWarden on a Pi using docker compose and not using port 80. I have no idea how I would do this. And I’m asking here before I mess anything up via the installation.
I’ve got this to work for local:
docker pull vaultwarden/server:latest
docker run -d --name vaultwarden -v /vw-data/:/data/ -p 4444:80 vaultwarden/server:latest
But I’m wanting to set it up using docker compose so I can see all the settings later down the road if I have to.
Any advice/help is greatly appreciated.
~Blood
Just for learning purpose you need to prepare environment where you can easily reverse your actions. Try to setup on your PC a simple VM with VirtualBox with Ubuntu Server 22 as beginner friendly OS. After each succesful step, take a snapshot of VM. After every failure just rollback to previous snapshot to recover in few seconds.
Try something like below to start with docker compose.
Run command to generate Admin token:
rc=1; while [[ $rc -ne 0 ]]; do openssl rand -base64 32 |grep -ie '^Qa';rc=$?; done
Save string to use later. Run text editor:
nano docker-compose.yml
and paste content below:
version: "3"
services:
vaultwarden:
image: vaultwarden/server:latest-alpine
user: 1000:1000
volumes:
- /srv/vaultwarden:/data
ports:
- 7777:80
- 3012:3012
restart: always
environment:
- WEBSOCKET_ENABLED=true
- SIGNUPS_ALLOWED=false
- ADMIN_TOKEN='XXXXXXXXXXXXXXXXXXXX'
Replace XXXXXX string your previously generated admin token. Save your YML file and run commands:
sudo mkdir -p /srv/vaultwarden
sudo chown $USER:$USER /srv/vaultwarden/
Finally run your compose:
sudo docker compose up -d
Check results:
sudo docker ps -a
To be honest you should register on Docker forum to seek knowledge of docker compose besides reading well written documentation.This is a Vaultwarden forum.
1 Like