Project

General

Profile

Actions

Creating Data Storage Folder and Volume Mapping for Bitwarden Docker Compose Setup

Follow these steps to create a data storage folder and configure a volume mapping for your Bitwarden Docker Compose setup, ensuring data persistence and preventing loss of information when containers are restarted or recreated.

1. Create the Data Storage Folder:

Open a terminal on your server.

2. Navigate to the Docker Compose Directory:

Use the `cd` command to navigate to the directory where your `docker-compose.yml` file is located. For instance:

cd /opt/bitwarden

3. Create the Data Storage Folder:

Execute the following command to create the data storage folder:

sudo mkdir /opt/bitwarden_data

4. Edit the Docker Compose File:

Open the `docker-compose.yml` file in a text editor:

nano docker-compose.yml

5. Add the Volume Mapping:

Find the `volumes` section under the `bitwarden` service definition. Include the following line for the volume mapping:

services:
.....
volumes:
- /opt/bitwarden_data:/data # Add this line for volume mapping
  1. Other configuration options for the Bitwarden service

6. Restart Containers:
Apply the changes by restarting the containers:

docker-compose down
docker-compose up -d

Following these steps ensures that your Bitwarden data is stored in the `/opt/bitwarden_data` folder on the host machine, safeguarding data integrity even during container restarts or recreations.

Updated by Gareth Eaton over 1 year ago · 3 revisions