Build from Source

Traccar consists of a server and a web interface. Make sure you get both repositories if you want the web interface to work. The web interface is a git submodule in the main Traccar repository, so you can checkout everything you need with a single git command:

git clone --recursive https://github.com/traccar/traccar.git

There are three parts for building the full package:

In most cases all you need is to build Traccar from source code and replace the original files on the server with the newly compiled ones.

The following instructions are only for building the server and web app. Android and iOS apps are standard Android Studio and Xcode projects, so there are no special instructions required.

For the IDE (Integrated Development Environment) we recommend using IntelliJ IDEA for the server code and VS Code for the web app.

Prerequisites

Install Git, a Java Development Kit (JDK), and Node.js with npm. For compatible Java and Node.js versions, check the build workflows in the repositories.

Clone with submodules as shown above. For an existing checkout, run git submodule update --init --recursive. Build matching server and web versions, especially when deploying to an existing installation.

Build Server

To build the server binary file (JAR) use the following command:

./gradlew assemble

Run this from the server repository root. Gradle downloads dependencies and generates tracker-server.jar and its dependency libraries under target. On Windows, use gradlew.bat assemble.

To deploy your changes, stop the service, replace the JAR, and restart. If dependencies or database schema files changed, copy the matching libraries and schema files too. Use a build compatible with your installed version.

Build Web App

The web app is located in the root folder of the traccar-web repository.

It uses React and Material UI frameworks. It relies on Vite for running and building the project with minimal additional configuration.

To run the project in development mode:

The development app runs at http://localhost:3000 and proxies API requests to http://localhost:8082. If the backend uses another address, update the proxy configuration in vite.config.js.

To compile a release build, run npm run build. Output is written to traccar-web/build. Deploy the contents of that directory to the server's web directory, normally /opt/traccar/web, or the directory set by web.path. Back up custom assets before replacing files. Reload the browser after deploying.

Generate Installers (optional)

You almost never need to do this. The only reason you would want to generate an installer is to distribute your version of Traccar server.

The current packaging steps are defined in the server repository's .github/workflows/release.yml. Follow the steps for your target platform. Linux packages use makeself; Windows packages use Inno Setup.