Over 2.2 million downloads • 800+ GitHub stars • Active since 2007
GPS Tracker is a complete GPS tracking system that allows you to track mobile devices in real-time using Google or Open Street Maps and other map providers. This project has been actively maintained since 2007, with Version 7 representing a complete rewrite of the core components with modern code practices and frameworks.
Version 7 is a major update with complete rewrites of the three primary components:
Live Demo: View the tracking system in action at https://www.websmithing.com/gpstracker/map
- PHP/JS Server: Modernized with clean architecture and responsive design
- Android Client: Completely rewritten in Kotlin with MVVM architecture
- iOS Client: New Swift implementation with SwiftUI and MVVM architecture
All components feature production-quality code with comprehensive inline documentation. This rewrite was done with the assistance of Google Gemini Pro 2.5 exp 03-25.
GPS Tracker consists of three main components:
- Mobile Clients: Native apps for iOS and Android that capture location data
- Server: PHP/JS backend that receives, stores, and processes location updates
- Web Interface: Responsive dashboard for viewing real-time and historical tracking data
- Real-time tracking with customizable update intervals
- Background tracking on mobile devices
- Multiple map providers (Google Maps, OpenStreetMaps, etc.)
- Responsive web interface using modern frameworks
- Comprehensive route history and playback
- Distance, speed, and battery level tracking
- Support for multiple devices and users
- Free and open source
- PHP 7.4+
- MySQL, PostgreSQL, or SQLite database
- Apache or Nginx web server
-
Clone the repository:
git clone https://github.com/nickfox/GpsTracker.git
-
Copy the server files to your web directory:
cp -r GpsTracker/servers/php/* /var/www/html/gpstracker/
-
Set proper permissions:
chmod -R 755 /var/www/html/gpstracker/ chown -R www-data:www-data /var/www/html/gpstracker/
-
Configure your environment settings:
# Copy the sample environment file cp .env.example .env # Edit the .env file with your settings vim .env # or use your preferred text editor
The
.env
file contains all necessary configuration options with helpful comments. Key settings to configure:- Database connection (MySQL, PostgreSQL, or SQLite)
- Map provider (OpenStreetMap by default, or Google Maps with API key)
- Application settings like debug mode and timezone
- Measurement units (miles/kilometers)
-
Create the database schema:
- For SQLite: The database file will be created automatically in the
sqlite
directory - For MySQL/PostgreSQL: Create the database manually before running the application:
CREATE TABLE locations ( id INT AUTO_INCREMENT PRIMARY KEY, device_id VARCHAR(50) NOT NULL, latitude DECIMAL(10, 8) NOT NULL, longitude DECIMAL(11, 8) NOT NULL, speed DECIMAL(5, 2), heading INT, altitude DECIMAL(7, 2), accuracy DECIMAL(6, 2), event_time DATETIME NOT NULL, battery_level INT, app_version VARCHAR(10), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE routes ( id INT AUTO_INCREMENT PRIMARY KEY, device_id VARCHAR(50) NOT NULL, route_name VARCHAR(100) NOT NULL, route_color VARCHAR(7) DEFAULT '#0000FF', start_time DATETIME NOT NULL, end_time DATETIME, distance DECIMAL(10, 2) DEFAULT 0, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP );
- For SQLite: The database file will be created automatically in the
-
Follow steps 1-4 from the Apache installation.
-
Add this to your Nginx server configuration:
server { listen 80; server_name your-domain.com; root /var/www/html/gpstracker; index index.php index.html; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; } location ~ /\.ht { deny all; } }
-
Restart Nginx:
sudo systemctl restart nginx
-
Continue with step 5 from the Apache installation.
- Android Studio 4.0+
- Android SDK 21+
-
Open Android Studio
-
Select "Open an existing project"
-
Navigate to
GpsTracker/phoneClients/android-kotlin
-
Update the server URL in
Constants.kt
:const val SERVER_URL = "http://your-server.com/gpstracker"
-
Build and run the application on your device
- Xcode 16.2+
- iOS 15.0+
- Swift 5.8+
-
Open Xcode
-
Select "Open a project or file"
-
Navigate to
GpsTracker/phoneClients/ios-swift/GPSTracker.xcodeproj
-
Update the server URL in
APIService.swift
:private var baseURL: URL { return URL(string: "http://your-server.com/gpstracker/api/location")! }
-
Build and run the application on your device
The following components from previous versions are still available but are not actively maintained:
- ASP.NET with SQL Server backend
- Windows Phone client
- Java ME client
- WordPress plugin (with Android client)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
GPS Tracker began in 2007 and has grown into one of the most popular open source GPS tracking solutions worldwide, with over 2.2 million downloads since its initial release. It has been used in fleet management, personal safety applications, research projects, and many other scenarios across the globe.
- Thanks to the millions of users worldwide
- Thanks to all contributors who have helped improve this project over the years