Deploying WebThings Gateway
Introduction
WebThings Gateway is an open-source smart home controller that allows you to manage IoT devices from multiple manufacturers through a unified interface. Based on the Web of Things standard, it provides local control of your smart home without relying on cloud services.
Developed originally by Mozilla, WebThings Gateway supports various protocols including Zigbee, Z-Wave, and Wi-Fi devices through an extensible add-on system.
Key features of WebThings Gateway include:
- Multi-Protocol Support: Connect Zigbee, Z-Wave, and Wi-Fi devices
- Privacy-Focused: Local control without cloud dependencies
- Web Interface: Manage devices from any web browser
- Rules Engine: Create automation rules for smart devices
- Floor Plan View: Visualize devices on a custom floor plan
- Voice Control: Integration with voice assistants
- Add-On System: Extend functionality with community add-ons
- Web of Things API: Standard API for IoT interoperability
- Remote Access: Optional secure remote access through tunneling
- Logs and Monitoring: Track device activity and events
- User Management: Multi-user support with permissions
This guide walks you through deploying WebThings Gateway on Klutch.sh using Docker for smart home control.
Prerequisites
Before deploying WebThings Gateway on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Compatible smart home devices (Zigbee, Z-Wave, or Wi-Fi)
- Basic familiarity with Docker and smart home concepts
Important Considerations
WebThings Gateway is designed to run on local hardware with direct access to radio adapters (Zigbee/Z-Wave USB dongles). Cloud deployment has limitations:
- Zigbee/Z-Wave: Requires physical USB adapters connected to the host
- Wi-Fi Devices: Can work if devices are accessible over the network
- Local Network Access: Some device discovery requires local network presence
For full smart home functionality, consider running WebThings Gateway on local hardware. This cloud deployment guide focuses on Wi-Fi device management and remote monitoring scenarios.
Repository Structure
Create a GitHub repository with the following structure:
webthings-deploy/├── Dockerfile└── .dockerignoreDockerfile
Create a Dockerfile in your repository:
FROM webthingsio/gateway:latest
# Web interface portEXPOSE 8080EXPOSE 4443
# The base image handles the entrypointEnvironment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
TZ | No | UTC | Timezone |
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 **8080**
- Add environment variables: - `TZ`: Your timezone
- Attach persistent volumes: - Mount path: `/home/node/.webthings` - Recommended size: 5 GB - Purpose: Configuration, add-ons, and device data
- Click **Deploy** and wait for the build to complete.
- Access your WebThings Gateway at the provided URL and complete the setup wizard.
Post-Deployment Configuration
After deployment:
- Complete the initial setup wizard
- Create your admin account
- Install add-ons for your device types
- Add and configure devices
- Create automation rules
Troubleshooting
Devices Not Discovered
Wi-Fi devices must be accessible from the Klutch.sh network. Devices using local discovery protocols may not be found in cloud deployments.
Add-Ons Not Installing
Check internet connectivity and verify sufficient storage space.