2024-02-13 14:30:31 +00:00
---
2024-03-14 11:14:37 +00:00
display_name: Incus System Container with Docker
2024-02-13 14:30:31 +00:00
description: Develop in an Incus System Container with Docker using incus
2024-03-14 14:49:44 +00:00
icon: ../../../site/static/icon/lxc.svg
2024-03-14 11:43:34 +00:00
maintainer_github: coder
verified: true
tags: [local, incus, lxc, lxd]
2024-02-13 14:30:31 +00:00
---
# Incus System Container with Docker
Develop in an Incus System Container and run nested Docker containers using Incus on your local infrastructure.
## Prerequisites
1. Install [Incus ](https://linuxcontainers.org/incus/ ) on the same machine as Coder.
2. Allow Coder to access the Incus socket.
2024-02-13 15:31:07 +00:00
- If you're running Coder as system service, run `sudo usermod -aG incus-admin coder` and restart the Coder service.
- If you're running Coder as a Docker Compose service, get the group ID of the `incus-admin` group by running `getent group incus-admin` and add the following to your `compose.yaml` file:
2024-02-13 14:30:31 +00:00
```yaml
services:
coder:
volumes:
- /var/lib/incus/unix.socket:/var/lib/incus/unix.socket
group_add:
2024-02-13 15:31:07 +00:00
- 996 # Replace with the group ID of the `incus-admin` group
2024-02-13 14:30:31 +00:00
```
3. Create a storage pool named `coder` and `btrfs` as the driver by running `incus storage create coder btrfs` .
## Usage
> **Note:** this template requires using a container image with cloud-init installed such as `ubuntu/jammy/cloud/amd64`.
1. Run `coder templates init -id incus`
1. Select this template
1. Follow the on-screen instructions
## Extending this template
2024-02-13 19:16:33 +00:00
See the [lxc/incus ](https://registry.terraform.io/providers/lxc/incus/latest/docs ) Terraform provider documentation to
2024-02-13 14:30:31 +00:00
add the following features to your Coder template:
- HTTPS incus host
- Volume mounts
- Custom networks
- More
We also welcome contributions!