.. _deploy:
Deploy
=======
*ogamma* Modbus OPC UA Server can be deployed either as a Docker container, or as a Windows application, or as a Linux (Ubuntu 18.04) application, as descibed in the next sections.
.. _setup-using-docker:
Setup using Docker (linux/amd64)
---------------------------------
Docker host running in Windows.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Following below console commands assume that you use terminal `PowerShell `_. If you don't want to use PowerShell in Windows, it is possible to use regular windows command console too, but in this case instead of using PowerShell variable for current folder ``${pwd}``, absolute path value should be used.
Linux image of *ogamma* Modbus OPC UA Server is hosted at `Docker Hub `_ and can be pulled by command:
.. code-block:: console
docker pull ogamma/modbus-opcua-server
Then you can start the container by command:
.. code-block:: console
docker run -d --rm --name ogamma-modbus-opcua-server --hostname modbus-opcua-server -v ${pwd}/data:/opt/ogamma/modbus-opcua-server/data -p 4840:4840 -e OMOUAS_PORT=4840 -e OMOUAS_ACCEPT_ANY_CERTIFICATE=false -e OMOUAS_ENABLE_NONE_SECURE_ENDPOINT=false ogamma/modbus-opcua-server
Docker host running in Linux (Ubuntu)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Following below console commands assume that you use bash terminal.
Linux image of *ogamma* Modbus OPC UA Server is hosted at `Docker Hub `__ and can be pulled by command:
.. code-block:: console
docker pull ogamma/modbus-opcua-server
Then you can start the container by command:
.. code-block:: console
docker run -d --rm --name ogamma-modbus-opcua-server --hostname modbus-opcua-server -v $(pwd)/data:/opt/ogamma/modbus-opcua-server/data -p 4840:4840 -e OMOUAS_PORT=4840 -e OMOUAS_ACCEPT_ANY_CERTIFICATE=false -e OMOUAS_ENABLE_NONE_SECURE_ENDPOINT=false ogamma/modbus-opcua-server
Docker host running in Raspberry Pi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
At this time Raspberry PI devices with 32 bit Debian Buster OS are supported.
Following below console commands assume that you use bash terminal.
Docker image of *ogamma* Modbus OPC UA Server is hosted at `Docker Hub `__ and can be pulled by command:
.. code-block:: console
docker pull ogamma/modbus-opcua-server-pi32
Then you can start the container by command:
.. code-block:: console
docker run -d --rm --name modbus-opcua-server-pi32 --hostname modbus-opcua-server-pi32 -v $(pwd)/data:/opt/ogamma/modbus-opcua-server/data -p 4840:4840 -e OMOUAS_PORT=4840 -e OMOUAS_ACCEPT_ANY_CERTIFICATE=false -e OMOUAS_ENABLE_NONE_SECURE_ENDPOINT=false ogamma/modbus-opcua-server-pi32
Setup in Windows
----------------
1. Install required prerequisites
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Install Visual C++ 2019 redistributables (64 bit version), using installation file ``vc-redist.x64.exe``, which can be downloaded at this direct link: https://aka.ms/vs/17/release/vc_redist.x64.exe
If this link does not work, please try this page: https://support.microsoft.com/en-ca/help/2977003/the-latest-supported-visual-c-downloads
2. Install *ogamma* Modbus OPC UA Server
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Download zip file from https://onewayautomation.com/opcua-binaries/omouas-windows-1.0.1.zip
* Unzip.
3. Start *ogamma* Modbus OPC UA Server.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Open Windows command line console, navigate to the folder where *ogamma* Modbus OPC UA Server files are unzipped, and start application **omouas.exe**.
Optionally, before starting of the application you can set some configuration options using environment variables:
.. code-block:: console
set OMOUAS_PORT=4840
set OMOUAS_ACCEPT_ANY_CERTIFICATE=false
set OMOUAS_ENABLE_NONE_SECURE_ENDPOINT=false
4. Running *ogamma* Modbus OPC UA Server as a Windows service.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to run *ogamma* Modbus OPC UA Server as a Windows service, you can use Service Manager available to donwload for free `here `_. For details on how to install ``nssm`` and configure it, please refer this page: ``_.
Setup in Ubuntu 18.04 and Ubuntu 20.04
---------------------------------------
Distribution package for Ubuntu is available at https://onewayautomation.com/opcua-binaries/omouas-ubuntu1804-1.0.1.zip
To download and install it from terminal:
* Open terminal (keyboard shortcupt ``Ctrl+Alt+t`` can be used).
* Update package lists:
.. code-block:: console
sudo apt update
* Install tools wget and unzip:
.. code-block:: console
sudo apt install wget unzip
* Download distribution package:
.. code-block:: console
wget https://onewayautomation.com/opcua-binaries/omouas-ubuntu1804-1.0.1.zip
* Unzip it:
.. code-block:: console
unzip omouas-ubuntu1804-1.0.1.zip -d omouas
* Navigate to the folder where it is extracted to:
.. code-block:: console
cd omouas
* Optionally, set some configuration options in environment variables:
.. code-block:: console
export OMOUAS_PORT=4840
export OMOUAS_ACCEPT_ANY_CERTIFICATE=false
export OMOUAS_ENABLE_NONE_SECURE_ENDPOINT=false
* Run *ogamma* Modbus OPC UA Server:
.. code-block:: console
./omouas
After start, *ogamma* Modbus OPC UA Server will be listening on TCP port 4840 as OPC UA Server.
.. note:: If TCP port (by default 4840) is in use, the application will exit with error.
Setup in Raspberry Pi (32 bit Debian Buster OS)
------------------------------------------------
Distribution package for Raspberry Pi is available at https://onewayautomation.com/opcua-binaries/omouas-pi32-1.0.1.zip
To download and install it from terminal:
* Open terminal (keyboard shortcupt ``Ctrl+Alt+t`` can be used).
* Update package lists:
.. code-block:: console
sudo apt update
* Install tools wget and unzip and C++ library atomic.so:
.. code-block:: console
sudo apt install wget unzip
sudo apt install libatomic1
* Download distribution package:
.. code-block:: console
wget https://onewayautomation.com/opcua-binaries/omouas-pi32-1.0.1.zip
* Unzip it:
.. code-block:: console
unzip omouas-pi32-1.0.1.zip -d omouas
* Navigate to the folder where it is extracted to:
.. code-block:: console
cd omouas
* Optionally, set some configuration options in environment variables:
.. code-block:: console
export OMOUAS_PORT=4840
export OMOUAS_ACCEPT_ANY_CERTIFICATE=false
export OMOUAS_ENABLE_NONE_SECURE_ENDPOINT=false
* Run *ogamma* Modbus OPC UA Server:
.. code-block:: console
./omouas