Installing Lasso
================

EDB distributes the application through the `EDB Website <https://www.enterprisedb.com/software-downloads-postgres>`_ 

and grants usage to its customers using their *company token* as a means
of authentication.

Linux
-----

You can install Lasso on any major supported Linux distribution by
following the corresponding Linux installation option for your system
from the `EDB Website Downloads <https://www.enterprisedb.com/software-downloads-postgres>`_  , or directly from the `EDB repositories for Linux page <https://www.enterprisedb.com/repos>`_  , choosing
Lasso and following the installation instructions.

After installing the EDB repository for your subscription on your
system, you will be able to install Lasso on Linux using the package
manager tool for your Linux distribution, for example, including but not
limited to:

-  Debian / Ubuntu:

::

       apt install edb-lasso

-  RHEL / CentOS / Oracle Linux 7:

::

       yum install edb-lasso

-  RHEL / Rocky / AlmaLinux / Oracle Linux 8+:

::

       dnf install edb-lasso

If you system has access to the Internet, then installing the
``edb-lasso`` package using your package manager will already
automatically install the Lasso dependencies, which are:

-  ``python3``

-  ``python3-psycopg2``

-  ``python3-setuptools``

-  ``python3-psutil``

If your system does not have access to the Internet, then these
dependencies need to be downloaded and installed manually. Consult EDB
Support for more details.

Windows
-------

Lasso for Windows is a single-file binary executable called
``lasso-windows-X.Y.Z.exe`` , where ``X.Y.Z`` is the current Lasso
version, which can be downloaded from the `EDB Website Downloads page <https://www.enterprisedb.com/software-downloads-postgres>`_  .

On Windows, Lasso doesn’t require installing any dependencies, but Lasso
can only run on Windows Server 2008 R2 or newer.

Configuration file
------------------

If you try to run Lasso without a configuration file, it will error out
with:

::

       ERROR: no configuration file for Lasso could be found. Please create a configuration file and try again.

Lasso requires a configuration file, which can be one of the following
options (it uses the first match):

1. ``./edb-lasso.cfg`` in the same directory where Lasso is running

2. ``./edb-lasso.conf`` in the same directory where Lasso is running

3. ``$HOME/.edb-lasso.conf``

4. ``/etc/edb-lasso.conf``

The minimum configuration file should look like this:

::

   [customer]
   id=XXXXX
   token=YYYYYYYYY

Replacing the ``id`` and ``token`` above with the information found in
your company page in the Support Portal (in the left menu bar, click on
``Company info`` then click on ``Company`` ). The ``Company code`` from
the page should be filled in the ``id`` field in the configuration file,
and the ``Token`` from the page should be filled in the ``token`` field
in the configuration file.

..  Important::
   A configuration file for Lasso is mandatory, at least with the customer id and token. !!!

For more details about the Lasso configuration, see :ref:`Configuration <Configuration>`  .

Executing Lasso
---------------

After installing Lasso and creating an appropriate configuration file,
then a standard Lasso execution on Linux consists of simply:

::

       lasso

On Windows, in order to run Lasso, you need to do the following:

1. In the Start Menu, search for “cmd”;

2. Right-click the “Command Prompt” and choose “Run as administrator”;

3. If Windows asks whether you allow “Command Prompt” to do changes in
   the system, click “Yes”;

4. Inside the “Command Prompt”, ``cd`` to the directory where the Lasso
   ``.exe`` file is located;

5. Execute the command “lasso-windows-X.Y.Z.exe”, where ``X.Y.Z`` is the
   Lasso version:

::

       lasso-windows-X.Y.Z.exe -H IP_ADDRESS -p PORT --password PASSWORD DATABASE_NAME USER_NAME

Alternatively, if you fill the settings under the ``postgresql`` section
in the configuration file telling Lasso how to connect to Postgres, then
you can execute Lasso from the Windows explorer by right-clicking on the
``.exe`` file, then choosing ``Run as administrator`` .
