Installing Flectra

There are multiple ways to install Flectra, or not install it at all, depending on the intended use case.

This documents attempts to describe most of the installation options.

Packaged installers

Suitable for testing Flectra, developing modules and can be used for long-term production use with additional deployment and maintenance work.

Source Install

Provides greater flexibility: e.g. allow multiple running Flectra versions on the same system. Good for developing modules, can be used as base for production deployment.

Docker

If you usually use docker for development or deployment, an official docker base image is available.

Online

Demo

To simply get a quick idea of Flectra, demo instances are available. They are shared instances which only live for a few hours, and can be used to browse around and try things out with no commitment.

Demo instances require no local installation, just a web browser.

SaaS

Trivial to start with, fully managed and migrated by Flectra S.A., Flectra’s SaaS provides private instances and starts out free. It can be used to discover and test Flectra and do non-code customizations (i.e. incompatible with custom modules or the Flectra Apps Store) without having to install it locally.

Can be used for both testing Flectra and long-term production use.

Like demo instances, SaaS instances require no local installation, a web browser is sufficient.

Packaged installers

Flectra provides packaged installers for Windows, deb-based distributions (Debian, Ubuntu, …) and RPM-based distributions (Fedora, CentOS, RHEL, …) for both the Community and Professional versions.

These packages automatically set up all dependencies (for the Community version), but may be difficult to keep up-to-date.

Official Community packages with all relevant dependency requirements are available on our nightly server. Both Communtiy and Professional packages can be downloaded from our download page (you must to be logged in as a paying customer or partner to download the Professional packages).

Windows

  1. Download the installer from our nightly server (Community only) or the Windows installer from the download page (any edition).

  2. Execute the downloaded file.

    Warning

    On Windows 8 and later you may see a warning titled “Windows protected your PC”.
    Click on More Info and then on Run anyway.
  3. Accept the UAC prompt.

  4. Go through the various installation steps.

Flectra will automatically be started at the end of the installation.

Linux

Debian/Ubuntu

Flectra2.0 ‘deb’ package currently supports Debian Buster, Ubuntu 20.04 or above.

Warning

wkhtmltopdf is not installed through pip and must be installed manually in version 0.12.5 for it to support headers and footers. See our wiki for more details on the various versions.

Repository

Flectra S.A. provides a repository that can be used with Debian and Ubuntu distributions. It can be used to install Flectra Community Edition by executing the following commands:

$ wget -O - https://nightly.flectra.com/flectra.key | sudo apt-key add -
$ sudo sh -c 'echo "deb http://nightly.flectra.com/2.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/flectra.list'
$ sudo apt-get update && sudo apt-get install flectra

You can then use the usual apt-get upgrade command to keep your installation up-to-date.

At this moment, there is no nightly repository for the Professional Edition.

Deb Package

Instead of using the repository as described above, the ‘deb’ packages for both the Community and Professional editions can be downloaded from the official download page.

Next, execute the following commands:

$ sudo apt-get install <path_to_installation_package>

This will install Flectra as a service, create the necessary PostgreSQL user and automatically start the server.

Note

The recommended postgresql-server package will be installed by the Debian Flectra package. The --no-install-recommends argument of the apt-get tool should be used if you plan to install the Postgresql server on another machine.

Fedora

Flectra2.0 ‘rpm’ package supports Fedora 32.

Warning

The Flectra2.0 rpm package does not support Fedora 33 or above.

Prepare

Flectra needs a PostgreSQL server to run properly. Make sure that the sudo command is available and well configured and, only then, execute the following command in order to install the PostgreSQL server:

$ sudo dnf install -y postgresql-server
$ sudo postgresql-setup --initdb --unit postgresql
$ sudo systemctl enable postgresql
$ sudo systemctl start postgresql

Warning

wkhtmltopdf is not installed through pip and must be installed manually in version 0.12.5 for it to support headers and footers. See our wiki for more details on the various versions.

Repository

Flectra S.A. provides a repository that can be used with the Fedora distributions. It can be used to install Flectra Community Edition by executing the following commands:

$ sudo dnf config-manager --add-repo=https://nightly.flectra.com/2.0/nightly/rpm/flectra.repo
$ sudo dnf install -y flectra
$ sudo systemctl enable flectra
$ sudo systemctl start flectra
RPM package

Instead of using the repository as described above, the ‘rpm’ packages for both the Community and Professional editions can be downloaded from the official download page.

Once downloaded, the package can be installed using the ‘dnf’ package manager:

$ sudo dnf localinstall odoo_14.0.latest.noarch.rpm
$ sudo systemctl enable flectra
$ sudo systemctl start flectra

Source Install

The source “installation” is really about not installing Flectra, and running it directly from source instead.

This can be more convenient for module developers as the Flectra source is more easily accessible than using packaged installation (for information or to build this documentation and have it available offline).

