Skip to content

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

Creating the Dockerfile

FROM ghcr.io/libretime/libretime:latest
# Environment configuration
ENV 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 directories
RUN mkdir -p /srv/libretime/storage
# Expose ports
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Environment Variables Reference

VariableRequiredDefaultDescription
PUBLIC_URLYes-Public URL for LibreTime
DB_HOSTYespostgresPostgreSQL hostname
DB_NAMENolibretimeDatabase name
DB_USERYes-Database username
DB_PASSWORDYes-Database password
RABBITMQ_HOSTYesrabbitmqRabbitMQ hostname
RABBITMQ_USERNolibretimeRabbitMQ username
RABBITMQ_PASSWORDYes-RabbitMQ password
ICECAST_HOSTNo-Icecast server hostname
ICECAST_PORTNo8000Icecast server port
ICECAST_PASSWORDNo-Icecast source password

Deploying LibreTime on Klutch.sh

    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

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial LibreTime deployment configuration"
    git remote add origin https://github.com/yourusername/libretime-deploy.git
    git push -u origin main

    Create 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:

    • Select HTTP as the traffic type
    • Set the internal port to 8080

    Set Environment Variables

    Add the following:

    VariableValue
    PUBLIC_URLhttps://your-app.klutch.sh
    DB_HOSTYour PostgreSQL hostname
    DB_NAMElibretime
    DB_USERYour database username
    DB_PASSWORDYour database password
    RABBITMQ_HOSTYour RabbitMQ hostname
    RABBITMQ_PASSWORDYour RabbitMQ password

    Attach Persistent Volumes

    Mount PathRecommended SizePurpose
    /srv/libretime/storage100+ GBAudio 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:

  1. Log in with default credentials (admin/admin)
  2. Change the admin password immediately
  3. Configure station name and details
  4. Set timezone and locale

Stream Configuration

Set up audio output:

  1. Navigate to Settings > Streams
  2. Configure Icecast or Shoutcast connection
  3. Set stream format and bitrate
  4. Test the stream connection

Uploading Media

Build your library:

  1. Navigate to Add Media
  2. Upload audio files
  3. Edit metadata as needed
  4. Organize into folders or genres

Creating Shows

Set up programming:

  1. Navigate to Calendar
  2. Create recurring shows
  3. Assign DJs to shows
  4. Set up autoplaylist fills

Working with LibreTime

Scheduling Content

Plan your programming:

  1. Create shows on the calendar
  2. Add content to show schedules
  3. Use smart blocks for automated fills
  4. Review upcoming schedule

Live Broadcasting

Enable live DJs:

  1. Configure source connection settings
  2. Provide DJs with connection information
  3. DJs connect with broadcasting software
  4. LibreTime handles transitions automatically

Podcasting

Generate podcast feeds:

  1. Configure podcast settings
  2. Assign shows to podcast feeds
  3. Distribute RSS feed URLs
  4. 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

  1. Back up PostgreSQL database regularly
  2. Back up the media storage directory
  3. Export show schedules periodically
  4. 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

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.