Skip to content

Deploying BigTree CMS

BigTree CMS is a lightweight, flexible, and developer-friendly content management system designed for building modern websites. Built with PHP and MySQL, BigTree CMS provides an intuitive interface for managing content while giving developers the freedom to build custom features and designs. Whether you’re building a corporate website, blog, portfolio, or complex web application, BigTree CMS offers a perfect balance between ease of use and powerful customization capabilities.

Why BigTree CMS?

BigTree CMS stands out in the CMS landscape with its flexible architecture and developer-first approach:

  • Lightweight: Minimal overhead with fast page load times and efficient resource usage
  • Easy Installation: Simple setup process that gets you managing content in minutes
  • Developer Friendly: Clean PHP code, well-structured APIs, and extensive documentation
  • Content Management: Intuitive dashboard for managing pages, blog posts, and custom content types
  • Template System: Built-in template engine for creating custom designs without CMS limitations
  • SEO Friendly: Built-in meta tags, sitemap generation, and URL optimization features
  • User Management: Role-based access control with granular permission settings
  • Media Library: Integrated media management with image optimization and organization
  • Flexible Database: Supports MySQL and MariaDB with easy migrations and backups
  • Customizable Modules: Build custom modules and extensions to extend functionality
  • API Functionality: REST-like API for accessing content programmatically
  • Version Control: Track content changes and maintain revision history
  • No Vendor Lock-in: Open-source codebase you can modify and extend
  • Performance: Caching mechanisms and optimization tools for fast performance

BigTree CMS is ideal for web agencies, developers, content creators, and organizations that need a CMS that’s both powerful and easy to manage. With persistent storage on Klutch.sh, your content and database are always safe and accessible.

Prerequisites

Before deploying BigTree CMS, ensure you have:

  • A Klutch.sh account
  • A GitHub repository with your BigTree CMS deployment configuration
  • Basic familiarity with Docker, Git, PHP, and MySQL
  • A domain name (recommended for production deployment)
  • MySQL or MariaDB database connection details (can be managed through environment variables)
  • Understanding of content management systems

Important Considerations