It also makes starting and stopping Flectra more flexible and explicit than the services set up by the packaged installations, and allows overriding settings using command-line parameters without needing to edit a configuration file.

Finally it provides greater control over the system’s set up, and allows to more easily keep (and run) multiple versions of Flectra side-by-side.

Windows

Fetch the sources

There are two ways to obtain the source code of Flectra: as a zip archive or through git.

Archive

Community Edition:

Professional Edition:

Git

The following requires git to be installed on your machine and that you have basic knowledge of git commands.

Community Edition:

C:\> git clone https://gitlab.com/flectra-hq/flectra.git

Prepare

Python

Flectra requires Python 3.6 or later to run. Visit Python’s download page to download and install the latest version of Python 3 on your machine.

During installation, check Add Python 3 to PATH, then click Customize Installation and make sure that pip is checked.

Note

If Python 3 is already installed, make sure that the version is 3.6 or above, as previous versions are not compatible with Flectra.

C:\> python --version

Verify also that pip is installed for this version.

C:\> pip --version
PostgreSQL

Flectra uses PostgreSQL as database management system. Download and install PostgreSQL (supported version: 10.0 and later).

By default, the only user is postgres but Flectra forbids connecting as postgres, so you need to create a new PostgreSQL user:

  1. Add PostgreSQL’s bin directory (by default: C:\Program Files\PostgreSQL\<version>\bin) to your PATH.

  2. Create a postgres user with a password using the pg admin gui:

    1. Open pgAdmin.

    2. Double-click the server to create a connection.

    3. Select Object ‣ Create ‣ Login/Group Role.

    4. Enter the username in the Role Name field (e.g. flectra).

    5. Open the Definition tab and enter the password (e.g. flectra), then click Save.

    6. Open the Privileges tab and switch Can login? to Yes and Create database? to Yes.

Dependencies

Before installing the dependencies, you must download and install the Build Tools for Visual Studio. When prompted, select C++ build tools in the Workloads tab and install them.

Flectra dependencies are listed in the requirements.txt file located at the root of the Flectra community directory.

Tip

It can be preferable to not mix python modules packages between different instances of Flectra or with your system. You can use virtualenv to create isolated Python environments.

Navigate to the path of your Flectra Community installation (CommunityPath) and run pip on the requirements file in a terminal with Administrator privileges:

C:\> cd \CommunityPath
C:\> pip install setuptools wheel
C:\> pip install -r requirements.txt

Warning

wkhtmltopdf is not installed through pip and must be installed manually in version 0.12.5 for it to support headers and footers. See our wiki for more details on the various versions.

For languages with right-to-left interface (such as Arabic or Hebrew), the package rtlcss is needed:

  1. Download and install nodejs.

  2. Install rtlcss:

    C:\> npm install -g rtlcss
    
  3. Edit the System Environment’s variable PATH to add the folder where rtlcss.cmd is located (typically: C:\Users\<user>\AppData\Roaming\npm\).

Running Flectra

Once all dependencies are set up, Flectra can be launched by running flectra-bin, the command-line interface of the server. It is located at the root of the Flectra Community directory.

To configure the server, you can either specify command-line arguments or a configuration file.

Common necessary configurations are:

  • PostgreSQL user and password.

  • Custom addon paths beyond the defaults, to load your own modules.

A typical way to run the server would be:

C:\> cd CommunityPath/
C:\> python flectra-bin -r dbuser -w dbpassword --addons-path=addons -d mydb

Where CommunityPath is the path of the Flectra Community installation, dbuser is the PostgreSQL login, dbpassword is the PostgreSQL password and mydb is the default database to serve on localhost:8069. You can add other directory paths separated by a comma to addons at the end of the addons-path option.

Linux

Fetch the sources

There are two ways to obtain the source code of Flectra: as a zip archive or through git.

Archive

Community Edition:

Professional Edition:

Git

The following requires git to be installed on your machine and that you have basic knowledge of git commands.

Community Edition:

$ git clone https://gitlab.com/flectra-hq/flectra.git

Prepare

Python

Flectra requires Python 3.6 or later to run. Use your package manager to download and install Python 3 on your machine if it is not already done.

Note

If Python 3 is already installed, make sure that the version is 3.6 or above, as previous versions are not compatible with Flectra.

$ python3 --version

Verify also that pip is installed for this version.

$ pip3 --version
PostgreSQL

Flectra uses PostgreSQL as database management system. Use your package manager to download and install PostgreSQL (supported version: 10.0 and later).

On Debian/Unbuntu, it can be achieved by executing the following:

$ sudo apt install postgresql postgresql-client

By default, the only user is postgres but Flectra forbids connecting as postgres, so you need to create a new PostgreSQL user:

$ sudo -u postgres createuser -s $USER
$ createdb $USER

Note

Because your PostgreSQL user has the same name as your Unix login, you will be able to connect to the database without password.

Dependencies

