Skip to content

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:

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
└── .dockerignore

Dockerfile

Create a Dockerfile in your repository:

FROM felddy/weewx:latest
# Web interface port (for viewing reports)
EXPOSE 80
# The base image handles the entrypoint

Environment Variables

VariableRequiredDefaultDescription
STATION_TYPENoSimulatorWeather station driver
STATION_LOCATIONNo-Station location name
LATITUDENo0.0Station latitude
LONGITUDENo0.0Station longitude
ALTITUDENo0,footStation altitude
UNITSNousUnit system (us, metric, metricwx)

Deployment on Klutch.sh

  1. Push your Dockerfile to your GitHub repository.
  2. Log in to Klutch.sh and create a new project.
  3. Create a new app within your project and connect your GitHub repository containing the Dockerfile.
  4. Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **80**
  5. 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
  6. 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
  7. Click **Deploy** and wait for the build to complete.
  8. Access your WeeWX reports at the provided URL.

Post-Deployment Configuration

After deployment:

  1. Configure your weather station driver settings
  2. Set up upload destinations (Weather Underground, etc.)
  3. Customize report skins
  4. 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.

Additional Resources