Have you ever wanted a beautiful and interactive way to visualize your travel history?
AirTrail is a fantastic open-source web application that lets you do just that!
It allows you to track your flights, view them on a world map, and even provides insightful statistics about your journeys.
And the best part?
You can easily self-host AirTrail using Docker Containers!
What is AirTrail?
AirTrail offers a range of features to make tracking your flights enjoyable and informative:
-
Interactive World Map: Visualize all your flights on a globe.
-
Detailed Flight History: Keep a comprehensive record of every flight.
-
Flight Statistics: Analyze your travel patterns and gain insights.
-
Multi-User Support: Share flights with others or keep your data separate.
-
Responsive Design: Access AirTrail from any device.
-
Dark Mode: A visually pleasing option for night owls.
-
Flight Import: Easily import your flight data from other platforms like MyFlightRadar24, App in the Air, and JetLog.
A modern, open-source personal flight tracking system
Why Self-Host AirTrail?
Self-hosting gives you complete control over your data.
You’re not relying on any third-party services, ensuring your flight information remains private and secure.
Plus, with Docker, the setup process is incredibly streamlined and portable (even if you use Windows).
Self-Hosting AirTrail
Here’s how you can get AirTrail up and running on your own server using Docker:
-
Prerequisites: Make sure you have Docker and Docker Compose installed on your system. You can find instructions for your operating system on the official Docker website: https://www.docker.com/
-
Clone the Repository: Clone the AirTrail repository from GitHub:
git clone https://github.com/johanohly/AirTrail.git
cd AirTrail
-
Configuration: The AirTrail repository includes a
docker-compose.ymlfile that simplifies the setup. You’ll likely need to configure environment variables, especially for database connection details. Review the documentation for specific configuration options: https://airtrail.johan.ohly.dk/docs/overview/quick-start -
Run with Docker Compose: Navigate to the AirTrail directory in your terminal and run:
docker-compose up -d
This command will download the necessary Docker images, create the containers, and start AirTrail in detached mode (running in the background).
You can also see the compose and .env files:
wget -O docker-compose.yml https://raw.githubusercontent.com/JohanOhly/AirTrail/main/docker/production/compose.yml
wget -O .env https://raw.githubusercontent.com/JohanOhly/AirTrail/main/.env.example
And make your Docker Portainer Stack:
services:
db:
container_name: airtrail_db
image: postgres:16-alpine
restart: always
environment:
POSTGRES_DB: airtrail
POSTGRES_USER: airtrail
POSTGRES_PASSWORD: password # Hardcoded password - CHANGE THIS IN PRODUCTION!
#POSTGRES_PASSWORD: ${DB_PASSWORD}
# env_file:
# - .env
volumes:
- db_airtrail_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U airtrail -d airtrail']
interval: 5s
timeout: 5s
retries: 5
airtrail:
container_name: airtrail
image: johly/airtrail:latest
restart: always
ports:
- 3000:3000
depends_on:
db:
condition: service_healthy
environment:
ORIGIN: http://localhost:3000
DB_URL: postgres://airtrail:password@db:5432/airtrail # Matches the DB configuration
volumes:
db_airtrail_data:
- Access AirTrail: Once the containers are running, you can access AirTrail in your web browser. The default port is usually 8080. So, if your server’s IP address is
192.168.1.100, you would navigate tohttp://192.168.1.100:8080.
Or in your laptop, just try with http://localhost:8080
With AirTrail up and running, start exploring its features!
Import your existing flight data, add new flights, and enjoy visualizing your travel history.
Or like these:
The UI of Airtrail is very cool:
Important Considerations
- Database: AirTrail requires a database (PostgreSQL is recommended). Ensure your database is configured correctly and the connection details are provided in your
.envfile. - Reverse Proxy (Optional): If you plan to access AirTrail from the internet, it’s highly recommended to set up a reverse proxy like Nginx or Traefik for security and to manage SSL certificates.
- Data Backup: Regularly back up your database to prevent data loss.
Conclusion
Self-hosting AirTrail with Docker is a straightforward way to gain control over your flight data and enjoy a beautiful application for tracking your travels.
Give it a try and start visualizing your adventures!