Getting Started

The following setup steps have been tested on Ubuntu 16.04, on Ubuntu 18.04 and on Debian stretch.


  1. This first step is only required on Ubuntu 16.04 and can be skipped if you are on a more recent Ubuntu or Debian version. edi requires features that got introduced with Ansible 2.1. On Ubuntu 16.04 you can enable xenial-backports and then install Ansible as follows:

    Ubuntu 16.04 only
    sudo apt install ansible/xenial-backports
  2. Install lxd:

    Ubuntu 16.04
    sudo apt install lxd/xenial-backports lxcfs/xenial-backports lxd-client/xenial-backports liblxc1/xenial-backports
    Ubuntu 18.04
    sudo apt install lxd
    Debian or Ubuntu >= 19.04
    sudo apt install snapd
    sudo snap install lxd
    sudo usermod -a -G lxd $USER
  3. Close and re-open your user session to apply the new group membership (this guide assumes that you are either member of the group sudoers or admin, for details please read the linux containers documentation).

  4. Initialize lxd:

    Ubuntu 16.04 or Ubuntu 18.04
    sudo lxd init
    Debian or Ubuntu >= 19.04
    sudo /snap/bin/lxd init

    The default settings are ok. Use the storage backend “dir” if there is no zfs setup on your computer or if you do not want to create a btrfs pool.

Installing edi from the Archive

For your convenience, you can directly install edi from a ppa (Ubuntu) or a custom apt repository (Debian):

  1. Add the edi repository to your setup:

    sudo add-apt-repository ppa:m-luescher/edi-snapshots
    sudo apt-get update
    sudo apt install apt-transport-https
    wget -qO - | sudo apt-key add -
    echo "deb $(source /etc/os-release && echo ${VERSION_CODENAME}) main" | sudo tee /etc/apt/sources.list.d/edi-repository.list
    sudo apt update
  2. Install edi:

    sudo apt install edi

Setting up ssh Keys

If you plan to access edi generated containers or target systems using ssh, it is a good idea to create a ssh key pair. Hint: edi versions greater or equal than 0.11.0 have a secure by default setup of ssh and disable password based login.

  1. Review if you already have existing ssh keys:

    ls -al ~/.ssh

    Valid public keys are typically named,, or

  2. If there is no valid ssh key pair, generate one:

    $ ssh-keygen -t rsa -b 4096 -C "[email protected]"
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/YOU/.ssh/id_rsa):
    Created directory '/home/YOU/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:

    Hint: If you decided to use a passphrase and do not want to reenter it every time, it is a good idea to use a ssh-agent.

Building a First Container

  1. Create an empty project folder:

    cd ~/
    mkdir my-first-edi-project
    cd my-first-edi-project
  2. Generate a configuration for your project:

    edi config init my-project debian-stretch-amd64
  3. Build your first (development) lxc container named my-first-edi-container:

    sudo edi -v lxc configure my-first-edi-container my-project-develop.yml

Exploring the Container

  1. Log into the container using your current user name (Note: This user is only available within a development container.) and the password ChangeMe!:

    lxc exec my-first-edi-container -- login ${USER}
  2. Change the password for your container user:

  3. Install a package within the container:

    sudo apt install cowsay
  4. Share a file with the host (Note: The folder ~/edi-workspace is shared with your host.):

    cowsay "Hello world!" > ~/edi-workspace/hello
  5. Leave the container:

  6. Read the file previously created within the container:

    cat ~/edi-workspace/hello
  7. Enter the container as root (Note: This is useful if you have a container without your personal user.):

    lxc exec my-first-edi-container -- bash
  8. And leave it again:

  9. Get the IP address of the container:

    lxc list my-first-edi-container
  10. Enter the container using ssh:

  11. And leave it again: