Getting Started

An AiiDA installation consists of three core components (plus any external codes you wish to run):

  • aiida-core: The main Python package and the associated verdi command line interface

  • PostgreSQL: The service that manages the database that AiiDA uses to store data.

  • RabbitMQ: The message broker used for communication within AiiDA.

There are multiple routes to setting up a working AiiDA environment. These are shown below, followed by a recommended “quick-install” route on your local computer.

Direct (Bare Metal)

Install software directly into your local root directory.

The prerequisite software can be installed using most package managers, including: apt, Homebrew, MacPorts, Gentoo and Windows Subsystem for Linux.

Virtual Environment

Install software into an isolated directory on your machine.

Environment managers such as Conda, pipenv and venv create isolated environments, allowing for installation of multiple versions of software on the same machine. It is advised that you install aiida-core into one of these managed environments.

Containers

Use a pre-made image of all the required software.

AiiDA maintains a Docker image, which is particularly useful for learning and testing purposes. It is a great way to quickly get started on the tutorials.

Virtual Machines

Use a pre-made machine with all the required software.

Materials Cloud provides both downloadable and web based VMs, also incorporating pre-installed Materials Science codes.

Quick Start

Here we first provide a simple approach for installation and setup on your local computer.

Install Software

Install with conda

conda create -n aiida -c conda-forge aiida-core=1.3.1 aiida-core.services=1.3.1
conda activate aiida
reentry scan

Conda provides a cross-platform package management system, from which we can install all the basic components of the AiiDA infrastructure in an isolated environment.

Install with pip

pip install aiida-core
reentry scan

aiida-core can be installed from PyPi. It is strongly recommended that you install into a virtual environment. You will then need to install PostgreSQL and RabbitMQ depending on your operating system.

Install prerequisites

Initialise Data Storage

Before working with AiiDA, you must first initialize a database storage area on disk.

$ initdb -D mylocal_db

This database cluster may contain a collection of databases (one per profile) that is managed by a single running server process. We start this process with:

$ pg_ctl -D mylocal_db -l logfile start

Next, we set up an AiiDA configuration profile and related data storage, with the quicksetup command.

$ verdi quicksetup
Info: enter "?" for help
Info: enter "!" to ignore the default and set no value
Profile name: me
Email Address (for sharing data): me@user.com
First name: my
Last name: name
Institution: where-i-work

At this point you now have a working AiiDA environment, from which you can add and retrieve data.

Tab Completion

Enable tab completion of verdi commands in the terminal with:

$ eval "$(_VERDI_COMPLETE=source verdi)"

Read More

Start Computation Services

In order to run computations, some additional steps are required to start the services that manage these background processes. The RabbitMQ service is used, to manage communication between processes and retain process states, even after restarting your computer:

$ rabbitmq-server -detached

We then start one or more “daemon” processes, which handle the execution and monitoring of all submitted computations.

$ verdi daemon start 2

Finally, to check that all services are running as expected use:

$ verdi status
✓ config dir:  /home/ubuntu/.aiida
✓ profile:     On profile me
✓ repository:  /home/ubuntu/.aiida/repository/me
✓ postgres:    Connected as aiida_qs_ubuntu_c6a4f69d255fbe9cdb7385dcdcf3c050@localhost:5432
✓ rabbitmq:    Connected to amqp://127.0.0.1?heartbeat=600
✓ daemon:      Daemon is running as PID 16430 since 2020-04-29 12:17:31

Awesome! You now have a fully operational installation from which to take the next steps!

Stopping Services

After finishing with your aiida session, particularly if switching between profiles, you may wish to power down the services:

$ verdi daemon stop
$ pg_ctl stop

Any computations that are still running at this point, will be picked up next time the services are started.

In-depth instructions

For more ways to install AiiDA, check the detailed installation section.

For more detailed instructions on configuring AiiDA, see the configuration how-to.

What Next?

If you are new to AiiDA, go through the Basic Tutorial, or see our Next steps guide.