Updating the vaultwarden image
Daniel edited on May 10, 2024.
Updating is straightforward, you just make sure to preserve the mounted volume. If you used the bind-mounted path as in the example here, you just need to pull the latest image, stop and rm the current container and then start a new one the same way as before:
Then visit http://localhost:80
In case you didn't bind mount the volume for persistent data, you need an intermediate step where you preserve the data with an intermediate container:
You can also use a tool like Watchtower to automate the update process. Watchtower can periodically check for an update to the Docker image, pull the updated image, and recreate the container using the updated image.
Updating when using Docker Compose
Updating when using systemd service (in this case Debian/Raspbian)
The restart command will stop the container, pull the newest images, run the container again. The prune command will remove the now old container (-f stands for: Do not ask for confirmation).
Put these into cronjob if you want (time can be changed):
Use the command
if /usr/bin/docker is not the correct path to docker
Updating when using DietPi
DietPi is a lightweight Debian-based distribution (image) for all kinds of devices like Raspberry Pi, Odroid, NanoPi and others. It offers a software script for installing various programs including Vaultwarden. That spares the user tinkering with installation commands.
Vaultwarden updates must be manually initiated by the user on DietPi, there is no automatic installation nor will apt update && apt upgrade perform an update. To update a previously installed Vautwarden instance which was installed using DietPi's software installation script, enter the following command on the DietPi's command line:
It is recommended to use DietPi version 8.7 or newer because the update process has been considerably sped up compared to previous versions.
In case you have customised Vaultwarden's configuration file, it will be kept by the update script.