For libraries using native code, it is necessary to install development tools and native dependencies before the Python dependencies of Flectra. They are available in -dev or -devel packages for Python, PostgreSQL, libxml2, libxslt1, libevent, libsasl2 and libldap2.

On Debian/Unbuntu, the following command should install all the required libraries:

$ sudo apt install python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \
    libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev \
    liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev

Flectra dependencies are listed in the requirements.txt file located at the root of the Flectra community directory.

Tip

It can be preferable to not mix python modules packages between different instances of Flectra or with your system. You can use virtualenv to create isolated Python environments.

Navigate to the path of your Flectra Community installation (CommunityPath) and run pip on the requirements file:

$ cd /CommunityPath
$ pip3 install setuptools wheel
$ pip3 install -r requirements.txt

For languages with right-to-left interface (such as Arabic or Hebrew), the package rtlcss is needed:

  1. Download and install nodejs and npm with your package manager.

  2. Install rtlcss:

    $ sudo npm install -g rtlcss
    

Running Flectra

Once all dependencies are set up, Flectra can be launched by running flectra-bin, the command-line interface of the server. It is located at the root of the Flectra Community directory.

To configure the server, you can either specify command-line arguments or a configuration file.

Tip

For the Professional edition, you must add the path to the professional addons to the addons-path argument. Note that it must come before the other paths in addons-path for addons to be loaded correctly.

Common necessary configurations are:

  • PostgreSQL user and password. Flectra has no defaults beyond psycopg2’s defaults: connects over a UNIX socket on port 5432 with the current user and no password.

  • Custom addon paths beyond the defaults, to load your own modules.

A typical way to run the server would be:

$ cd /CommunityPath
$ python3 flectra-bin --addons-path=addons -d mydb

Where CommunityPath is the path of the Flectra Community installation and mydb is the default database to serve on localhost:8069. You can add other directory paths separated by a comma to addons at the end of the addons-path option.

Mac OS

Fetch the sources

There are two ways to obtain the source code of Flectra: as a zip archive or through git.

Archive

Community Edition:

Git

The following requires git to be installed on your machine and that you have basic knowledge of git commands.

Community Edition:

$ git clone https://gitlab.com/flectra-hq/flectra.git

Prepare

Python

Flectra requires Python 3.6 or later to run. Use your preferred package manager (homebrew, macports) to download and install Python 3 on your machine if it is not already done.

Note

If Python 3 is already installed, make sure that the version is 3.6 or above, as previous versions are not compatible with Flectra.

$ python3 --version

Verify also that pip is installed for this version.

$ pip3 --version
PostgreSQL

Flectra uses PostgreSQL as database management system. Use postgres.app to download and install PostgreSQL (supported version: 10.0 and later).

By default, the only user is postgres but Flectra forbids connecting as postgres, so you need to create a new PostgreSQL user:

$ sudo -u postgres createuser -s $USER
$ createdb $USER

Note

Because your PostgreSQL user has the same name as your Unix login, you will be able to connect to the database without password.

Dependencies

Flectra dependencies are listed in the requirements.txt file located at the root of the Flectra community directory.

Tip

It can be preferable to not mix python modules packages between different instances of Flectra or with your system. You can use virtualenv to create isolated Python environments.

Navigate to the path of your Flectra Community installation (CommunityPath) and run pip on the requirements file:

$ cd /CommunityPath
$ pip3 install setuptools wheel
$ pip3 install -r requirements.txt

Warning

Non-Python dependencies need to be installed with a package manager:

  1. Download and install the Command Line Tools:

    $ xcode-select --install
    
  2. Download and install the package manager of your choice (homebrew, macports).

  3. Install non-python dependencies.

For languages with right-to-left interface (such as Arabic or Hebrew), the package rtlcss is needed:

  1. Download and install nodejs with your preferred package manager (homebrew, macports).

  2. Install rtlcss:

    $ sudo npm install -g rtlcss
    

Running Flectra

Once all dependencies are set up, Flectra can be launched by running flectra-bin, the command-line interface of the server. It is located at the root of the Flectra Community directory.

To configure the server, you can either specify command-line arguments or a configuration file.

Tip

For the Professional edition, you must add the path to the professional addons to the addons-path argument. Note that it must come before the other paths in addons-path for addons to be loaded correctly.

Common necessary configurations are:

  • PostgreSQL user and password. Flectra has no defaults beyond psycopg2’s defaults: connects over a UNIX socket on port 5432 with the current user and no password.

  • Custom addon paths beyond the defaults, to load your own modules.

A typical way to run the server would be:

$ cd /CommunityPath
$ python3 flectra-bin --addons-path=addons -d mydb

Where CommunityPath is the path of the Flectra Community installation and mydb is the default database to serve on localhost:8069. You can add other directory paths separated by a comma to addons at the end of the addons-path option.

Docker

The full documentation on how to use Flectra with Docker can be found on the official Flectra docker image page.