Deploying BigTree CMS

  1. Create a New Project

    Log in to your Klutch.sh dashboard and create a new project for your BigTree CMS deployment.

  2. Prepare Your Repository

    Create a GitHub repository with the following structure for your BigTree CMS deployment:

    bigtree-cms-deploy/
    ├─ Dockerfile
    ├─ .env.example
    ├─ nginx.conf
    ├─ docker-entrypoint.sh
    ├─ .gitignore
    └─ README.md

    Here’s a Dockerfile for BigTree CMS:

    FROM php:8.1-fpm-alpine
    # Install required PHP extensions
    RUN apk add --no-cache \
    nginx \
    mysql-client \
    imagemagick \
    imagemagick-dev \
    libpng-dev \
    libjpeg-turbo-dev \
    libwebp-dev \
    libxpm-dev \
    freetype-dev \
    curl \
    wget \
    git \
    supervisor
    # Install PHP extensions
    RUN docker-php-ext-configure gd \
    --with-freetype \
    --with-jpeg \
    --with-webp && \
    docker-php-ext-install -j$(nproc) gd pdo pdo_mysql mysqli exif
    # Install Imagick
    RUN pecl install imagick && \
    docker-php-ext-enable imagick
    # Install Composer
    RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    # Set working directory
    WORKDIR /var/www/html
    # Download BigTree CMS
    RUN git clone https://github.com/bigtreecms/BigTree-CMS.git . && \
    git checkout main && \
    composer install --no-dev --optimize-autoloader
    # Create necessary directories
    RUN mkdir -p /var/www/html/storage \
    /var/www/html/public/uploads \
    /var/www/html/cache \
    /var/www/html/logs && \
    chown -R www-data:www-data /var/www/html
    # Copy nginx configuration
    COPY nginx.conf /etc/nginx/http.d/default.conf
    # Copy entrypoint script
    COPY docker-entrypoint.sh /
    RUN chmod +x /docker-entrypoint.sh
    # Expose port
    EXPOSE 8080
    # Health check
    HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
    CMD curl -f http://localhost:8080/ || exit 1
    # Run entrypoint
    ENTRYPOINT ["/docker-entrypoint.sh"]
    CMD ["start"]

    Create a docker-entrypoint.sh file for managing startup processes:

    #!/bin/sh
    # Function to wait for database
    wait_for_db() {
    echo "Waiting for database connection..."
    while ! mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASSWORD" -e "SELECT 1" > /dev/null 2>&1; do
    sleep 1
    done
    echo "Database is ready!"
    }
    # Wait for database if configured
    if [ -n "$DB_HOST" ]; then
    wait_for_db
    fi
    # Run database migrations on first startup
    if [ ! -f /var/www/html/storage/installed ]; then
    echo "Running database setup..."
    php artisan migrate --force
    touch /var/www/html/storage/installed
    fi
    # Set proper permissions
    chown -R www-data:www-data /var/www/html
    if [ "$1" = "start" ]; then
    # Start PHP-FPM
    php-fpm
    # Start Nginx
    nginx -g "daemon off;"
    else
    exec "$@"
    fi

    Create an nginx.conf file:

    server {
    listen 8080;
    server_name _;
    root /var/www/html/public;
    index index.php index.html;
    # Security headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    # Gzip compression
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
    gzip_min_length 1000;
    gzip_vary on;
    # Static files caching
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|webp)$ {
    expires 30d;
    add_header Cache-Control "public, immutable";
    }
    # PHP handling
    location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }
    # Prevent access to hidden files
    location ~ /\. {
    deny all;
    }
    # Prevent direct access to storage
    location ~ /storage/ {
    deny all;
    }
    # URL rewriting for pretty URLs
    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }
    }

    Create a .env.example file:

    Terminal window
    # Database Configuration
    DB_HOST=localhost
    DB_NAME=bigtree_cms
    DB_USER=bigtree_user
    DB_PASSWORD=secure_password_here
    # Application Configuration
    APP_URL=https://yourdomain.com
    APP_NAME="My Website"
    APP_ENV=production
    APP_DEBUG=false
    # Session Configuration
    SESSION_DRIVER=file
    SESSION_TIMEOUT=120
    # Mail Configuration (for contact forms, notifications)
    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.mailtrap.io
    MAIL_PORT=587
    MAIL_USERNAME=your_username
    MAIL_PASSWORD=your_password
    MAIL_FROM=noreply@yourdomain.com
    # Cache Configuration
    CACHE_DRIVER=file
    CACHE_TTL=3600
    # File Upload Limits
    MAX_UPLOAD_SIZE=52428800
    ALLOWED_FILE_TYPES=jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,zip

    Commit and push to your GitHub repository:

    Terminal window
    git init
    git add .
    git commit -m "Initial BigTree CMS deployment"
    git remote add origin https://github.com/yourusername/bigtree-cms-deploy.git
    git push -u origin main
  3. Create a New App

    In the Klutch.sh dashboard:

    • Click “Create New App”
    • Select your GitHub repository containing the Dockerfile
    • Choose the branch (typically main or master)
    • Klutch.sh will automatically detect the Dockerfile in the root directory
  4. Configure Environment Variables

    Set up these essential environment variables in your Klutch.sh dashboard:

    VariableDescriptionExample
    DB_HOSTDatabase host addressdatabase.example.com
    DB_NAMEDatabase namebigtree_cms
    DB_USERDatabase usernamebigtree_user
    DB_PASSWORDDatabase password (use strong password)secure_password_here
    APP_URLApplication URLhttps://example.com
    APP_NAMEWebsite nameMy Website
    APP_ENVEnvironment (production or development)production
    APP_DEBUGDebug mode (false for production)false
    MAIL_DRIVERMail service (smtp, sendmail)smtp
    MAIL_HOSTSMTP hostsmtp.gmail.com
    MAIL_PORTSMTP port587
    MAIL_USERNAMESMTP usernameyour-email@gmail.com
    MAIL_PASSWORDSMTP password or app passwordapp_password
    MAIL_FROMFrom email addressnoreply@example.com
    MAX_UPLOAD_SIZEMaximum file upload size in bytes52428800
  5. Configure Persistent Storage

    BigTree CMS requires persistent storage for content, uploads, and configuration. Add persistent volumes:

    Mount PathDescriptionRecommended Size
    /var/www/html/public/uploadsUser uploads (images, documents, media)100GB+
    /var/www/html/storageApplication storage (caches, sessions)50GB
    /var/www/html/logsApplication logs20GB

    In the Klutch.sh dashboard:

    • Navigate to your app settings
    • Go to the “Volumes” section
    • Click “Add Volume” for each mount path
    • Set mount paths and sizes as specified above
  6. Set Network Configuration

    Configure your app’s network settings:

    • Select traffic type: HTTP (BigTree CMS uses standard web ports)
    • Recommended internal port: 8080 (as specified in Dockerfile)
    • Klutch.sh will automatically handle HTTPS termination via reverse proxy
    • Ensure port 80 and 443 are accessible from your domain
  7. Configure Custom Domain

    BigTree CMS works best with a custom domain:

    • Navigate to your app’s “Domains” section in Klutch.sh
    • Click “Add Custom Domain”
    • Enter your domain (e.g., example.com or www.example.com)
    • Configure DNS with a CNAME record to point to your Klutch.sh app
    • Update APP_URL environment variable to match your domain
    • Klutch.sh will automatically provision SSL certificates
  8. Deploy Your App

    • Review all settings and environment variables
    • Click “Deploy”
    • Klutch.sh will build the Docker image and start your BigTree CMS instance
    • Wait for the deployment to complete (typically 5-10 minutes for the initial build)
    • Access your BigTree CMS installation at your configured domain
    • Complete the initial setup wizard in the admin panel

