Deploying WeeWX
Introduction
WeeWX is an open-source weather station software that collects data from personal weather stations, generates reports and graphs, and can upload to various weather networks. It is the most popular open-source software for personal weather stations worldwide.
Written in Python, WeeWX supports a wide variety of weather hardware and provides extensive customization options through its skin and extension system.
Key features of WeeWX include:
- Multi-Hardware Support: Compatible with Davis, Ambient Weather, Oregon Scientific, and many more
- Data Collection: Continuous collection of temperature, humidity, wind, rain, and more
- Report Generation: Automatic generation of HTML reports with charts and graphs
- Weather Networks: Upload to Weather Underground, CWOP, PWSweather, and others
- Customizable Skins: Multiple themes and extensive customization options
- Extension System: Extend functionality with community extensions
- Historical Data: Store and query historical weather data
- Units Flexibility: Support for US, Metric, and Metricwx units
- Almanac Data: Moon phases, sunrise/sunset times
- Image Generation: Generate weather graphs and gauges
- RESTful Services: Upload to multiple services simultaneously
This guide walks you through deploying WeeWX on Klutch.sh using Docker for weather data collection and display.
Prerequisites
Before deploying WeeWX on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- A compatible weather station
- Basic familiarity with Docker concepts
Important Considerations
WeeWX typically connects directly to weather station hardware via USB or serial connection. For cloud deployment:
- Network-Connected Stations: Stations with IP/WiFi connectivity work best
- Data Bridges: Some setups use a local device to bridge hardware to WeeWX
- Simulator Mode: Test deployments can use the simulator driver
For USB-connected stations, WeeWX is better run on local hardware with the station attached.
Repository Structure
Create a GitHub repository with the following structure:
weewx-deploy/├── Dockerfile└── .dockerignoreDockerfile
Create a Dockerfile in your repository:
FROM felddy/weewx:latest
# Web interface port (for viewing reports)EXPOSE 80
# The base image handles the entrypointEnvironment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
STATION_TYPE | No | Simulator | Weather station driver |
STATION_LOCATION | No | - | Station location name |
LATITUDE | No | 0.0 | Station latitude |
LONGITUDE | No | 0.0 | Station longitude |
ALTITUDE | No | 0,foot | Station altitude |
UNITS | No | us | Unit system (us, metric, metricwx) |
Deployment on Klutch.sh
- Push your Dockerfile to your GitHub repository.
- Log in to Klutch.sh and create a new project.
- Create a new app within your project and connect your GitHub repository containing the Dockerfile.
- Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **80**
- Add environment variables: - `STATION_TYPE`: Your station driver (or `Simulator` for testing) - `STATION_LOCATION`: Your location name - `LATITUDE`, `LONGITUDE`: Your coordinates - `ALTITUDE`: Your elevation - `UNITS`: Your preferred unit system
- Attach persistent volumes: - Mount path: `/var/lib/weewx` - Recommended size: 5 GB - Purpose: Weather database and archive - Mount path: `/var/www/html/weewx` - Recommended size: 1 GB - Purpose: Generated reports and images
- Click **Deploy** and wait for the build to complete.
- Access your WeeWX reports at the provided URL.
Post-Deployment Configuration
After deployment:
- Configure your weather station driver settings
- Set up upload destinations (Weather Underground, etc.)
- Customize report skins
- Install additional extensions as needed
Weather Network Integration
Configure uploads to weather networks by setting additional environment variables for your preferred services.
Troubleshooting
No Data Appearing
Verify the station driver is correctly configured and the station is accessible.
Reports Not Generating
Check WeeWX logs for errors in report generation. Ensure sufficient disk space.