
macOS
=====

.. _installation#macos:

.. program:: jetstream server

.. note:: To install JetStream, you will need to either be logged in as ``root`` or be an administrative user using ``sudo``. The examples below use ``sudo``.

JetStream will install launchd agents ``io.gojetstream.jetstream-server`` and ``io.gojetstream.jetstream-relay`` for each service, and each with respective configuration files :file:`/usr/local/jetstream/etc/jetstream-server.rsp` and :file:`/usr/local/jetstream/etc/jetstream-relay.rsp`. The server service is loaded by default.


New Installation
----------------

To install JetStream on macOS, double click on the ``go-jetstream-<version>.pkg`` file.

Your server should now be running.

.. tip::
   On macOS 10.15 and above, it is recommended that you :ref:`grant full disk access<mac_full_disk_access#granting_full_disk_access>`.


Update Existing Installation
----------------------------

To update JetStream on macOS, double click on the ``go-jetstream-<version>.pkg`` file.


Uninstall
---------

To uninstall JetStream, execute the following from ``Terminal``:

.. code-block:: shell-session

   # sudo launchctl bootout system /usr/local/jetstream/etc/io.gojetstream.jetstream-server.plist
   # sudo launchctl bootout system /usr/local/jetstream/etc/io.gojetstream.jetstream-relay.plist
   # sudo launchctl disable system/io.gojetstream.jetstream-server
   # sudo launchctl disable system/io.gojetstream.jetstream-relay
   # sudo rm -rf /usr/local/jetstream
   # sudo rm -rf /var/lib/jetstream


Check Service
-------------

You can check if the JetStream service is running by running the :command:`launchctl print` command. Under normal circumstances, the command should report that the process is ``running``. For example:

.. code-block:: shell-session

   # launchctl print system/io.gojetstream.jetstream-server
   io.gojetstream.jetstream-server = {
      active count = 1
      path = /usr/local/jetstream/etc/io.gojetstream.jetstream-server.plist
      state = running
      ...


Check Server
------------

You can check that the server is active by making a simple API call on the command-line.

.. code-block:: shell-session

   # /usr/local/jetstream/bin/jetstream api --no-auth getServerInfo
   {
    "allowRemoteControl": true,
    "apiControlPort": 8886,
    ...
    "license": {
     "expiry": "2020-10-01 (365 days from now including today)",
     "valid": true
    },
    ...
    "version": "2.0.0"
   }


Firewalls
---------

There may be internal or external firewalls preventing connections. See :doc:`/setup/firewalls` for tips on firewall configuration.


.. seealso::
  - :doc:`Interact with the JetStream Server </using_jetstream/interacting_with_jetstream>`
  - :doc:`Configure your JetStream Server license and installation </setup/configuration>`
  - :doc:`Manage the JetStream service </setup/services>`
