# 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:** 5
**Page:** 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.

---

<div class="post-metadata">

### Author: ![Juan\_Adamuz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juan_adamuz/32/86808_2.png) [@Juan\_Adamuz](https://meta.discourse.org/u/Juan_Adamuz)
#### Post date: [August 27, 2019, 4:35pm UTC](https://meta.discourse.org/t/change-the-docker-storage-backend/75352/2 "2019-08-27T16:35:33Z")

</div>

Hello! Sorry for bumping but i’ve been using discourse like for 2 years and now im trying to get into its plugin development process.  
I have a VPS with ubuntu 16.04 fresh installed and docker gets installed by default with devicemapper. There is no possibility to change it (This tutorial and everyone in google makes docker impossible to start) any clue?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 28, 2019, 1:42am UTC](https://meta.discourse.org/t/change-the-docker-storage-backend/75352/3 "2019-08-28T01:42:35Z")

</div>

Why Ubuntu 16.04, that is already quite out of date? Why not 18.04?

---

<div class="post-metadata">

### Author: ![Juan\_Adamuz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juan_adamuz/32/86808_2.png) [@Juan\_Adamuz](https://meta.discourse.org/u/Juan_Adamuz)
#### Post date: [August 28, 2019, 5:59am UTC](https://meta.discourse.org/t/change-the-docker-storage-backend/75352/4 "2019-08-28T05:59:26Z")

</div>

I’ve tried both of them and I think my VPS dont support that kernel or something. I have a better VPS in the same company and I have no problem…

---

<div class="post-metadata">

### Author: ![peternlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peternlewis/32/108888_2.png) [@peternlewis](https://meta.discourse.org/u/peternlewis)
#### Post date: [October 22, 2024, 7:57am UTC](https://meta.discourse.org/t/change-the-docker-storage-backend/75352/5 "2024-10-22T07:57:16Z")

</div>

I presume after this you can (should?) delete the /var/lib/docker/aufs directory, and the `export_local_discourse_app` file?
