FleetDM Setup
Guide on How to Install and Configure FleetDM
Last updated
Guide on How to Install and Configure FleetDM
Last updated
FleetDM is an Open Source application that will help remotely run queries on devices on a network using OSQuery.
First, the Ubuntu system is updated, in the correct time zone, and the hostname is changed (optional). Use the following commands to do this.
Next, install redis server and ensure that it is up and operational.
Check to make sure redis-server is up an running using the following command.
Now install and set up a MySQL database for FleetDM to use.
Run mysql_secure_installation
to securely install MySQL.
Enter "y" for password validation
Enter "2" to ensure strong passwords are made in this MySQL instance
Make and confirm a strong root password
Enter "y" to confirm root password
Enter "y" to remove anonymous users
Enter "y" to disallow root remote logins
Enter "y" to remove the test database
Enter "y" to reload privilege tables
Next, enable MySQL and then interact with the MySQL environment as root using using the following commands.
Now, run the following queries to create a database and database user with the required privileges for FleetDM to use.
Download MySQL Settings config using the command, then finally restart MySQL.
Before Installing FleetDM, a FleetDM system user must be added with the correct permissions.
Note: The FleetDM account that we just created will not be used to log into as it a system account. We are just using it to help run FleetDM.
Now, change directory to the /tmp/
folder, download the FleetDM files, and unzip them. From there, start making directories for FleetDM binaries and OSQuery logs and changing their ownerships.
NOTE: FleetDM version 3.6.0 is installed in this tutorial
Now, create a self-signed private key and public cert for the server so our OSQuery instances can connect securely to it.
Country Name: US
State or Province: Vermont
Locality Name: Burlington
Organization Name: Champlain
Organizational Unit Name: SEC440
Common Name: [Your-IP or FQDN]
Next, download the FleetDM config file (fleetdm.yml
), change its ownership and permissions, and then make changes to it. Copy the jwt key before editing "fleetdm.yml" file.
Using a text editor, put the database name in replace of '{{ mysql_fleetdm_db_name }}', database username in replace of '{{ mysql_fleetdm_username }}', and database password at '{{ mysql_fleetdm_password }}'. In this example, we used "fleetdm" as both the database name and database username. Lastly, replace '{{ fleetdm_jwt }}' with the jwt key you generated in the command before.
Note: Values for "fleetdm.yml" should be surrounded by single quotes ('), no brackets ({}), and no spaces.
After editing the config file, initialize the FleetDM database.
Now download the SystemD config file for FleetDM. This will allow systemctl commands to be run for FleetDM. After doing this, enable and start FleetDM, then check to see if it is running.
NGINX will need to be installed so that FleetDM can be accessed through the browser. Get the NGINX and FleetDM NGINX configuration files, then enable and restart NGINX to get it up and running properly.
Browse to https://localhost:443. When navigated there, the FleetDM setup page should be seen like below.
Insert a username and password, as well as an email (no further email setup will be required).
After hitting next, put an organization name in there, no logo is required.
Finally, after hitting next again, put the Fleet web address in. Make sure this matches with the public certificate created earlier (FQDN/Common Name). Then submit, review admin configuration, and finish.
Congratulations! FleetDM is now installed and is now able to have hosts added!