{"id":7989,"date":"2021-03-20T13:21:16","date_gmt":"2021-03-20T10:21:16","guid":{"rendered":"https:\/\/kifarunix.com\/?p=7989"},"modified":"2024-03-19T18:48:39","modified_gmt":"2024-03-19T15:48:39","slug":"install-fleet-osquery-manager-on-ubuntu","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-fleet-osquery-manager-on-ubuntu\/","title":{"rendered":"Install Fleet Osquery Manager on Ubuntu 20.04\/Ubuntu 22.04"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to install <a aria-label=\"Fleet (opens in a new tab)\" class=\"rank-math-link\" href=\"https:\/\/fleetdm.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fleet<\/a> osquery manager on Ubuntu 20.04\/Ubuntu 22.04. With the official retirement of the Kolide Fleet as on November 4th, 2020, there has been yet another <a aria-label=\"Fleet (opens in a new tab)\" class=\"rank-math-link\" href=\"https:\/\/fleetdm.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fleet<\/a> that offers the same functionality as Kolide Fleet. According to its <a aria-label=\"Github repository (opens in a new tab)\" class=\"rank-math-link\" href=\"https:\/\/github.com\/fleetdm\/fleet\" target=\"_blank\" rel=\"noreferrer noopener\">Github repository<\/a>, &#8220;<em>Fleet is the most widely used open source osquery manager. Deploying osquery with Fleet enables programmable live queries, streaming logs, and effective management of osquery across 50,000+ servers, containers, and laptops. It&#8217;s especially useful for talking to multiple devices at the same time.<\/em>&#8220;<\/p>\n\n\n\n<p>If you are using Debian 10, follow the guide below to install Fleet Osquery on Debian 10;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-fleet-osquery-manager-on-debian-10\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Install Fleet Osquery Manager on Debian 10<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Osquery Fleet Manager on Ubuntu<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p>In order to install Fleet osquery manager on Ubuntu, there are a few requirements. In our setup, we will be using Ubuntu 20.04\/Ubuntu 22.04 as our base OS.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install MySQL Database on Ubuntu 20.04\/Ubuntu 22.04<\/h4>\n\n\n\n<p>Fleet uses MySQL as its main database<\/p>\n\n\n\n<p>In this setup, we will use MariaDB database. Hence, create latest MariaDB (currently v10.8) APT repository<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install software-properties-common gnupg2 zip -y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget -qO- https:\/\/mariadb.org\/mariadb_release_signing_key.asc | gpg --dearmor &gt; \/etc\/apt\/trusted.gpg.d\/mariadb.gpg<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"deb [arch=amd64] http:\/\/sfo1.mirrors.digitalocean.com\/mariadb\/repo\/10.8\/ubuntu $(lsb_release -sc) main\" &gt; \/etc\/apt\/sources.list.d\/mariadb-10.8.list<\/code><\/pre>\n\n\n\n<p>If you need, you can choose <a href=\"https:\/\/downloads.mariadb.org\/mariadb\/repositories\/#distro=Ubuntu&amp;distro_release=focal--ubuntu_focal\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">other MariaDB mirrors closed to your region<\/a>.<\/p>\n\n\n\n<p>Update your package cache.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<p>Run the command install MariaDB server 10.5 on Ubuntu 20.04<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install mariadb-server<\/code><\/pre>\n\n\n\n<p>MariaDB is started and enabled to run on system boot upon installation.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status mariadb.service<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n\u25cf mariadb.service - MariaDB 10.8.5 database server\n     Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\n    Drop-In: \/etc\/systemd\/system\/mariadb.service.d\n             \u2514\u2500migrated-from-my.cnf-settings.conf\n     Active: active (running) since Mon 2022-09-26 17:16:45 UTC; 2min 4s ago\n       Docs: man:mariadbd(8)\n             https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n    Process: 3526 ExecStartPre=\/usr\/bin\/install -m 755 -o mysql -g root -d \/var\/run\/mysqld (code=exited, status=0\/SUCCESS)\n    Process: 3527 ExecStartPre=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n    Process: 3529 ExecStartPre=\/bin\/sh -c [ ! -e \/usr\/bin\/galera_recovery ] && VAR= ||   VAR=`cd \/usr\/bin\/..; \/usr\/bin\/galera_recovery`; [ $? -eq 0 ]   && systemctl set-en>\n    Process: 3575 ExecStartPost=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n    Process: 3577 ExecStartPost=\/etc\/mysql\/debian-start (code=exited, status=0\/SUCCESS)\n   Main PID: 3558 (mariadbd)\n     Status: \"Taking your SQL requests now...\"\n      Tasks: 9 (limit: 4574)\n     Memory: 78.1M\n        CPU: 359ms\n     CGroup: \/system.slice\/mariadb.service\n             \u2514\u25003558 \/usr\/sbin\/mariadbd\n\nSep 26 17:16:45 jellyfish mariadbd[3558]: 2022-09-26 17:16:45 0 [Note] Plugin 'FEEDBACK' is disabled.\nSep 26 17:16:45 jellyfish mariadbd[3558]: 2022-09-26 17:16:45 0 [Note] InnoDB: Loading buffer pool(s) from \/var\/lib\/mysql\/ib_buffer_pool\nSep 26 17:16:45 jellyfish mariadbd[3558]: 2022-09-26 17:16:45 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.\nSep 26 17:16:45 jellyfish mariadbd[3558]: 2022-09-26 17:16:45 0 [Note] Server socket created on IP: '127.0.0.1'.\nSep 26 17:16:45 jellyfish mariadbd[3558]: 2022-09-26 17:16:45 0 [Note] InnoDB: Buffer pool(s) load completed at 220926 17:16:45\nSep 26 17:16:45 jellyfish mariadbd[3558]: 2022-09-26 17:16:45 0 [Note] \/usr\/sbin\/mariadbd: ready for connections.\nSep 26 17:16:45 jellyfish mariadbd[3558]: Version: '10.8.5-MariaDB-1:10.8.5+maria~ubu2204'  socket: '\/run\/mysqld\/mysqld.sock'  port: 3306  mariadb.org binary distribution\nSep 26 17:16:45 jellyfish systemd[1]: Started MariaDB 10.8.5 database server.\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Create Fleet Database and Database User<\/h4>\n\n\n\n<p>Run the initial MySQL security script,&nbsp;<strong>mysql_secure_installation<\/strong>, to remove anonymous database users, test tables, disable remote root login.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>By default, MariaDB 10.5 uses unix_socket for authentication by default and hence, can login by just running,&nbsp;<code><strong>mysql -u root<\/strong><\/code>. If have however enabled password authentication, simply run;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Next, create the Fleet database.<\/p>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;<strong>the database database names used here are not standard. Choose any name of your preference.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database fleetdb;<\/code><\/pre>\n\n\n\n<p>Create Fleet database user with all grants on Fleet DB created above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grant all on fleetdb.* to fleetadmin@localhost identified by 'StrongP@SS';<\/code><\/pre>\n\n\n\n<p>Reload privileges tables and exit the database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nexit<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Redis on Ubuntu 20.04\/Ubuntu 22.04<\/h4>\n\n\n\n<p><em>Fleet uses Redis to ingest and queue the results of distributed queries, cache data, etc.<\/em><\/p>\n\n\n\n<p>To install the latest stable version of Redis, run the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -fsSL https:\/\/packages.redis.io\/gpg | gpg --dearmor &gt; \/etc\/apt\/trusted.gpg.d\/redis.gpg <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"deb https:\/\/packages.redis.io\/deb $(lsb_release -cs) main\" &gt; \/etc\/apt\/sources.list.d\/redis.list<\/code><\/pre>\n\n\n\n<p>Next, update the package cache;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<p>Install Redis on Ubuntu 20.04\/Ubuntu 22.04;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install redis<\/code><\/pre>\n\n\n\n<p>Redis server is similarly started upon installation;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status redis-server.service<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n\u25cf redis-server.service - Advanced key-value store\n     Loaded: loaded (\/lib\/systemd\/system\/redis-server.service; disabled; vendor preset: enabled)\n     Active: active (running) since Mon 2022-09-26 17:24:43 UTC; 25s ago\n       Docs: http:\/\/redis.io\/documentation,\n             man:redis-server(1)\n   Main PID: 4457 (redis-server)\n     Status: \"Ready to accept connections\"\n      Tasks: 5 (limit: 4574)\n     Memory: 2.8M\n        CPU: 100ms\n     CGroup: \/system.slice\/redis-server.service\n             \u2514\u25004457 \"\/usr\/bin\/redis-server 127.0.0.1:6379\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n\nSep 26 17:24:43 jellyfish systemd[1]: Starting Advanced key-value store...\nSep 26 17:24:43 jellyfish systemd[1]: Started Advanced key-value store.\n<\/code><\/pre>\n\n\n\n<p>Enable it to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable redis-server<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Osquery Fleet Manager on Ubuntu<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Install the Fleet binary on Ubuntu 20.04\/Ubuntu 22.04<\/h4>\n\n\n\n<p><em>The Fleet application is distributed as a single static binary. This binary serves:<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>The Fleet web interface<\/em><\/li>\n\n\n\n<li><em>The Fleet application API endpoints<\/em><\/li>\n\n\n\n<li><em>The osquery TLS server API endpoints<\/em><\/li>\n<\/ul>\n\n\n\n<p>To download the latest Fleet and Fleetctl binaries (v4.20.1 currently), navigate to the <a href=\"https:\/\/github.com\/fleetdm\/fleet\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">releases page<\/a> and grab the archive. You can get the url and simply execute the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -LO https:\/\/github.com\/fleetdm\/fleet\/releases\/download\/fleet-v4.20.1\/fleet_v4.20.1_linux.tar.gz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -LO https:\/\/github.com\/fleetdm\/fleet\/releases\/download\/fleet-v4.20.1\/fleetctl_v4.20.1_linux.tar.gz<\/code><\/pre>\n\n\n\n<p>Extract the binaries for Linux platform:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar xzf fleet_v4.20.1_linux.tar.gz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>tar xzf fleetctl_v4.20.1_linux.tar.gz<\/code><\/pre>\n\n\n\n<p>Copy Fleet binaries to binaries directories;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp fleet_v4.20.1_linux\/fleet \/usr\/local\/bin\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cp fleetctl_v4.20.1_linux\/fleetctl \/usr\/local\/bin\/<\/code><\/pre>\n\n\n\n<p>To verify the binaries are in place;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>which fleet fleetctl<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\/bin\/fleet\n\/usr\/local\/bin\/fleetctl<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running&nbsp; Fleet Server on Ubuntu 20.04\/Ubuntu 22.04<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Initialize Fleet Database<\/h5>\n\n\n\n<p>To initialize Fleet infrastructure after installing and setting up all the requirements above, use the&nbsp;<code>fleet prepare db<\/code>&nbsp;as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet prepare db --mysql_address=127.0.0.1:3306 --mysql_database=fleetdb --mysql_username=fleetadmin --mysql_password=StrongP@SS<\/code><\/pre>\n\n\n\n<p>If the initialization completes successfully, you should get the output,<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\nINFO: 17:46:26 Adding software_id column to software_cve table...\nINFO: 17:46:26 Done adding software_id column to software_cve table...\nINFO: 17:46:26 Updating software_id column in software_cve table...\nINFO: 17:46:26 Nothing to update ...\nINFO: 17:46:26 Done updating 'software_id'...\nINFO: 17:46:26 Adding index to 'software_id'...\nINFO: 17:46:26 Done adding index to 'software_id'...\nINFO: 17:46:26 Trying to acquire lock...\nINFO: 17:46:26 Lock acquired...\nINFO: 17:46:26 Removing duplicates in the software_cve table\nINFO: 17:46:26 Adding unique constraint on (cve, software_id) to software_cve table...\nINFO: 17:46:26 Done adding unique constraint on (cve, software_id) to software_cve table...\nINFO: 17:46:26 Creating table mobile_device_management_solutions...\nINFO: 17:46:26 Done creating table mobile_device_management_solutions...\nINFO: 17:46:26 Adding column mdm_id to table host_mdm...\nINFO: 17:46:26 Done adding column mdm_id to table host_mdm...\nINFO: 17:46:26 Adding index on mdm_id of table host_mdm...\nINFO: 17:46:27 Done adding index on mdm_id of table host_mdm...\nINFO: 17:46:27 Adding index on enrolled, installed_from_dep of table host_mdm...\nINFO: 17:46:27 Done adding index on enrolled, installed_from_dep of table host_mdm...\nINFO: 17:46:27 Increasing width of software.vendor...\nINFO: 17:46:27 Done increasing width of software.vendor...\nINFO: 17:46:27 Creating table munki_issues...\nINFO: 17:46:27 Done creating table munki_issues...\nINFO: 17:46:27 Creating table host_munki_issues...\nINFO: 17:46:27 Done creating table host_munki_issues...\nINFO: 17:46:27 Deleting dummy software_cpe entries...\nINFO: 17:46:27 Done deleting dummy cpe_id entries...\nINFO: 17:46:27 Removing cpe_id from software_cve...\nINFO: 17:46:27 Done removing cpe_id from software_cve...\nMigrations completed.\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Generate SSL\/TLS Certificates<\/h5>\n\n\n\n<p>Fleet server is used to run the main HTTPS server. Hence, run the command below to generate self-signed certificates.<\/p>\n\n\n\n<p>NOTE:&nbsp;<strong>If you are using Self Signed Certificates as in this demo, DO NOT use wildcards lest enrollment of hosts won\u2019t work.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/fleet.key -out \/etc\/ssl\/certs\/fleet.cert -subj \"\/CN=*.kifarunix-demo.com\/\"<\/code><\/pre>\n\n\n\n<p><strong>If you can, use the commercial TLS certificates from your preferred trusted CA.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Launching Fleet Osquery Manager<\/h4>\n\n\n\n<p>Once you have initialized the database, obtained the TLS certs, you can then launch it to verify that it can run successfully using the&nbsp;<strong>fleet serve<\/strong>&nbsp;command as shown below.<\/p>\n\n\n\n<p>The syntax for running <code><strong>fleet serve<\/strong><\/code> is given below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet serve [flags]<\/code><\/pre>\n\n\n\n<p>There are different ways in which you can specify Fleet flags;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#cli-flags\" class=\"rank-math-link\">On command line<\/a><\/li>\n\n\n\n<li><a href=\"#env-variables\" class=\"rank-math-link\">Using environment variables<\/a><\/li>\n\n\n\n<li><a href=\"#config-file\" class=\"rank-math-link\">Using a configuration file<\/a><\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"cli-flags\">Specifying Fleet Manager Flags on Command line<\/h5>\n\n\n\n<p>You can specify the flags on command line as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet serve --mysql_address=127.0.0.1:3306 \\\n--mysql_database=fleetdb --mysql_username=fleetadmin --mysql_password=StrongP@SS \\\n--server_cert=\/etc\/ssl\/certs\/fleet.cert --server_key=\/etc\/ssl\/private\/fleet.key \\\n--logging_json <\/code><\/pre>\n\n\n\n<p>If all is well, you should see that Fleet server is now running on&nbsp;<strong>0.0.0.0:8080<\/strong>&nbsp;and hence can be accessed on&nbsp;<strong>https:\/\/&lt;server-IP&gt;:8080<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"component\":\"redis\",\"level\":\"info\",\"mode\":\"standalone\",\"ts\":\"2022-09-26T17:52:54.28424084Z\"}\n{\"component\":\"crons\",\"cron\":\"vulnerabilities\",\"level\":\"info\",\"periodicity\":\"1h0m0s\",\"ts\":\"2022-09-26T17:52:54.295821803Z\"}\n{\"level\":\"info\",\"msg\":\"metrics endpoint disabled (http basic auth credentials not set)\",\"ts\":\"2022-09-26T17:52:54.312885518Z\"}\n{\"address\":\"0.0.0.0:8080\",\"msg\":\"listening\",\"transport\":\"https\",\"ts\":\"2022-09-26T17:52:54.313178069Z\"}\n{\"component\":\"crons\",\"cron\":\"vulnerabilities\",\"level\":\"info\",\"msg\":\"software inventory not configured\",\"ts\":\"2022-09-26T17:53:04.300608097Z\"}<\/code><\/pre>\n\n\n\n<p>Press Ctrl+c to stop Fleet server.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"env-variables\">Specifying Fleet Manager Flags Using Environment Variables<\/h5>\n\n\n\n<p>Similarly, you can specify the Fleet flags using environment variables as shown below (update the values for the environment variables and paste the command on the terminal);<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FLEET_MYSQL_ADDRESS=127.0.0.1:3306 \\\nFLEET_MYSQL_DATABASE=fleetdb \\\nFLEET_MYSQL_USERNAME=fleetadmin \\\nFLEET_MYSQL_PASSWORD=StrongP@SS \\\nFLEET_REDIS_ADDRESS=127.0.0.1:6379 \\\nFLEET_SERVER_CERT=\/etc\/ssl\/certs\/fleet.cert \\\nFLEET_SERVER_KEY=\/etc\/ssl\/private\/fleet.key \\\nFLEET_LOGGING_JSON=true \\\n$(which fleet) serve<\/code><\/pre>\n\n\n\n<p>Similarly, press Ctrl+c to stop Fleet server.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"config-file\">Setting the Fleet Manager Flags in a Configuration file<\/h5>\n\n\n\n<p>You can create a YAML configuration file where you can define the flags and their options. For example, let us create a configuration file, e.g <strong><code>\/etc\/fleet\/fleet.yml<\/code><\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mkdir \/etc\/fleet<\/code><\/pre>\n\n\n\n<p>The, create a YAML configuration file under the directory above.<\/p>\n\n\n\n<p>You can simply execute the command below and be sure to replace your settings appropriately.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\ncat > \/etc\/fleet\/fleet.yml &lt;&lt; 'EOL'\nmysql:\n  address: 127.0.0.1:3306\n  database: fleetdb\n  username: fleetadmin\n  password: StrongP@SS\nredis:\n  address: 127.0.0.1:6379\nserver:\n  cert: \/etc\/ssl\/certs\/fleet.cert\n  key: \/etc\/ssl\/private\/fleet.key\nlogging:\n  json: true\n# auth:\n#  jwt_key: cw1h9ww06XwWDOwDDBpi9pxwNqEVf6Ig\nEOL\n<\/code><\/pre>\n\n\n\n<p>Next, launch the Fleet manager by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet serve -c \/etc\/fleet\/fleet.yml<\/code><\/pre>\n\n\n\n<p>Similarly, press Ctrl+c to stop Fleet server.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create Fleet Systemd Service Unit on Ubuntu 20.04<\/h4>\n\n\n\n<p>Once you have verified that Fleet is running fine, create a systemd service file, <strong><code>\/etc\/systemd\/system\/fleet.service<\/code><\/strong>. You can use any method shown above to specify the flags for <code><strong>ExecStart <\/strong><\/code>option while creating the systemd service unit file.<\/p>\n\n\n\n<p>Example of Fleet systemd service unit file with Flags specified in &#8216;cli&#8217; like format.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\ncat &gt; \/etc\/systemd\/system\/fleet.service &lt;&lt; 'EOL'\n[Unit]\nDescription=Fleet Osquery Fleet Manager\nAfter=network.target\n\n[Service]\nLimitNOFILE=8192\nExecStart=\/usr\/local\/bin\/fleet serve \\\n  --mysql_address=127.0.0.1:3306 \\\n  --mysql_database=fleetdb \\\n  --mysql_username=fleetadmin \\\n  --mysql_password=StrongP@SS \\\n  --redis_address=127.0.0.1:6379 \\\n  --server_cert=\/etc\/ssl\/certs\/fleet.cert \\\n  --server_key=\/etc\/ssl\/private\/fleet.key \\\n  --logging_json\nExecStop=\/bin\/kill -15 $(ps aux | grep \"fleet serve\" | grep -v grep | awk '{print$2}')\n\n[Install]\nWantedBy=multi-user.target\nEOL\n<\/code><\/pre>\n\n\n\n<p>The method I preferred myself is to use the configuration file instead. The below service file uses the configuration file with Fleet flags defined as shown <a class=\"rank-math-link\" href=\"https:\/\/kifarunix.com\/install-fleet-osquery-manager-on-ubuntu\/#config-file\">above<\/a>.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\ncat &gt; \/etc\/systemd\/system\/fleet.service &lt;&lt; 'EOL'\n[Unit]\nDescription=Fleet Osquery Fleet Manager\nAfter=network.target\n\n[Service]\nLimitNOFILE=8192\nExecStart=\/usr\/local\/bin\/fleet serve -c \/etc\/fleet\/fleet.yml\nExecStop=\/bin\/kill -15 $(ps aux | grep \"fleet serve\" | grep -v grep | awk '{print$2}')\n\n[Install]\nWantedBy=multi-user.target\nEOL\n<\/code><\/pre>\n\n\n\n<p>Reload systemd configurations.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>Start and enable Fleet service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now fleet<\/code><\/pre>\n\n\n\n<p>Check the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status fleet<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n\u25cf fleet.service - Fleet Osquery Fleet Manager\n     Loaded: loaded (\/etc\/systemd\/system\/fleet.service; enabled; vendor preset: enabled)\n     Active: active (running) since Mon 2022-09-26 18:01:12 UTC; 6s ago\n   Main PID: 5422 (fleet)\n      Tasks: 9 (limit: 4574)\n     Memory: 16.0M\n        CPU: 120ms\n     CGroup: \/system.slice\/fleet.service\n             \u2514\u25005422 \/usr\/local\/bin\/fleet serve -c \/etc\/fleet\/fleet.yml\n\nSep 26 18:01:12 jellyfish systemd[1]: Started Fleet Osquery Fleet Manager.\nSep 26 18:01:12 jellyfish fleet[5422]: Using config file: \/etc\/fleet\/fleet.yml\nSep 26 18:01:12 jellyfish fleet[5422]: {\"component\":\"redis\",\"level\":\"info\",\"mode\":\"standalone\",\"ts\":\"2022-09-26T18:01:12.109487031Z\"}\nSep 26 18:01:12 jellyfish fleet[5422]: {\"component\":\"crons\",\"cron\":\"vulnerabilities\",\"level\":\"info\",\"periodicity\":\"1h0m0s\",\"ts\":\"2022-09-26T18:01:12.121929269Z\"}\nSep 26 18:01:12 jellyfish fleet[5422]: {\"level\":\"info\",\"msg\":\"metrics endpoint disabled (http basic auth credentials not set)\",\"ts\":\"2022-09-26T18:01:12.13573016Z\"}\nSep 26 18:01:12 jellyfish fleet[5422]: {\"address\":\"0.0.0.0:8080\",\"msg\":\"listening\",\"transport\":\"https\",\"ts\":\"2022-09-26T18:01:12.13588821Z\"}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Access Fleet Web Interface<\/h3>\n\n\n\n<p>Fleet can be accessed on the browser using the URL&nbsp;<strong>https:\/\/&lt;server-IP_OR_hostname&gt;:8080<\/strong>.<\/p>\n\n\n\n<p>If firewall is running, open this port to allow external access;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ufw allow 8080\/tcp<\/code><\/pre>\n\n\n\n<p>Then access Fleet Web interface from browser. and proceed to finalize the setup of Fleet Osquery manager on Ubuntu 20.04;<\/p>\n\n\n\n<p>Create the admin user;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1379\" height=\"907\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin.png\" alt=\"install Fleet osquery manager on Ubuntu 20.04\" class=\"wp-image-8318\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin.png?v=1616229903 1379w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-768x505.png?v=1616229903 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-150x99.png?v=1616229903 150w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-300x197.png?v=1616229903 300w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-696x458.png?v=1616229903 696w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-1068x702.png?v=1616229903 1068w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-639x420.png?v=1616229903 639w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/create-fleet-admin-741x486.png?v=1616229903 741w\" sizes=\"(max-width: 1379px) 100vw, 1379px\" \/><\/figure>\n\n\n\n<p>Enter your organization details, Name and url to logo.<\/p>\n\n\n\n<p>Set the Fleet server URL.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1121\" height=\"792\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url.png\" alt=\"\" class=\"wp-image-8345\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url.png?v=1616259064 1121w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-768x543.png?v=1616259064 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-150x106.png?v=1616259064 150w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-300x212.png?v=1616259064 300w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-696x492.png?v=1616259064 696w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-1068x755.png?v=1616259064 1068w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-594x420.png?v=1616259064 594w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/fleet_url-100x70.png?v=1616259064 100w\" sizes=\"(max-width: 1121px) 100vw, 1121px\" \/><\/figure><\/div>\n\n\n<p>Submit the details and proceed to Fleet web interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1917\" height=\"652\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/09\/fleet-dashboard.png\" alt=\"\" class=\"wp-image-14135\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/09\/fleet-dashboard.png?v=1664216524 1917w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/09\/fleet-dashboard-768x261.png?v=1664216524 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/09\/fleet-dashboard-1536x522.png?v=1664216524 1536w\" sizes=\"(max-width: 1917px) 100vw, 1917px\" \/><\/figure>\n\n\n\n<p>And that marks the end of our tutorial on how to install Fleet Osquery Manager on Ubuntu 20.04. In our next tutorial, you will learn how to enroll Osquery agents to Fleet manager.<\/p>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/enroll-osquery-hosts-on-fleet-manager\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">How to Enroll Osquery Hosts on Fleet Manager<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reference<\/h3>\n\n\n\n<p><a aria-label=\"Installing Fleet (opens in a new tab)\" href=\"https:\/\/github.com\/fleetdm\/fleet\/blob\/master\/docs\/2-Deployment\/1-Installation.md#installing-the-fleet-binary\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Installing Fleet<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Related Tutorials<\/h3>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-osquery-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Install Osquery on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-osquery-on-debian-10-buster\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Install Osquery on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-osquery-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">How to Install Osquery on Ubuntu 18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to install Fleet osquery manager on Ubuntu 20.04\/Ubuntu 22.04. With the official retirement of the Kolide Fleet as<\/p>\n","protected":false},"author":1,"featured_media":8322,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,121,1065,34],"tags":[3289,5849,3286,3287,5848,3285,3290,1200,3288,4412],"class_list":["post-7989","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-howtos","category-osquery","category-security","tag-fleet","tag-fleet-dm-ubuntu-22-04","tag-fleet-manager-osquery","tag-install-fleet-on-ubuntu-20-04","tag-install-osquery-fleet-on-ubuntu-22-04","tag-install-osquery-fleet-ubuntu","tag-osquery-manager","tag-ubuntu-20-04","tag-ubuntu-20-04-fleet-osquery","tag-ubuntu-22-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7989"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=7989"}],"version-history":[{"count":16,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7989\/revisions"}],"predecessor-version":[{"id":21896,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7989\/revisions\/21896"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/8322"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=7989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=7989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=7989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}