Initial Setup and Configuration

After deployment completes, access your BigTree CMS instance to complete setup.

Accessing the Admin Panel

Navigate to your domain’s admin path: https://yourdomain.com/admin/

You’ll be guided through the BigTree CMS setup wizard where you can:

  • Create your first administrator account
  • Configure basic site settings
  • Set up content structure
  • Configure permissions

Creating Content

  1. Log in to the admin panel with your administrator account
  2. Navigate to the “Pages” section
  3. Click “New Page” to create your first page
  4. Configure:
    • Page title and URL slug
    • Content (using the built-in editor)
    • Meta title and description for SEO
    • Parent page (for hierarchy)
  5. Publish the page

Managing Users

Create additional user accounts for content management:

  1. Go to “Users” in the admin panel
  2. Click “New User”
  3. Set user details:
    • Username and email
    • Name
    • Role (Administrator, Editor, Author, Viewer)
    • Permissions
  4. Send credentials to the user

Setting Up Modules

BigTree CMS supports custom modules for specific functionality:

  1. Navigate to “Modules” in admin
  2. View available modules
  3. Configure module settings
  4. Use modules to manage specific content types

Environment Variable Examples

Basic Configuration

Terminal window
DB_HOST=your-database.example.com
DB_NAME=bigtree_cms
DB_USER=bigtree_user
DB_PASSWORD=your-secure-password
APP_URL=https://yourdomain.com
APP_NAME="My Website"
APP_ENV=production
APP_DEBUG=false

Complete Production Configuration

