# Change the Docker storage backend

**URL:** <https://meta.discourse.org/t/change-the-docker-storage-backend/75352>\
**Category:** Sysadmins\
**Tags:** docker, how-to\
**Created:** [December 4, 2017, 3:50pm UTC](https://meta.discourse.org/t/change-the-docker-storage-backend/75352 "2017-12-04T15:50:03Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)\
**Post date:** [December 4, 2017, 3:50pm UTC](https://meta.discourse.org/t/change-the-docker-storage-backend/75352/1 "2017-12-04T15:50:03Z")

</div>

Hello all,

I have been using Docker with the Devicemapper storage driver. After manually editing the launcher script, I finally took the time to convert to Overlay2. Here are the instructions I took to do this. I hope this helps others. I see others have [asked the question](https://meta.discourse.org/t/change-docker-device-storage/67968), but I don’t see any answers. I used [this excellent guide](https://muehe.org/posts/switching-docker-from-aufs-to-devicemapper/) to help figure this out.

## Step 1: Halt your Discourse application (and other docker apps)

`./launcher stop app`

## Step 2: Commit and save your old Docker containers/images

We first committed each image we care for so that we had the most recent version tagged somewhere with all changes included. This can be done roughly like this:

```plaintext
docker ps -a
# for each container you care for, stop and then commit it
docker commit e198aac7112d export/local_discourse_app 

```

```plaintext
docker save export/local_discourse_app > export_local_discourse_app.tar.gz

```

## Step 3: Change storage driver

I chose `Overlay2`, but the Discourse-recommended driver is `aufs`. Adjust as necessary. If something goes wrong, simply set the storage-driver to `devicemapper` as needed.

Insert the following into `/etc/docker/daemon.json`

```plaintext
{
  "storage-driver": "overlay2"
}

```

## Step 4: Restart docker

`sudo service docker restart`

## Step 5: Import image into new storage device

`docker load < export_local_discourse_app.tar.gz`

## Step 6: Rebuild Discourse

`./launcher rebuild app`

I hope this helps! Feel free to suggest any modifications or questions.

---

_[View the full topic](https://meta.discourse.org/t/change-the-docker-storage-backend/75352)._
