Quickstart guide
This guide will help you deploy Joystick IoT locally using Docker Compose. You’ll have a fully functional IoT platform running in minutes.Prerequisites
Before you begin, ensure you have the following installed:- Docker: Version 20.10 or later
- Docker Compose: Version 2.0 or later
- Linux/amd64 platform: Or Docker Desktop with amd64 emulation enabled
All Joystick services run on
linux/amd64. If you’re using an ARM-based Mac (M1/M2/M3), Docker Desktop will automatically handle platform emulation.Installation
Review the Docker Compose configuration
The
docker-compose.yml file orchestrates all services. Key services include:- Traefik (port 80): Reverse proxy and load balancer
- PocketBase (port 8090): Database and authentication
- MediaMTX (network_mode: host): Video streaming server
- App: Web interface (via Traefik at
/) - Joystick: Device control API (via Traefik at
/joystick) - Panel, Baker, Studio, Switcher, Whisper: Supporting microservices
MediaMTX uses
network_mode: host for optimal streaming performance. It will use ports 8554 (RTSP), 8888 (HLS), and 9997 (API).Start the platform
Launch all services with Docker Compose:This will pull the latest images from GitHub Container Registry and start all services in detached mode.
First-time startup may take a few minutes to download all container images.
Verify services are running
Check that all services are healthy:You should see all services in the
running state. PocketBase includes a health check that must pass before dependent services start.First login
After deployment, you’ll need to create an admin account and authenticate.Access PocketBase admin
Navigate to the PocketBase admin interface:Create an admin account when prompted.
Create a user account
In the PocketBase admin interface:
- Navigate to Collections > users
- Click New record
- Fill in the user details (email and password)
- Save the record
Configure permissions
Set up user permissions in the permissions collection:
- Navigate to Collections > permissions
- Create permission records for your user
- Grant access to features like
device-control,device-gps,device-battery, etc.
See the Authentication guide for detailed information about the permission system.
Test the API
Verify that the Joystick API is working correctly.Health check
Test the public health endpoint (no authentication required):Authenticated request
Get a JWT token from PocketBase:Using the development API key
For testing, you can use the development API key:Configure your first device
Add a device
In the Joystick web interface:
- Navigate to Devices
- Click Add Device
- Enter device details (name, host, phone number)
- Configure available actions
- Save the device
Set up device permissions
Grant yourself access to the device:
- Edit the device in PocketBase admin
- Add your user ID to the
allowfield (array of user IDs) - Save the changes
Enable automatic slot switching
For devices with dual connection slots, enable automatic failover:Configure secondary slot
In the device settings:
- Enable Configure Secondary Connection Slot
- Enter secondary slot host and phone number
- Save the configuration
Enable auto-switching
Check the Enable automatic slot switching option. The Switcher service will now:
- Run health checks every 30 seconds (default)
- Automatically failover to the secondary slot after 2 consecutive failures
- Switch back when the primary slot recovers
View logs
Monitor service logs using Docker Compose:Dozzle provides a web interface for viewing container logs in real-time at
http://localhost:8084.Environment variables
Customize your deployment by setting environment variables:| Variable | Default | Description |
|---|---|---|
HOST | localhost | Hostname for Traefik routing |
JOYSTICK_API_KEY | dev-api-key-12345 | API key for service authentication |
SLOT_HEALTH_CHECK_INTERVAL | 30 | Health check interval in seconds |
Next steps
Architecture overview
Learn how the microservices work together
Authentication
Understand JWT tokens and permissions
Device control
Master device actions and sensor monitoring
Slot switching
Configure automatic failover systems
Troubleshooting
Services not starting
- Verify Docker and Docker Compose are installed correctly
- Check for port conflicts (especially 80, 8090, and host-mode ports)
- Review logs:
docker-compose logs
Cannot access web interface
- Ensure Traefik is running:
docker-compose ps traefik - Check Traefik dashboard:
http://localhost:8080 - Verify HOST environment variable matches your access URL
PocketBase health check failing
- Wait a few moments for PocketBase to initialize
- Check PocketBase logs:
docker-compose logs pocketbase - Verify the
pb_datavolume is writable
Authentication errors
- Ensure you’ve created a user in PocketBase
- Verify JWT token is not expired
- Check user permissions in the permissions collection