Install the dependencies as described in the next sections, then go to Clone and build
Enable the macOS developer tools:
Install Homebrew to manage dependencies, then:
brew install git go node yarn
sudo apt-get install -y git golang make nodejs npm sudo npm install -g yarn
To install dependecies, we recommend using Chocolatey. Chocolatey must be run in Powershell as an Administrator. Assuming your setup does not include any of our requirements, please run:
choco install nodejs git golang docker make python2 npm install -g yarn
Note: all packages default to the latest versions. To specify a version, place
--version <version-number> after each package. You may also install all packages manually from their websites if you prefer.
After the packages have installed, you must use Git Bash to continue with the next section.
git clone https://github.com/fleetdm/fleet.git cd fleet make deps make generate make
The binaries are now available in
To setup a working local development environment, you must install the following minimum toolset:
Once you have those minimum requirements, check out this Loom video that walks through starting up a local development environment for Fleet.
For a text-based walkthrough, continue through the following steps:
First, you will need to install Fleet's dependencies.
To do this, run the following from the root of the repository:
When pulling changes, it may be necessary to re-run
This makes deploying Fleet a dream, since you only have to worry about a single static binary. If you are working on frontend code, it is likely that you don't want to have to manually re-run
make generate and
make generate-dev will generate a Go source file which reads the frontend code from disk and run Webpack in "watch mode".
Note that when you run
After you run
make generate-dev, run
make build to build the binary, launch the binary and you'll be able to refresh the browser whenever you edit and save frontend code.
For convenience, a Makefile is included to build the code:
It's not necessary to use Make to build the code, but using Make allows us to account for cross-platform differences more effectively than the
go build tool when writing automated tooling. Use whichever you prefer.
To set up a canonical development environment via Docker, run the following from the root of the repository:
If you'd like to shut down the virtual infrastructure created by Docker, run the following from the root of the repository:
docker-compose up and are running the databases, you can build the code and run the following command to create the database tables:
./build/fleet prepare db --dev
To start the Fleet server backed by the Docker development infrastructure, run the Fleet binary as follows:
./build/fleet serve --dev
The server is accessible by default at https://localhost:8080. Note that
--dev requires the use of
make generate-dev as the server will not use bundled assets in this mode (you may see an error mentioning a template not found when visiting the website otherwise).
By default, Fleet will try to connect to servers running on default ports on
localhost. Depending on your browser's settings, you may have to click through a security warning.
If you're using the Google Chrome web browser, you have the option to always automatically bypass the security warning. Visit chrome://flags/#allow-insecure-localhost and set the "Allow invalid certificates for resources loaded from localhost." flag to "Enabled."
The Delve Go debugger can be used for debugging the Fleet binary.
Use the following command in place of
./build/fleet serve --dev:
dlv debug --build-flags '-tags=full' ./cmd/fleet -- serve --dev
It is important to pass the
-tags=full build flag, otherwise the server will not have access to the asset files.
If you notice something we’ve missed, or that could be improved, please click here to edit this page.