Installing Idem#

To install Idem, follow the steps for your operating system.

Where to find Idem#

Idem is a Python project hosted on pypi.org.

Python version requirements#

Idem requires Python 3.7 or later.

Before you begin#

Before you install Idem, set up a version control repository to store your SLS files.

Linux#

To install Idem on Linux, follow these steps.

  1. Ensure that all of your packages are up to date.

    For Debian based distributions such as Ubuntu:

    sudo apt-get update
    sudo apt-get upgrade -y
    

    For RedHat based distributions such as CentOS:

    sudo yum update -y
    
  2. Install Python 3.7 or later. Include the package installer for Python (PIP).

    For Debian based distributions such as Ubuntu:

    sudo apt install -y python3-pip build-essential libssl-dev libffi-dev python-dev python3-venv
    

    For RedHat based distributions such as CentOS:

    sudo yum groupinstall -y development
    
  3. Install Poetry.

    Poetry is a tool for dependency management and packaging in Python. It is the recommended tool for managing your Idem cloud infrastructure code.

    curl -sSL https://install.python-poetry.org | python3 -
    
  4. Add Poetry to your shell.

    Add these two lines to your .bashrc file so the poetry command is available to you.

    export PATH="~/.local/bin:$PATH"
    
  5. Alias the idem command to Poetry.

    This ensures that the virtual environment that you use corresponds to your current project path.

    alias idem="poetry run idem"
    
  6. Create a Poetry configuration for your project in the main directory for your configuration files.

    You only need to do this once per project.

    poetry init -n --name=$PROJECT
    

    Running poetry init creates two files that manage Poetry: pyproject.toml, which manages package requirements, and poetry.lock, which maintains the same versions of all packages that are installed.

  7. Add the Poetry configuration files to git.

    git add pyproject.toml poetry.lock
    
  8. Install the latest Idem version.

    poetry add idem@latest
    

    Alternatively, install a specific Idem version.

    poetry add idem==21.1.0
    

Windows#

To install Idem on Windows, follow these steps.

  1. Download and open the Python for Windows installer.

  2. Select the option to add Python to the Windows PATH environment variable.

    ../../_images/python-windows-installer.png
  3. Run the installer, and follow the prompts.

  4. In Windows, open Advanced system settings, click Environment Variables, and verify that the Python and PIP executables are included in the PATH system variable.

  5. Open the Windows command prompt as an Administrator.

  6. Install Poetry.

    Poetry is a tool for dependency management and packaging in Python. It is the recommended tool for managing your Idem cloud infrastructure code.

    curl -sSL https://install.python-poetry.org | python3 -
    
  7. Add Poetry to your shell.

    Add these two lines to your .bashrc file so the poetry command is available to you.

    export PATH="~/.local/bin:$PATH"
    alias poetry="~/.local/bin/poetry"
    
  8. Alias the idem command to Poetry.

    This ensures that the virtual environment that you use corresponds to your current project path.

    alias idem="poetry run idem"
    
  9. Create a Poetry configuration for your project in the main directory for your configuration files.

    You only need to do this once per project.

    poetry init -n --name=$PROJECT
    

    Running poetry init creates two files that manage Poetry: pyproject.toml, which manages package requirements, and poetry.lock, which maintains the same versions of all packages that are installed.

  10. Add the Poetry configuration files to git.

    git add pyproject.toml poetry.lock
    
  11. Install the latest Idem version.

    poetry add idem@latest
    

    Alternatively, install a specific Idem version.

    poetry add idem==21.1.0
    

MacOS#

To install Idem on MacOS, follow these steps.

  1. From a terminal window, install the Homebrew package manager.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    
  2. Install Python 3.

    brew install python
    

    Homebrew installs PIP for you.

  3. Add the Python directory to the PATH environment variable.

    export PATH="/usr/local/opt/python/libexec/bin:$PATH"
    
  4. Install Poetry.

    Poetry is a tool for dependency management and packaging in Python. It is the recommended tool for managing your Idem cloud infrastructure code.

    curl -sSL https://install.python-poetry.org | python3 -
    
  5. Add Poetry to your shell.

    Add these two lines to your .bashrc file so the poetry command is available to you.

    export PATH="~/.local/bin:$PATH"
    alias poetry="~/.local/bin/poetry"
    
  6. Alias the idem command to Poetry.

    This ensures that the virtual environment that you use corresponds to your current project path.

    alias idem="poetry run idem"
    
  7. Create a Poetry configuration for your project in the main directory for your configuration files.

    You only need to do this once per project.

    poetry init -n --name=$PROJECT
    

    Running poetry init creates two files that manage Poetry: pyproject.toml, which manages package requirements, and poetry.lock, which maintains the same versions of all packages that are installed.

  8. Add the Poetry configuration files to git.

    git add pyproject.toml poetry.lock
    
  9. Install the latest Idem version.

    poetry add idem@latest
    

    Alternatively, install a specific Idem version.

    poetry add idem==21.1.0
    

What to do next#

Tell Idem what infrastructure to manage. See Connecting Idem to providers.