Deploying LibreTime
Introduction
LibreTime is an open-source radio broadcast automation system that enables radio stations to schedule, manage, and stream programming professionally. Forked from Airtime, LibreTime has evolved into a comprehensive solution for community radio stations, college radio, and anyone wanting to run their own internet radio station.
The application provides everything needed for radio automation: media library management, show scheduling, playlist creation, live broadcasting integration, and streaming to multiple outputs including Icecast and Shoutcast servers.
Key highlights of LibreTime:
- Show Scheduling: Plan programming with a visual calendar interface
- Media Library: Organize music, jingles, and spoken content
- Playlist Management: Create and manage playlists for shows
- Smart Blocks: Auto-generate playlists based on criteria
- Live Broadcasting: Support for live DJs with source connections
- Multi-Stream Output: Stream to multiple servers simultaneously
- Crossfading: Professional audio transitions between tracks
- Metadata Management: Track and display now-playing information
- User Roles: Different access levels for DJs, program managers, and admins
- API Access: Integrate with external systems and websites
- Podcast Support: Generate and manage podcast feeds
This guide walks through deploying LibreTime on Klutch.sh using Docker.
Why Deploy LibreTime on Klutch.sh
Deploying LibreTime on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh builds LibreTime from your Dockerfile. Push to GitHub, and your radio station deploys automatically.
Persistent Storage: Attach persistent volumes for your media library, database, and configuration.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for your web interface.
GitHub Integration: Connect your repository for automatic redeployments.
Scalable Resources: Allocate resources based on your streaming requirements.
Environment Variable Management: Securely store database credentials and API keys.
Custom Domains: Assign a professional domain for your radio station.
Always-On Availability: Your radio stream remains available 24/7.
Prerequisites
Before deploying LibreTime on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker and containerization concepts
- A PostgreSQL database
- An Icecast or Shoutcast streaming server (can be separate or included)
- Audio content for your radio programming
- (Optional) A custom domain for your radio station
Understanding LibreTime Architecture
LibreTime consists of several components:
Web Interface: PHP-based interface for scheduling and management.
Liquidsoap: Audio playout engine handling stream generation.
PostgreSQL: Database storing schedules, playlists, and metadata.
RabbitMQ: Message queue for component communication.
Analyzer: Processes uploaded audio files for metadata and duration.
Playout: Coordinates scheduled playback with Liquidsoap.
API: RESTful interface for external integrations.
Preparing Your Repository
Repository Structure
libretime-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile
FROM ghcr.io/libretime/libretime:latest
# Environment configurationENV LIBRETIME_PUBLIC_URL=${PUBLIC_URL:-http://localhost}ENV LIBRETIME_DATABASE_HOST=${DB_HOST:-postgres}ENV LIBRETIME_DATABASE_PORT=${DB_PORT:-5432}ENV LIBRETIME_DATABASE_NAME=${DB_NAME:-libretime}ENV LIBRETIME_DATABASE_USER=${DB_USER:-libretime}ENV LIBRETIME_DATABASE_PASSWORD=${DB_PASSWORD}ENV LIBRETIME_RABBITMQ_HOST=${RABBITMQ_HOST:-rabbitmq}ENV LIBRETIME_RABBITMQ_USER=${RABBITMQ_USER:-libretime}ENV LIBRETIME_RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
# Create storage directoriesRUN mkdir -p /srv/libretime/storage
# Expose portsEXPOSE 8080
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:8080/ || exit 1Creating the .dockerignore File
.git.github*.mdLICENSE.gitignore*.log.DS_Store.env.env.localEnvironment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
PUBLIC_URL | Yes | - | Public URL for LibreTime |
DB_HOST | Yes | postgres | PostgreSQL hostname |
DB_NAME | No | libretime | Database name |
DB_USER | Yes | - | Database username |
DB_PASSWORD | Yes | - | Database password |
RABBITMQ_HOST | Yes | rabbitmq | RabbitMQ hostname |
RABBITMQ_USER | No | libretime | RabbitMQ username |
RABBITMQ_PASSWORD | Yes | - | RabbitMQ password |
ICECAST_HOST | No | - | Icecast server hostname |
ICECAST_PORT | No | 8000 | Icecast server port |
ICECAST_PASSWORD | No | - | Icecast source password |
Deploying LibreTime on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8080
Set Up PostgreSQL Database
Deploy PostgreSQL and create a database for LibreTime.
Set Up RabbitMQ
Deploy RabbitMQ for inter-component messaging.
Set Up Icecast (Optional)
Deploy an Icecast server for audio streaming, or use an external streaming service.
Push Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial LibreTime deployment configuration"git remote add origin https://github.com/yourusername/libretime-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “libretime” or “radio”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your LibreTime repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following:
| Variable | Value |
|---|---|
PUBLIC_URL | https://your-app.klutch.sh |
DB_HOST | Your PostgreSQL hostname |
DB_NAME | libretime |
DB_USER | Your database username |
DB_PASSWORD | Your database password |
RABBITMQ_HOST | Your RabbitMQ hostname |
RABBITMQ_PASSWORD | Your RabbitMQ password |
Attach Persistent Volumes
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/srv/libretime/storage | 100+ GB | Audio files and media library |
Deploy Your Application
Click Deploy to start the build process.
Complete Initial Setup
Access LibreTime and complete the setup wizard to configure your station.
Initial Configuration
Station Setup
Configure your radio station:
- Log in with default credentials (admin/admin)
- Change the admin password immediately
- Configure station name and details
- Set timezone and locale
Stream Configuration
Set up audio output:
- Navigate to Settings > Streams
- Configure Icecast or Shoutcast connection
- Set stream format and bitrate
- Test the stream connection
Uploading Media
Build your library:
- Navigate to Add Media
- Upload audio files
- Edit metadata as needed
- Organize into folders or genres
Creating Shows
Set up programming:
- Navigate to Calendar
- Create recurring shows
- Assign DJs to shows
- Set up autoplaylist fills
Working with LibreTime
Scheduling Content
Plan your programming:
- Create shows on the calendar
- Add content to show schedules
- Use smart blocks for automated fills
- Review upcoming schedule
Live Broadcasting
Enable live DJs:
- Configure source connection settings
- Provide DJs with connection information
- DJs connect with broadcasting software
- LibreTime handles transitions automatically
Podcasting
Generate podcast feeds:
- Configure podcast settings
- Assign shows to podcast feeds
- Distribute RSS feed URLs
- Episodes generate automatically from broadcasts
Production Best Practices
Audio Quality
- Use consistent audio formats (MP3 320kbps or FLAC)
- Normalize audio levels before upload
- Use appropriate crossfade settings
- Monitor stream quality regularly
Security Recommendations
- Change default passwords immediately
- Use unique passwords for each component
- Restrict access to admin functions
- Keep LibreTime updated
Backup Strategy
- Back up PostgreSQL database regularly
- Back up the media storage directory
- Export show schedules periodically
- Document stream configurations
Troubleshooting
No Audio Output
- Check Icecast connection settings
- Verify Liquidsoap is running
- Review stream logs
- Test with a local listener
Scheduling Issues
- Verify timezone settings
- Check show conflicts
- Review playout logs
- Ensure media files are valid
Upload Failures
- Check file format support
- Verify storage space available
- Review analyzer logs
- Check file permissions
Additional Resources
- Official LibreTime Website
- LibreTime Documentation
- LibreTime GitHub Repository
- LibreTime Forum
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying LibreTime on Klutch.sh enables you to run a professional radio station with full automation capabilities. Whether you’re operating a community radio station, college radio, or personal internet radio project, LibreTime provides the tools you need.
With automatic deployments, persistent storage for your media library, and secure HTTPS access, you can focus on creating great radio content.