Deploying FreePBX
Introduction
FreePBX is the world’s most popular open-source graphical user interface for managing Asterisk PBX systems. Created in 2004, FreePBX transforms the powerful but complex Asterisk telephony engine into an accessible, user-friendly platform that anyone can use to build and manage a complete business phone system without needing deep technical knowledge of VoIP protocols or Asterisk configuration.
At its core, FreePBX provides a comprehensive web-based interface that simplifies every aspect of PBX administration—from creating extensions and configuring voicemail to setting up call routing, IVR menus, ring groups, and advanced features like call recording, time conditions, and feature codes. What would typically require editing dozens of Asterisk configuration files by hand becomes a matter of clicking through intuitive forms and dialogs.
FreePBX includes a powerful module architecture with over 100 commercial and open-source modules available, allowing you to extend functionality with features like CRM integration, billing systems, call center tools, advanced reporting, SMS messaging, and more. It handles everything from small office deployments with a handful of extensions to large enterprise installations supporting thousands of users across multiple locations.
Deploying FreePBX on Klutch.sh combines the power of a professional PBX system with the convenience of managed cloud infrastructure. You get automatic HTTPS for secure web administration, persistent storage for recordings and voicemail, reliable networking for SIP traffic, and the ability to scale resources as your phone system grows—all without managing physical servers or complex networking configurations.
This guide walks you through deploying FreePBX on Klutch.sh using Docker, configuring the database backend, setting up persistent volumes for critical data, connecting to SIP trunks, and implementing production-ready best practices for security, backup, and monitoring.
Why Deploy FreePBX on Klutch.sh?
- Simplified Management: Web-based PBX administration without command-line complexity
- Automatic HTTPS: Secure web interface with built-in SSL certificates
- Persistent Storage: Reliable volume storage for recordings, voicemail, and backups
- Scalable Infrastructure: Easily adjust resources as your phone system grows
- Professional Reliability: Enterprise-grade uptime for mission-critical communications
- Easy Updates: Deploy new FreePBX versions without server maintenance
- Custom Domains: Use your own domain for professional branding
- Integrated Database: Simple MariaDB deployment for FreePBX backend
- GitHub Integration: Version-controlled deployment and configuration management
- Cost-Effective: No physical hardware or dedicated server costs
Prerequisites
Before you begin, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your deployment
- Basic understanding of PBX systems and VoIP concepts
- A SIP trunk provider account (optional, for external calling)
Technical Requirements:
FreePBX requires substantial resources due to Asterisk and web services:
- Minimum 2GB RAM (4GB recommended for production)
- At least 10GB persistent storage (20GB+ for call recordings)
- MariaDB or MySQL database (can be deployed separately on Klutch.sh)
- Stable internet connection with proper firewall configuration
Dependencies:
FreePBX requires a database. You’ll need to deploy either:
Understanding FreePBX Architecture
FreePBX is built as a comprehensive web application that sits on top of Asterisk:
Core Components:
- Asterisk PBX: The underlying telephony engine (see our Asterisk deployment guide)
- FreePBX Framework: PHP-based web interface for configuration management
- Apache Web Server: Hosts the FreePBX web interface
- MariaDB/MySQL: Stores all FreePBX configuration and CDR data
- Node.js: Powers the User Control Panel (UCP) interface
- Asterisk Manager Interface (AMI): Communication bridge between FreePBX and Asterisk
Key Features:
- Extension management with BLF (Busy Lamp Field) support
- Inbound and outbound call routing
- Interactive Voice Response (IVR) system
- Ring groups and call queues
- Voicemail with email notification
- Time conditions for after-hours routing
- Call recording with on-demand capabilities
- Conference bridges
- Feature codes for quick access
- Call Detail Records (CDR) reporting
- Module marketplace for extensions
Data Flow:
When you make configuration changes in FreePBX’s web interface, the framework:
- Updates the MySQL/MariaDB database
- Generates appropriate Asterisk configuration files
- Reloads Asterisk via AMI to apply changes
- Provides real-time feedback through the web interface
This architecture allows for powerful PBX functionality while maintaining ease of use through the graphical interface.
Preparing Your Repository
Step 1: Create Project Directory
Create a new directory for your FreePBX deployment:
mkdir freepbx-deploycd freepbx-deployStep 2: Create Dockerfile
FreePBX requires a complete environment with Asterisk, Apache, and PHP. Create a Dockerfile:
FROM tiredofit/freepbx:16
# FreePBX 16 includes:# - Asterisk 18# - PHP 7.4# - Apache 2.4# - FreePBX Framework# - All core modules
# Set timezoneENV TIMEZONE=America/New_York
# Database configuration (set via environment variables in Klutch.sh)ENV DB_EMBEDDED=false
# Enable FreePBX servicesENV ENABLE_FAIL2BAN=true \ ENABLE_CERTIFICATES=true \ ENABLE_CRON=true \ ENABLE_SMTP=true
# RTP port range for mediaENV RTP_START=10000 \ RTP_FINISH=10200
# Set admin email for notificationsENV ADMIN_EMAIL=admin@example.com
# Expose ports# 80: HTTP (web interface)# 443: HTTPS (web interface)# 5060: SIP (UDP)# 5061: SIP TLS# 10000-10200: RTP mediaEXPOSE 80 443 5060/udp 5060/tcp 5061/tcp 10000-10200/udp
# Volume mounts for persistent dataVOLUME ["/data", "/var/log", "/var/lib/asterisk/sounds", "/var/spool/asterisk"]
# Health checkHEALTHCHECK --interval=60s --timeout=10s --start-period=120s \ CMD curl -f http://localhost/admin/config.php || exit 1
# Start FreePBX (inherited from base image)Alternative: Minimal Custom Build
For more control, you can build from scratch:
FROM debian:bullseye
# Install system dependenciesRUN apt-get update && \ apt-get install -y \ apache2 \ mariadb-client \ php7.4 \ php7.4-cli \ php7.4-mysql \ php7.4-curl \ php7.4-gd \ php7.4-mbstring \ php7.4-xml \ sox \ mpg123 \ sqlite3 \ curl \ wget \ gnupg2 \ git \ unixodbc \ && apt-get clean
# Install AsteriskRUN cd /usr/src && \ wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz && \ tar -xzf asterisk-18-current.tar.gz && \ cd asterisk-18* && \ ./configure --with-jansson-bundled && \ make && \ make install && \ make samples && \ make config && \ ldconfig
# Install FreePBXRUN cd /usr/src && \ wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-16.0-latest.tgz && \ tar -xzf freepbx-16.0-latest.tgz && \ cd freepbx && \ ./install -n
# Configure Apache for FreePBXRUN a2enmod rewrite && \ sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# Create necessary directoriesRUN mkdir -p /var/www/html/admin \ /var/log/asterisk \ /var/log/httpd \ /var/spool/asterisk
EXPOSE 80 5060
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]Step 3: Create Environment Configuration
Create a .env.example file for documentation:
# Database ConfigurationDB_HOST=mariadb-app.klutch.shDB_PORT=8000DB_NAME=freepbxDB_USER=freepbxuserDB_PASSWORD=your-secure-password
# FreePBX ConfigurationFREEPBX_ADMIN_USER=adminFREEPBX_ADMIN_PASSWORD=your-admin-passwordADMIN_EMAIL=admin@yourdomain.com
# TimezoneTIMEZONE=America/New_York
# SMTP Configuration (for email notifications)SMTP_HOST=smtp.gmail.comSMTP_PORT=587SMTP_USER=your-email@gmail.comSMTP_PASSWORD=your-smtp-passwordSMTP_FROM=noreply@yourdomain.com
# SIP ConfigurationSIP_BIND_PORT=5060RTP_START=10000RTP_FINISH=10200
# SecurityENABLE_FAIL2BAN=trueFAIL2BAN_MAXRETRY=5FAIL2BAN_BANTIME=600Step 4: Create .gitignore
Create a .gitignore file to exclude sensitive data:
# Environment files.env.env.local.env.production
# FreePBX data/data//recordings//backups/
# Logs*.log/var/log/
# System files.DS_StoreThumbs.db
# Asterisk/etc/asterisk/*.confStep 5: Create README.md
Document your deployment:
# FreePBX on Klutch.sh
Open-source PBX system with web-based management interface.
## Quick Start
1. Deploy MariaDB database on Klutch.sh2. Push this repository to GitHub3. Deploy FreePBX on Klutch.sh4. Access web interface at your assigned URL5. Complete initial setup wizard
## Features
- Extension Management- Call Routing & IVR- Voicemail- Call Recording- Ring Groups- Time Conditions- Conference Bridges- And more...
## Configuration
See Klutch.sh dashboard for environment variables and volume configuration.
## Documentation
- [FreePBX Wiki](https://wiki.freepbx.org/)- [Asterisk Documentation](https://www.asterisk.org/community/documentation/)Step 6: Push to GitHub
Initialize git and push your repository:
git initgit add Dockerfile .env.example .gitignore README.mdgit commit -m "Initial FreePBX deployment setup"git branch -M maingit remote add origin https://github.com/your-username/freepbx-deploy.gitgit push -u origin mainDeploying the Database
FreePBX requires a MariaDB or MySQL database. Deploy the database first before deploying FreePBX.
Option 1: Deploy MariaDB on Klutch.sh (Recommended)
-
Follow our MariaDB deployment guide to set up a database server
-
Configure the MariaDB deployment with:
- TCP Traffic on port 8000
- Persistent Volume:
/var/lib/mysqlwith at least 5GB - Environment Variables:
MYSQL_ROOT_PASSWORD: Strong root passwordMYSQL_DATABASE:freepbxMYSQL_USER:freepbxuserMYSQL_PASSWORD: Strong user password
-
Note the connection details:
- Host:
your-mariadb-app.klutch.sh - Port:
8000 - Database:
freepbx - Username:
freepbxuser - Password: Your configured password
- Host:
Option 2: Use External Managed Database
You can also use external managed database services:
Deploying FreePBX on Klutch.sh
Step 1: Create New App
-
Log in to the Klutch.sh dashboard
-
Create a new project or select an existing one
-
Create a new app and configure it:
- Repository: Select your FreePBX GitHub repository
- Branch: Choose the branch to deploy (e.g.,
mainorproduction) - Traffic Type: Select HTTP (FreePBX web interface runs on HTTP/HTTPS)
- Internal Port: Set to 80 (FreePBX’s Apache server listens on port 80)
Step 2: Configure Persistent Volumes
FreePBX requires persistent storage for recordings, voicemail, configurations, and backups.
-
In your app settings, navigate to the Volumes section
-
Add a volume for FreePBX data:
- Mount Path:
/data - Size: 10GB minimum (20GB recommended for call recordings)
- Mount Path:
-
Add a volume for Asterisk spool (voicemail, recordings):
- Mount Path:
/var/spool/asterisk - Size: 5GB (scale based on voicemail and recording needs)
- Mount Path:
-
Add a volume for Asterisk sounds (optional):
- Mount Path:
/var/lib/asterisk/sounds - Size: 2GB
- Mount Path:
-
(Optional) Add a volume for logs:
- Mount Path:
/var/log - Size: 2GB
- Mount Path:
Step 3: Configure Environment Variables
Set essential environment variables for your FreePBX deployment:
-
In your app settings, navigate to the Environment Variables section
-
Add the following variables (mark sensitive values as secrets):
Database Configuration:
Terminal window DB_HOST=your-mariadb-app.klutch.shDB_PORT=8000DB_NAME=freepbxDB_USER=freepbxuserDB_PASSWORD=your-database-passwordFreePBX Administration:
Terminal window FREEPBX_ADMIN_USER=adminFREEPBX_ADMIN_PASSWORD=your-secure-admin-passwordADMIN_EMAIL=admin@yourdomain.comSystem Configuration:
Terminal window TIMEZONE=America/New_YorkDB_EMBEDDED=falseRTP Media Ports:
Terminal window RTP_START=10000RTP_FINISH=10200Security Settings:
Terminal window ENABLE_FAIL2BAN=trueFAIL2BAN_MAXRETRY=5SMTP Configuration (for notifications):
Terminal window SMTP_HOST=smtp.gmail.comSMTP_PORT=587SMTP_USER=your-email@gmail.comSMTP_PASSWORD=your-smtp-password
Step 4: Deploy Your Application
-
Click Deploy to start the build process
-
Klutch.sh will:
- Pull your GitHub repository
- Detect the Dockerfile automatically
- Build the FreePBX container image
- Deploy it with your configured volumes and environment variables
-
Monitor the build logs for any errors
-
Once deployed, your FreePBX will be available at
https://example-app.klutch.sh -
Initial deployment may take 5-10 minutes as FreePBX initializes the database
Initial Setup and Configuration
After deployment, complete the FreePBX initial setup:
Step 1: Access Web Interface
-
Navigate to
https://example-app.klutch.shin your browser -
You should see the FreePBX welcome screen
-
If prompted for activation, you can skip commercial module activation for open-source use
Step 2: Complete Setup Wizard
-
Create your admin account (if not set via environment variables):
- Username:
admin - Password: Strong password (minimum 12 characters)
- Email: Your email for notifications
- Username:
-
Configure initial settings:
- Time Zone: Select your time zone
- Language: Choose your preferred language
- Number Format: Select your region’s format
-
Click through the setup wizard to completion
Step 3: Verify Database Connection
-
Navigate to Admin → System Admin → Database
-
Verify connection to your MariaDB instance
-
Ensure all database tables are created successfully
Step 4: Configure Asterisk Settings
-
Navigate to Settings → Asterisk SIP Settings
-
Configure SIP settings:
- Bind Address:
0.0.0.0(listen on all interfaces) - External Address: Your Klutch.sh app URL
- Local Networks:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
- Bind Address:
-
Configure RTP settings:
- RTP Start:
10000 - RTP End:
10200
- RTP Start:
-
Click Submit and Apply Config
Creating Your First Extension
Set up a basic SIP extension to test your FreePBX installation:
Create SIP Extension
-
Navigate to Applications → Extensions
-
Click Add Extension → Add New Chan_SIP Extension
-
Configure the extension:
- User Extension:
1000(or your preferred number) - Display Name:
Test User - Secret: Generate a strong password
- Voicemail: Enable voicemail
- Email: User’s email for voicemail notifications
- User Extension:
-
Under Advanced tab:
- Context:
from-internal - Host:
dynamic - NAT:
yes
- Context:
-
Click Submit and Apply Config
Test Extension with Softphone
-
Download a SIP softphone:
-
Configure the softphone:
- Server/Domain:
example-app.klutch.sh - Username:
1000 - Password: Extension secret
- Port:
5060
- Server/Domain:
-
The extension should register successfully
-
Create a second extension (e.g.,
1001) and test calling between extensions
Configuring Inbound Routes
Set up how incoming calls are handled:
Basic Inbound Route
-
Navigate to Connectivity → Inbound Routes
-
Click Add Inbound Route
-
Configure the route:
- Description:
Main Line - DID Number: Your phone number from SIP trunk (or leave blank for catch-all)
- Caller ID: Leave blank to match all callers
- Description:
-
Set destination:
- Set Destination: Choose destination type (Extension, Ring Group, IVR, etc.)
- Select specific destination
-
Click Submit and Apply Config
Create IVR (Auto Attendant)
-
Navigate to Applications → IVR
-
Click Add IVR
-
Configure the IVR:
- Name:
Main Menu - Announcement: Record or upload greeting
- Timeout:
10seconds - Invalid Retry Recording: Select recording
- Name:
-
Add IVR entries:
- Option 1: Sales (extension or ring group)
- Option 2: Support (extension or ring group)
- Option 0: Operator (specific extension)
-
Click Submit and Apply Config
-
Update inbound route to point to this IVR
Connecting to SIP Trunk Provider
Connect FreePBX to a SIP trunk for external calling:
Configure Trunk
-
Navigate to Connectivity → Trunks
-
Click Add Trunk → Add SIP (chan_pjsip) Trunk
-
Configure trunk details:
- Trunk Name:
MyProvider - Outbound CallerID: Your main number
- Trunk Name:
-
In pjsip Settings tab:
- Username: Provided by trunk provider
- Secret: Provided by trunk provider
- SIP Server: Trunk provider’s server address
- SIP Server Port: Usually
5060 - Context:
from-pstn
-
In Advanced tab:
- Registration: Enable if required by provider
- DTMF Mode:
RFC 4733(recommended) - Codecs: Select
ulaw,alaw,g729as supported
-
Click Submit and Apply Config
Create Outbound Route
-
Navigate to Connectivity → Outbound Routes
-
Click Add Outbound Route
-
Configure the route:
- Route Name:
US/Canada - Route CID: Your caller ID number
- Route Password: Leave blank
- Override Extension: No
- Route Name:
-
Add dial patterns:
- Dial Pattern:
NXXNXXXXXX(10-digit US/Canada) - Prefix: Leave blank
- Prepend:
1(if required by trunk)
- Dial Pattern:
-
Select trunk:
- Move your trunk to Trunk Sequence list
-
Click Submit and Apply Config
Setting Up Voicemail
Configure voicemail for extensions:
Global Voicemail Settings
-
Navigate to Settings → Voicemail Admin
-
Configure general settings:
- Email Subject:
New voicemail from [VM_CALLERID] - Email Body: Customize message template
- Format: Choose
WAVorMP3for attachments - Delete After Email: Choose based on preference
- Email Subject:
-
Configure advanced options:
- Max Messages:
100(or preferred limit) - Max Message Time:
300seconds (5 minutes) - Min Message Time:
2seconds
- Max Messages:
-
Click Submit and Apply Config
Configure Extension Voicemail
-
Navigate to Applications → Extensions
-
Select an extension to edit
-
In Voicemail section:
- Status:
Enabled - Voicemail Password: Set 4-digit PIN
- Email Address: User’s email
- Pager Email: Optional
- Email Attachment:
Yesto include recording - Play CID:
Yesto hear caller info - Play Envelope:
Yesto hear date/time - Delete Vmail:
Yesto delete after emailing
- Status:
-
Click Submit and Apply Config
Call Recording Configuration
Set up call recording for quality assurance:
Enable Call Recording
-
Navigate to Admin → Call Recording
-
Configure recording settings:
- Recording Format:
WAV(best quality) orMP3(smaller size) - Recording Directory:
/var/spool/asterisk/monitor - Custom Format: Choose filename format
- Recording Format:
-
Enable recording methods:
- On-Demand: Allow users to start/stop recording with feature code
- Automatic: Record all calls automatically
- On-Demand with Notification: Announce recording is active
Configure Per-Extension Recording
-
Navigate to Applications → Extensions
-
Select extension to edit
-
In Recording Options:
- Inbound External Calls: Choose recording mode
- Outbound External Calls: Choose recording mode
- Internal Calls: Choose recording mode
- On Demand Recording: Enable for user control
-
Feature codes for recording:
- Start Recording:
*1 - Stop Recording:
*0
- Start Recording:
-
Click Submit and Apply Config
Ring Groups and Call Queues
Create Ring Group
Ring groups allow multiple extensions to ring simultaneously:
-
Navigate to Applications → Ring Groups
-
Click Add Ring Group
-
Configure the group:
- Group Number:
2000 - Group Description:
Sales Team - Ring Strategy: Choose strategy:
ringall: Ring all extensions simultaneouslyhunt: Ring in order until someone answersmemoryhunt: Like hunt, but remembers last answered
- Ring Time:
20seconds per extension - Extension List: Add extensions (e.g.,
1000,1001,1002)
- Group Number:
-
Configure destination:
- Destination if No Answer: Voicemail, IVR, or other destination
-
Click Submit and Apply Config
Create Call Queue
Call queues are for high-volume call centers:
-
Navigate to Applications → Queues
-
Click Add Queue
-
Configure the queue:
- Queue Number:
3000 - Queue Name:
Support Queue - Queue Password: Optional password to join queue
- CID Name Prefix:
Q-to identify queue calls - Max Wait Time:
300seconds before routing elsewhere - Max Callers:
25maximum callers in queue
- Queue Number:
-
Add static agents:
- Select extensions to add as queue agents
- Agents will automatically receive queue calls
-
Configure options:
- Agent Announcement: Announce to agent before connecting
- Join Announcement: Message for caller entering queue
- Music on Hold: Select hold music category
- Strategy:
ringall,leastrecent,fewestcalls, etc.
-
Set destination if queue full or timeout
-
Click Submit and Apply Config
Time Conditions
Route calls differently based on time of day:
Create Time Condition
-
Navigate to Applications → Time Conditions
-
Click Add Time Condition
-
Configure the condition:
- Time Condition Name:
Business Hours - Time Group: Create new time group
- Time Condition Name:
-
Create time group:
- Group Name:
Business Hours - Time to Start:
08:00 - Time to Finish:
17:00 - Week Days: Monday through Friday
- Month Days: All
- Group Name:
-
Set destinations:
- Matching: Route to receptionist or IVR
- Not Matching: Route to voicemail or after-hours message
-
Click Submit and Apply Config
-
Update inbound routes to use this time condition
Custom Domain Configuration
For production use, configure a custom domain:
Step 1: Configure Domain in Klutch.sh
-
In the Klutch.sh dashboard, navigate to your app settings
-
Go to the Domains section
-
Add your custom domain (e.g.,
pbx.yourdomain.com) -
Klutch.sh will provide DNS records to configure
Step 2: Update DNS Records
-
Log in to your domain registrar
-
Add the DNS records provided by Klutch.sh:
- CNAME record pointing to your Klutch.sh app
- Wait for DNS propagation (up to 48 hours)
-
Klutch.sh will automatically provision SSL certificates
Step 3: Update FreePBX Configuration
-
Access your FreePBX admin panel
-
Navigate to Settings → Asterisk SIP Settings
-
Update the External Address to your custom domain
-
Navigate to Admin → System Admin → Port Management
-
Update any references to use your custom domain
-
Click Apply Config to activate changes
Security Best Practices
Strong Authentication
-
Use Strong Passwords:
- Admin password: Minimum 16 characters
- Extension secrets: Minimum 12 characters, alphanumeric + symbols
- Database password: Minimum 16 characters
- Use a password manager
-
Enable Two-Factor Authentication:
- Navigate to Admin → System Admin → User Management
- Enable 2FA for admin accounts
- Use authenticator app like Google Authenticator or Authy
-
Regular Password Rotation:
- Change admin passwords quarterly
- Rotate extension secrets annually
- Update service passwords semi-annually
Network Security
-
Configure Firewall:
- Navigate to Admin → System Admin → Firewall
- Enable responsive firewall
- Add trusted IP addresses
- Set fail2ban rules for SIP authentication failures
-
Fail2Ban Configuration:
- Navigate to Admin → Intrusion Detection
- Enable Fail2Ban protection
- Set ban time:
600seconds (10 minutes) - Set max retries:
5 - Monitor banned IPs regularly
-
Enable TLS for SIP:
- Navigate to Settings → Asterisk SIP Settings
- Enable TLS on port 5061
- Configure certificates
- Update extensions to use TLS transport
Extension Security
-
Permit/Deny Settings:
- Navigate to Applications → Extensions
- For each extension, under Advanced:
- Set Permit to specific IP ranges
- Or set Deny to
0.0.0.0/0.0.0.0and Permit to trusted IPs
-
Disable Unused Extensions:
- Regularly audit extension list
- Disable or delete unused extensions
- Monitor extension registration status
-
Feature Code Restrictions:
- Navigate to Admin → Feature Codes
- Restrict sensitive features to specific extensions
- Disable unnecessary feature codes
Monitoring and Alerts
-
Enable System Notifications:
- Navigate to Admin → System Admin → Notifications
- Enable email alerts for:
- System updates
- Security events
- Service failures
- Disk space warnings
-
CDR Monitoring:
- Navigate to Reports → CDR Reports
- Review call patterns regularly
- Look for unusual call destinations
- Monitor international calls
-
Log Review:
- Navigate to Admin → Log Files
- Review Asterisk logs for errors
- Check security logs for intrusion attempts
- Monitor failed authentication attempts
Backup and Recovery
Automated Backups
-
Configure Backup Schedule:
- Navigate to Admin → Backup & Restore
- Click Add Backup
- Configure backup:
- Name:
Daily Backup - Type: Full Backup
- Items: Select all (configurations, voicemail, recordings, etc.)
- Maintenance: Delete backups older than 30 days
- Name:
-
Set Backup Schedule:
- Schedule: Daily at 2:00 AM
- Email Notification: Send report after backup
-
Backup Destination:
- Local: Store on persistent volume
- Remote: Configure FTP, SFTP, or S3 storage
- Recommended: Use both local and remote
-
Click Submit to save backup configuration
Manual Backup
-
Navigate to Admin → Backup & Restore
-
Click Backup tab
-
Select items to backup:
- System configurations
- Voicemail messages
- Call recordings
- Custom sounds
- CDR data
-
Click Run Backup Now
-
Download backup file once complete
Restoration Procedure
-
Access Backup & Restore:
- Navigate to Admin → Backup & Restore
- Click Restore tab
-
Upload Backup File:
- Click Browse to select backup file
- Or select from available backups
-
Select Restore Items:
- Choose which components to restore
- Warning: Restoration will overwrite current configuration
-
Execute Restore:
- Click Restore button
- System will restart services after restoration
- Wait for completion (may take several minutes)
-
Verify Restoration:
- Check extensions are configured correctly
- Test inbound and outbound calling
- Verify voicemail is accessible
- Review call routing
Volume Snapshots
Use Klutch.sh volume snapshots for additional protection:
-
In Klutch.sh dashboard, navigate to Volumes
-
Select volume to snapshot
-
Click Create Snapshot
-
Name snapshot with date:
freepbx-data-2024-01-15 -
Schedule regular snapshots before major changes
-
Restore from snapshot if needed by creating new volume
Performance Optimization
Resource Allocation
-
CPU and Memory:
- Monitor resource usage in Klutch.sh dashboard
- Scale up if call quality degrades
- Recommended minimums:
- Small office (<10 extensions): 2 vCPU, 2GB RAM
- Medium business (<50 extensions): 4 vCPU, 4GB RAM
- Large enterprise (>50 extensions): 8 vCPU, 8GB RAM
-
Database Optimization:
- Navigate to Admin → System Admin → Database
- Run database optimization weekly
- Enable query cache
- Purge old CDR records regularly
-
Audio Codec Selection:
- Navigate to Settings → Asterisk SIP Settings
- Prioritize codecs by quality/bandwidth:
- Best quality:
g722,opus - Balance:
ulaw,alaw - Low bandwidth:
g729
- Best quality:
- Disable unused codecs to reduce negotiation time
Call Quality Optimization
-
RTP Quality of Service (QoS):
- Navigate to Settings → Asterisk SIP Settings → Other SIP Settings
- Set
tos_audiotoef(Expedited Forwarding) - Set
cos_audioto5
-
Jitter Buffer:
- Navigate to Settings → Asterisk SIP Settings → Chan SIP Settings
- Enable jitter buffer:
yes - Set
jbmaxsizeto200(adjust based on network conditions)
-
Network Testing:
- Use tools to test network quality:
- Monitor packet loss, jitter, and latency
- Aim for: <1% packet loss, <30ms jitter, <150ms latency
Monitoring and Maintenance
System Monitoring
-
Dashboard Overview:
- Navigate to Dashboard in FreePBX
- Monitor real-time statistics:
- Active calls
- Extension status
- Trunk registration
- System resources
-
Call Reports:
- Navigate to Reports → CDR Reports
- Review call statistics:
- Call volume by hour/day
- Average call duration
- Failed call attempts
- Top destinations
-
Extension Status:
- Navigate to Applications → Extensions
- Monitor extension registration
- Check for offline or expired registrations
- Review extension usage patterns
Regular Maintenance Tasks
-
Weekly Tasks:
- Review call quality reports
- Check for system updates
- Verify backups completed successfully
- Monitor disk space usage
- Review security logs
-
Monthly Tasks:
- Update FreePBX modules
- Optimize database
- Purge old CDR records (if desired)
- Review and adjust call routing
- Audit extension list
-
Quarterly Tasks:
- Update Asterisk (if available)
- Review and update security policies
- Conduct disaster recovery drill
- Review trunk utilization and costs
- Update documentation
Troubleshooting Common Issues
FreePBX Won’t Start
-
Check Container Logs:
- View logs in Klutch.sh dashboard
- Look for initialization errors
- Check database connection errors
-
Verify Database Connection:
- Ensure database is running and accessible
- Check
DB_HOST,DB_PORTenvironment variables - Test database connectivity:
mysql -h DB_HOST -P DB_PORT -u DB_USER -p
-
Check Volume Mounts:
- Ensure volumes are properly attached
- Verify mount paths are correct
- Check for sufficient storage space
-
Restart Services:
- Redeploy the app from Klutch.sh dashboard
- Wait for initialization to complete (5-10 minutes)
Extensions Won’t Register
-
Check Extension Configuration:
- Navigate to Applications → Extensions
- Verify extension details are correct
- Check secret is set properly
-
Verify Network Settings:
- Navigate to Settings → Asterisk SIP Settings
- Check External Address is set correctly
- Verify Local Networks includes your network
- Ensure NAT settings are correct
-
Check Firewall:
- Verify SIP port 5060 is accessible
- Check if firewall is blocking registration
- Review Fail2Ban banned IPs
-
Test with Softphone:
- Enable debug mode on softphone
- Check registration errors
- Verify server address and credentials
No Audio or One-Way Audio
-
RTP Port Configuration:
- Navigate to Settings → Asterisk SIP Settings → Chan SIP Settings
- Verify RTP port range:
10000-10200 - Ensure ports are not blocked by firewall
-
NAT Configuration:
- Navigate to Settings → Asterisk SIP Settings
- Set External Address to your public domain
- Set Local Networks correctly
- Enable NAT on extensions
-
Codec Issues:
- Check both ends support common codec
- Navigate to Settings → Asterisk SIP Settings
- Ensure
ulawandalaware enabled - Check trunk codec settings
-
Network Quality:
- Test for packet loss and jitter
- Check bandwidth availability
- Run network diagnostic tools
Calls Drop After 15-30 Seconds
-
SIP Session Timer Issue:
- Navigate to Settings → Asterisk SIP Settings → Chan SIP Settings
- Set
session-timerstorefuseoraccept - Adjust session timer values
-
RTP Timeout:
- Navigate to Settings → Asterisk SIP Settings → Chan SIP Settings
- Increase
rtptimeoutto300seconds - Adjust
rtpholdtimeoutas needed
-
Firewall Connection Tracking:
- Ensure firewall allows established connections
- Check NAT session timeout on router
- Consider using SIP over TCP instead of UDP
Trunk Registration Fails
-
Check Trunk Configuration:
- Navigate to Connectivity → Trunks
- Verify credentials are correct
- Check SIP server address and port
- Review trunk provider documentation
-
Test Connectivity:
- Use SIP debug to see registration attempts
- Navigate to Admin → Asterisk CLI
- Run:
pjsip set logger on - Attempt registration and review output
-
Contact Trunk Provider:
- Verify account is active and funded
- Check for IP whitelist requirements
- Confirm registration is required
- Request technical support if needed
Production Deployment Checklist
Before going live with FreePBX:
- Database deployed and accessible
- Persistent volumes configured and tested (minimum 10GB for
/data) - All environment variables set correctly
- Admin account created with strong password
- Two-factor authentication enabled
- SSL/HTTPS working correctly (automatic via Klutch.sh)
- Extensions created and tested
- Softphones registered successfully
- Internal calling tested (extension to extension)
- SIP trunk configured and registered
- Outbound calling tested
- Inbound routes configured
- Voicemail set up and tested
- Email notifications working
- Call recording configured (if needed)
- IVR or auto-attendant configured
- Ring groups/queues set up (if needed)
- Time conditions configured
- Backup schedule configured and tested
- Security settings reviewed (Fail2Ban, firewall)
- Monitoring and alerting configured
- Custom domain configured (optional)
- User training completed
- Documentation updated with specific configuration
Advanced Configuration
Multi-Site Deployment
Connect multiple FreePBX instances:
-
Configure IAX2 Trunk:
- Navigate to Connectivity → Trunks
- Add IAX2 trunk between sites
- Configure authentication
-
Set Up Dial Plan:
- Create site-specific extensions (Site A: 1xxx, Site B: 2xxx)
- Configure outbound routes for inter-site calling
-
Enable DUNDi (optional):
- Distributed Universal Number Discovery
- Allows automatic extension lookup across sites
- Navigate to Settings → DUNDi Settings
CRM Integration
Integrate FreePBX with CRM systems:
-
Enable UCP (User Control Panel):
- Navigate to Settings → User Control Panel
- Enable UCP access for users
- Configure permissions
-
Install CRM Modules:
- Navigate to Admin → Module Admin
- Search for CRM integration modules:
- SugarCRM
- Salesforce
- HubSpot
- Custom integration via REST API
-
Configure Screen Pops:
- Automatic customer lookup on incoming calls
- Display customer information
- Click-to-dial functionality
Advanced Call Routing
Implement sophisticated routing logic:
-
Custom Contexts:
- Edit dialplan in Admin → Config Edit
- Create custom contexts for special routing
- Use AGI scripts for dynamic routing
-
Database Lookups:
- Use MySQL/MariaDB for routing decisions
- Query customer database for personalized routing
- Implement time-based routing rules
-
API Integration:
- Use Asterisk REST Interface (ARI)
- Integrate with external services
- Build custom applications
Migration from Existing PBX
Exporting Configuration
If migrating from another FreePBX installation:
-
Export from Old System:
- Navigate to Admin → Backup & Restore
- Create full backup
- Download backup file
-
Prepare for Import:
- Ensure FreePBX versions are compatible
- Document any custom configurations
- Export CDR data separately if needed
-
Import to New System:
- Upload backup to new FreePBX instance
- Restore configuration
- Verify all settings
Porting Phone Numbers
-
Contact Current Provider:
- Request Letter of Authorization (LOA)
- Obtain account and PIN information
- Note any contractual obligations
-
Submit Port Request:
- Work with new SIP trunk provider
- Submit porting paperwork
- Expect 7-14 days for completion
-
Test During Port:
- Configure both old and new trunks
- Test call flow before cutover
- Schedule cutover for low-traffic period
-
Post-Port Verification:
- Test all inbound numbers
- Verify caller ID
- Update any documentation
Resources and Further Reading
- FreePBX Official Website
- FreePBX Wiki
- FreePBX Community Forums
- Asterisk Documentation
- FreePBX GitHub Repository
- Asterisk PBX Guide
- MariaDB Deployment Guide
- Klutch.sh Quick Start Guide
- Klutch.sh Volumes Documentation
- Klutch.sh Custom Domains Guide
Conclusion
Deploying FreePBX on Klutch.sh provides a powerful, professional-grade PBX system with the ease of managed cloud infrastructure. With automatic HTTPS, persistent storage, reliable database connectivity, and the ability to scale resources as needed, you can focus on managing your communications rather than maintaining servers.
This guide covered everything from initial deployment to advanced configuration, security hardening, backup procedures, and troubleshooting. Whether you’re setting up a small business phone system or deploying an enterprise call center, FreePBX on Klutch.sh offers the flexibility, reliability, and features you need.
Remember to keep your system updated, maintain regular backups, monitor call quality, and follow security best practices. For additional help or questions, refer to the resources above or engage with the FreePBX community.
Happy dialing!