Terminal window
# Database
DB_HOST=your-database.example.com
DB_NAME=bigtree_cms
DB_USER=bigtree_user
DB_PASSWORD=your-secure-password
DB_PORT=3306
DB_CHARSET=utf8mb4
# Application
APP_URL=https://yourdomain.com
APP_NAME="My Website"
APP_ENV=production
APP_DEBUG=false
APP_TIMEZONE=UTC
APP_LOCALE=en
# Session
SESSION_DRIVER=file
SESSION_TIMEOUT=120
REMEMBER_TOKEN_EXPIRATION=604800
# Cache
CACHE_DRIVER=file
CACHE_TTL=3600
CACHE_PREFIX=bigtree_
# Mail Configuration
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_FROM=noreply@yourdomain.com
MAIL_FROM_NAME="My Website"
MAIL_ENCRYPTION=tls
# File Uploads
MAX_UPLOAD_SIZE=52428800
ALLOWED_FILE_TYPES=jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,zip
ENABLE_IMAGE_OPTIMIZATION=true
IMAGE_QUALITY=85
# SEO
SEO_GENERATE_SITEMAP=true
SEO_CANONICAL_URL=true
SEO_STRUCTURED_DATA=true

Sample Code and Getting Started

PHP - Creating Pages Programmatically

<?php
// Load BigTree CMS framework
require_once(__DIR__ . '/core/start.php');
// Create a new page
$page = new stdClass();
$page->title = "About Us";
$page->url_slug = "about-us";
$page->content = "<h1>About Our Company</h1><p>Learn more about who we are...</p>";
$page->meta_title = "About Us | My Website";
$page->meta_description = "Learn about our company, mission, and team";
$page->published = true;
$page->parent_id = 0;
$page->created_at = date('Y-m-d H:i:s');
// Save to database
$page_id = BigTree\Page::create($page);
echo "Page created with ID: " . $page_id;
?>

PHP - Retrieving Content

<?php
// Load BigTree CMS framework
require_once(__DIR__ . '/core/start.php');
// Get all published pages
$pages = BigTree\Page::getPublished();
foreach ($pages as $page) {
echo "<div class='page'>";
echo "<h2>" . htmlspecialchars($page['title']) . "</h2>";
echo "<p>" . htmlspecialchars($page['content']) . "</p>";
echo "<a href='" . htmlspecialchars($page['url']) . "'>Read More</a>";
echo "</div>";
}
?>

PHP - Form Handling

<?php
// Load BigTree CMS framework
require_once(__DIR__ . '/core/start.php');
// Process contact form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = sanitize_input($_POST['name']);
$email = sanitize_input($_POST['email']);
$message = sanitize_input($_POST['message']);
// Validate inputs
if (empty($name) || empty($email) || empty($message)) {
$error = "All fields are required";
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error = "Invalid email address";
} else {
// Send email
$mail_content = "Name: " . $name . "\n";
$mail_content .= "Email: " . $email . "\n\n";
$mail_content .= "Message:\n" . $message;
$headers = "From: " . $email;
mail($_ENV['MAIL_FROM'], "New Contact Form Submission", $mail_content, $headers);
$success = "Thank you for your message. We'll get back to you soon!";
}
}
function sanitize_input($input) {
return htmlspecialchars(trim($input), ENT_QUOTES, 'UTF-8');
}
?>

JavaScript - Dynamic Content Loading

// Load and display pages dynamically
async function loadPageContent(pageSlug) {
try {
const response = await fetch(`/api/pages/${pageSlug}`);
const data = await response.json();
if (data.success) {
document.getElementById('page-title').textContent = data.page.title;
document.getElementById('page-content').innerHTML = data.page.content;
// Update meta tags for SEO
document.title = data.page.meta_title;
document.querySelector('meta[name="description"]')
.setAttribute('content', data.page.meta_description);
} else {
console.error('Page not found');
}
} catch (error) {
console.error('Error loading page:', error);
}
}
// Load page on navigation
document.addEventListener('DOMContentLoaded', () => {
const pageSlug = window.location.pathname.split('/')[1] || 'home';
loadPageContent(pageSlug);
});

Python - CMS Integration Script

