> For the complete documentation index, see [llms.txt](https://strangebutohwell.gitbook.io/knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://strangebutohwell.gitbook.io/knowledge/docker/install-docker/enable-memory-swappiness-linux.md).

# Enable Memory Swappiness - Linux

Edit GRUB to enable Memory Swappiness for use with Docker

## Edit GRUB to enable Memory Swappiness

### Open Default GRUB Config

`sudo nano /etc/defaults/grub`

### Add Command Line options to Default:

* `cgroup_enable=memory`
* `swapaccount=1`

#### Example:

{% code title="/etc/defaults/grub" %}

```bash
GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1"
```

{% endcode %}

### Reload GRUB Config

`sudo update-grub`

### Reboot

`sudo systemctl reboot now`