import requests
import json
from datetime import datetime
class BigTreeCMSClient:
def __init__(self, base_url, api_key):
self.base_url = base_url
self.api_key = api_key
self.headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
def get_pages(self):
"""Retrieve all published pages"""
try:
response = requests.get(
f'{self.base_url}/api/pages',
headers=self.headers
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Error retrieving pages: {e}")
return None
def get_page(self, page_id):
"""Retrieve a specific page"""
try:
response = requests.get(
f'{self.base_url}/api/pages/{page_id}',
headers=self.headers
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Error retrieving page: {e}")
return None
def create_page(self, title, slug, content, meta_title, meta_description):
"""Create a new page"""
payload = {
'title': title,
'url_slug': slug,
'content': content,
'meta_title': meta_title,
'meta_description': meta_description,
'published': True
}
try:
response = requests.post(
f'{self.base_url}/api/pages',
headers=self.headers,
json=payload
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Error creating page: {e}")
return None
def upload_media(self, file_path):
"""Upload media file"""
try:
with open(file_path, 'rb') as f:
files = {'file': f}
response = requests.post(
f'{self.base_url}/api/media/upload',
headers={'Authorization': f'Bearer {self.api_key}'},
files=files
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Error uploading media: {e}")
return None
# Usage
client = BigTreeCMSClient('https://yourdomain.com', 'your-api-key')
# Get all pages
pages = client.get_pages()
print(json.dumps(pages, indent=2))
# Create new page
new_page = client.create_page(
title="Services",
slug="services",
content="<h1>Our Services</h1><p>We offer professional services...</p>",
meta_title="Services | My Website",
meta_description="Discover our wide range of professional services"
)
print(f"New page created: {new_page}")
# Upload media
upload_result = client.upload_media('/path/to/image.jpg')
print(f"Media uploaded: {upload_result}")

Docker Compose for Local Development

For local development before deploying to Klutch.sh:

version: '3.8'
services:
bigtree-cms:
build: .
container_name: bigtree-cms
environment:
DB_HOST: mysql
DB_NAME: bigtree_cms
DB_USER: bigtree_user
DB_PASSWORD: dev_password
APP_URL: http://localhost:8080
APP_NAME: "My Website"
APP_ENV: development
APP_DEBUG: "true"
MAIL_DRIVER: log
ports:
- "8080:8080"
volumes:
- ./:/var/www/html
- ./public/uploads:/var/www/html/public/uploads
- ./storage:/var/www/html/storage
- ./logs:/var/www/html/logs
depends_on:
- mysql
restart: unless-stopped
mysql:
image: mysql:8.0
container_name: bigtree-mysql
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: bigtree_cms
MYSQL_USER: bigtree_user
MYSQL_PASSWORD: dev_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
restart: unless-stopped
volumes:
mysql_data:

To run locally:

Terminal window
docker-compose up -d

Access BigTree CMS at http://localhost:8080

Template Customization

BigTree CMS uses PHP-based templates for maximum flexibility.

Creating Custom Templates

/public/templates/homepage.php
<?php get_header(); ?>
<main class="homepage">
<section class="hero">
<h1><?php echo htmlspecialchars($page['title']); ?></h1>
<p><?php echo htmlspecialchars($page['subtitle']); ?></p>
</section>
<section class="featured-content">
<?php
$featured = BigTree\Page::getFeatured(5);
foreach ($featured as $item) {
?>
<article class="featured-item">
<h3><?php echo htmlspecialchars($item['title']); ?></h3>
<p><?php echo substr(htmlspecialchars($item['content']), 0, 150) . '...'; ?></p>
<a href="<?php echo htmlspecialchars($item['url']); ?>">Read More</a>
</article>
<?php
}
?>
</section>
</main>
<?php get_footer(); ?>

Using Modules in Templates

/public/templates/contact.php
<?php get_header(); ?>
<main class="contact-page">
<h1><?php echo htmlspecialchars($page['title']); ?></h1>
<!-- Display contact form module -->
<?php echo BigTree\Module::render('contact_form', array(
'recipient' => 'info@example.com',
'success_message' => 'Thank you for contacting us!'
)); ?>
</main>
<?php get_footer(); ?>

SEO Optimization

BigTree CMS provides built-in SEO features:

Configure SEO Settings

In the admin panel under “Settings”:

  1. General SEO

    • Enable sitemap generation
    • Configure canonical URLs
    • Enable structured data markup
  2. Meta Tags

    • Set default meta title template
    • Set default meta description
    • Configure Open Graph tags
  3. URL Structure

    • Configure URL slug patterns
    • Enable pretty URLs
    • Set trailing slash preference

Per-Page SEO Configuration

When editing pages:

  1. Set unique meta title (50-60 characters)
  2. Write compelling meta description (150-160 characters)
  3. Add focus keyword for content
  4. Configure page slug for SEO-friendly URLs
  5. Add internal links to related content
  6. Optimize images with alt text

Sample SEO Configuration

// Page settings for SEO
$page = array(
'title' => 'Professional Web Design Services',
'meta_title' => 'Web Design & Development | Company Name',
'meta_description' => 'Award-winning web design and development services. Custom websites that drive results.',
'url_slug' => 'web-design-services',
'content' => '<!-- Well-structured, keyword-rich content -->',
'og_title' => 'Professional Web Design Services',
'og_description' => 'Award-winning web design and development services.',
'og_image' => 'https://yourdomain.com/images/services-hero.jpg'
);

Content Organization and Hierarchy

Creating Page Hierarchies

  1. Navigate to Pages in admin panel
  2. Create parent pages for main sections
  3. Create child pages under parent pages
  4. Organize content structure for users and SEO

Configure navigation menus:

  1. Go to “Menus” in admin panel
  2. Create menu structures
  3. Add pages to menus
  4. Organize menu items hierarchically
  5. Set custom menu item labels

Media Management

Uploading and Managing Media

  1. Navigate to “Media” in admin panel
  2. Click “Upload” to add images and documents
  3. Organize files in folders
  4. Edit file properties and metadata
  5. Use media in page content

Image Optimization

BigTree CMS automatically handles image optimization:

// In environment variables
IMAGE_QUALITY=85
ENABLE_IMAGE_OPTIMIZATION=true
IMAGE_RESIZE_WIDTHS=320,640,1024,1920

Backup and Recovery

Automated Backups

Set up regular backups using persistent volumes:

# Backup script (can be run via cron)
#!/bin/bash
BACKUP_DIR="/backups"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
# Backup database
mysqldump -h $DB_HOST -u $DB_USER -p$DB_PASSWORD $DB_NAME > \
$BACKUP_DIR/bigtree_db_$TIMESTAMP.sql
# Backup uploads
tar -czf $BACKUP_DIR/bigtree_uploads_$TIMESTAMP.tar.gz \
/var/www/html/public/uploads/
# Keep only last 7 days of backups
find $BACKUP_DIR -name "bigtree_*" -mtime +7 -delete
echo "Backup completed: $TIMESTAMP"

Recovery Procedures

To restore from backups:

  1. Stop the BigTree CMS container
  2. Restore database from SQL dump:
    Terminal window
    mysql -h $DB_HOST -u $DB_USER -p$DB_PASSWORD $DB_NAME < backup.sql
  3. Restore uploads from archive:
    Terminal window
    tar -xzf backup.tar.gz -C /var/www/html/
  4. Restart the container

Performance Optimization

Caching Configuration

Terminal window
CACHE_DRIVER=file
CACHE_TTL=3600
ENABLE_QUERY_CACHE=true
ENABLE_PAGE_CACHE=true

Database Optimization

-- Optimize tables
OPTIMIZE TABLE bigtree_pages;
OPTIMIZE TABLE bigtree_users;
OPTIMIZE TABLE bigtree_media;
-- Create indexes for frequently queried columns
CREATE INDEX idx_published ON bigtree_pages(published);
CREATE INDEX idx_parent_id ON bigtree_pages(parent_id);

Static Asset Optimization

BigTree CMS automatically:

  • Minifies CSS and JavaScript
  • Compresses images
  • Leverages browser caching
  • Enables gzip compression (configured in nginx.conf)

User Roles and Permissions

Available Roles

  • Administrator: Full access to all features and settings
  • Editor: Can manage pages, media, and users (no system settings)
  • Author: Can create and edit content they own
  • Viewer: Read-only access to specific sections
  • Custom Roles: Create custom roles with specific permissions

Assigning Permissions

  1. Create or edit a user
  2. Select their role
  3. Configure role-specific permissions:
    • Page management
    • Media access
    • User management
    • Settings access

Security Best Practices

Authentication and Access Control

  • Use strong, unique passwords for admin accounts
  • Enable two-factor authentication if available
  • Limit admin panel access to trusted IP addresses
  • Create separate user accounts for each team member
  • Regularly audit user permissions

Data Security

  • Encrypt sensitive database information in environment variables
  • Use HTTPS for all connections (automatic via Klutch.sh)
  • Implement regular database backups
  • Store backups in secure, offsite locations
  • Monitor database access logs

Content Security

  • Sanitize all user inputs
  • Validate file uploads (type and size)
  • Use Content Security Policy headers
  • Disable dangerous PHP functions
  • Keep PHP and extensions updated

Application Security

// Disable dangerous functions in php.ini
disable_functions = exec,passthru,shell_exec,system
// Implement CSRF protection
if (!verify_csrf_token($_POST['csrf_token'])) {
die('CSRF token validation failed');
}
// Sanitize database queries
$page = BigTree\Page::getBySlug(
$mysqli->real_escape_string($_GET['slug'])
);
// Validate and sanitize form inputs
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
$content = htmlspecialchars($_POST['content'], ENT_QUOTES, 'UTF-8');

Troubleshooting

Common Issues and Solutions

Issue: Database connection fails on startup

Solutions:

  • Verify DB_HOST, DB_NAME, DB_USER, DB_PASSWORD are correct
  • Ensure database server is running and accessible
  • Check database user permissions
  • Verify no firewall blocks database connection

Issue: Pages not displaying

Troubleshooting:

  • Check that pages are published in admin panel
  • Verify page URLs and slugs are configured correctly
  • Check file permissions on uploads directory
  • Review application logs for errors

Issue: File uploads failing

Solutions:

  • Verify /var/www/html/public/uploads persistent volume is attached
  • Check directory permissions (should be writable by www-data)
  • Verify MAX_UPLOAD_SIZE environment variable is set appropriately
  • Check available disk space on upload volume

Issue: Email notifications not sending

Troubleshooting:

  • Verify MAIL_DRIVER, MAIL_HOST, MAIL_PORT settings
  • Check MAIL_USERNAME and MAIL_PASSWORD credentials
  • Ensure SMTP server permits outgoing connections
  • Review mail logs for errors

Issue: Slow page loading

Solutions:

  • Enable caching: CACHE_DRIVER=file
  • Optimize database with indexes
  • Compress images in media library
  • Enable gzip compression in nginx
  • Consider upgrading instance resources

Upgrading BigTree CMS

To update BigTree CMS to a newer version:

  1. Update your Dockerfile to reference the latest version:

    RUN git clone https://github.com/bigtreecms/BigTree-CMS.git . && \
    git checkout v8.x && \
    composer install --no-dev
  2. Commit and push to GitHub

  3. Klutch.sh will automatically rebuild with the latest version

  4. Always test updates in a development environment first

  5. Back up your database before upgrading

  6. Review BigTree CMS release notes for breaking changes

Additional Resources

Conclusion

Deploying BigTree CMS on Klutch.sh provides you with a lightweight, flexible content management system that’s easy to use for content creators while offering developers the freedom to build custom features. With persistent storage for uploads and media, robust content management capabilities, and full control over your infrastructure, BigTree CMS enables organizations to manage their web presence effectively. Klutch.sh’s managed infrastructure ensures your website is always available, secure, and performant, allowing you to focus on creating great content and building your business.

Start building your website today by deploying BigTree CMS on Klutch.sh and experience the perfect balance between simplicity and power.