Skip to content

Deploying Fusion

Introduction

Fusion is a modern, open-source content management system built on Laravel that brings together the power of a flexible CMS with the elegance of a developer-friendly framework. Designed for both content creators and developers, Fusion provides an intuitive admin interface for managing content, pages, forms, and media while giving developers full control through Laravel’s ecosystem, custom fields, extensible modules, and a beautiful theming system.

What sets Fusion apart from traditional CMS platforms is its approach to content modeling. Instead of forcing your content into predefined structures, Fusion lets you create custom content types (called “blueprints”) with flexible field groups, reusable components, and powerful query builders. Need a blog with custom taxonomies? A product catalog with specifications? A portfolio with case studies? Fusion handles it all through its visual blueprint builder without writing code, yet developers can extend everything through Laravel’s familiar patterns.

Fusion combines the best of both worlds—editors get a clean, intuitive interface for creating and managing content with live preview, drag-and-drop page building, media management, and SEO tools. Developers get Laravel’s routing, Eloquent ORM, Blade templates, authentication, and the entire Composer ecosystem. Whether you’re building a corporate website, an online magazine, a documentation portal, or a custom web application with CMS capabilities, Fusion provides the foundation without the bloat.

Deploying Fusion on Klutch.sh gives you a production-ready CMS with automatic HTTPS for secure administration, persistent storage for uploads and database, straightforward database connectivity, and the flexibility to scale resources as your content and traffic grow—all without managing servers, configuring web servers, or wrestling with deployment pipelines.

This guide walks you through deploying Fusion on Klutch.sh using Docker, connecting to a MySQL or MariaDB database, configuring the CMS, creating content types and pages, customizing themes, implementing caching for performance, and following production-ready best practices for security, backups, and maintenance.


Why Deploy Fusion on Klutch.sh?

  • Modern Laravel Foundation: Built on Laravel 10+ with all framework benefits
  • Automatic HTTPS: Secure admin panel and frontend with automatic SSL
  • Persistent Storage: Reliable volume storage for uploads, cache, and media
  • Database Integration: Easy connection to MySQL, MariaDB, or PostgreSQL
  • Scalable Resources: Adjust CPU and RAM as traffic and content grow
  • Custom Content Types: Flexible blueprint system without database migrations
  • Developer-Friendly: Full Laravel ecosystem and Composer packages
  • No Server Management: Focus on content and development, not infrastructure
  • Cost-Effective: Pay only for resources used, no licensing fees
  • GitHub Integration: Version-controlled themes and custom code

Prerequisites

Before you begin, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your deployment
  • Basic understanding of Laravel and PHP
  • Familiarity with content management systems
  • Composer installed locally for development

Technical Requirements:

Fusion is a Laravel application with moderate resource needs:

  • Minimum 1GB RAM (2GB+ recommended for production)
  • At least 10GB persistent storage for uploads and cache
  • MySQL 5.7+, MariaDB 10.3+, or PostgreSQL 10+
  • PHP 8.1+ with required extensions (included in Docker image)
  • Node.js 16+ for asset compilation (dev/build only)

Required Dependencies:

Fusion requires a database. You’ll need to deploy either:

  • MySQL - see our MySQL deployment guide
  • MariaDB - see our MariaDB deployment guide (recommended)

Optional Dependencies:

For improved performance, consider deploying:

  • Redis - for caching, sessions, and queues

Understanding Fusion Architecture

Fusion is built as a modern Laravel application with CMS capabilities:

Core Components:

  • Admin Panel: Vue.js-powered interface for content management
  • Blueprint System: Custom content type builder with field groups
  • Page Builder: Visual drag-and-drop interface for page layouts
  • Media Manager: File upload, organization, and transformation
  • Form Builder: Create custom forms with validation and email notifications
  • Navigation Builder: Manage menus with drag-and-drop
  • User Management: Roles, permissions, and authentication
  • Theme System: Blade templates with component-based structure

Content Architecture:

  • Blueprints: Content type definitions (like post types)
  • Entries: Individual content items created from blueprints
  • Fields: Flexible field types (text, rich text, media, repeater, etc.)
  • Taxonomies: Categories, tags, and custom classification systems
  • Relationships: Link entries across different blueprints
  • Collections: Organized groups of entries

File Structure:

fusion/
├── app/ # Laravel application code
├── bootstrap/ # Laravel bootstrap
├── config/ # Configuration files
├── database/ # Migrations and seeds
├── public/ # Web root (assets, index.php)
├── resources/ # Views, Blade templates, assets
│ ├── blueprints/ # Content type definitions
│ ├── themes/ # Theme templates
│ └── views/ # Blade views
├── storage/ # Logs, cache, uploads
│ ├── app/ # Application storage
│ ├── framework/ # Framework cache
│ └── logs/ # Log files
├── tests/ # PHPUnit tests
└── vendor/ # Composer dependencies

Preparing Your Repository

Step 1: Create Project Directory

Create a new directory for your Fusion deployment:

Terminal window
mkdir fusion-cms
cd fusion-cms

Step 2: Install Fusion

Install Fusion using Composer:

Terminal window
composer create-project fusioncms/fusioncms .

Or clone from GitHub:

Terminal window
git clone https://github.com/fusioncms/fusioncms.git .
composer install

Step 3: Create Dockerfile

Create a Dockerfile for your Fusion deployment:

FROM php:8.2-fpm-alpine
# Install system dependencies
RUN apk add --no-cache \
nginx \
supervisor \
curl \
git \
zip \
unzip \
libzip-dev \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
icu-dev \
libxml2-dev \
oniguruma-dev \
sqlite-dev \
nodejs \
npm
# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) \
pdo_mysql \
mysqli \
zip \
gd \
intl \
xml \
mbstring \
opcache \
bcmath \
exif
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy application files
COPY . .
# Install PHP dependencies
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Install and build frontend assets
RUN npm ci && \
npm run build && \
rm -rf node_modules
# Set permissions
RUN chown -R www-data:www-data /var/www/html && \
chmod -R 755 /var/www/html && \
chmod -R 775 storage bootstrap/cache
# Configure Nginx
COPY docker/nginx.conf /etc/nginx/nginx.conf
# Configure PHP-FPM
RUN echo "php_admin_value[error_log] = /var/www/html/storage/logs/php-fpm.log" >> /usr/local/etc/php-fpm.d/www.conf && \
echo "php_admin_flag[log_errors] = on" >> /usr/local/etc/php-fpm.d/www.conf
# Configure PHP
RUN echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/memory-limit.ini && \
echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/uploads.ini && \
echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/uploads.ini && \
echo "max_execution_time = 300" >> /usr/local/etc/php/conf.d/timeouts.ini
# Configure Supervisor
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose HTTP port
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s \
CMD curl -f http://localhost/health || exit 1
# Start Supervisor
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

Step 4: Create Nginx Configuration

Create docker/nginx.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/www/html/storage/logs/nginx-access.log main;
error_log /var/www/html/storage/logs/nginx-error.log warn;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
client_max_body_size 64M;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/javascript application/xml+rss application/json;
server {
listen 80;
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 "no-referrer-when-downgrade" always;
# Disable access to hidden files
location ~ /\. {
deny all;
}
# Main location block
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# PHP-FPM configuration
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;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 300;
}
# Cache static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}
}

Step 5: Create Supervisor Configuration

Create docker/supervisord.conf:

[supervisord]
nodaemon=true
user=root
logfile=/var/www/html/storage/logs/supervisord.log
pidfile=/var/run/supervisord.pid
[program:php-fpm]
command=/usr/local/sbin/php-fpm -F
autostart=true
autorestart=true
stdout_logfile=/var/www/html/storage/logs/php-fpm.log
stderr_logfile=/var/www/html/storage/logs/php-fpm-error.log
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
autostart=true
autorestart=true
stdout_logfile=/var/www/html/storage/logs/nginx-stdout.log
stderr_logfile=/var/www/html/storage/logs/nginx-stderr.log
[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/worker.log
stopwaitsecs=3600
[program:schedule]
command=/bin/sh -c "while true; do php /var/www/html/artisan schedule:run --verbose --no-interaction & sleep 60; done"
autostart=true
autorestart=true
user=www-data
stdout_logfile=/var/www/html/storage/logs/schedule.log
stderr_logfile=/var/www/html/storage/logs/schedule-error.log

Step 6: Create Environment Configuration

Create a .env.example file:

APP_NAME=Fusion
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=https://example-app.klutch.sh
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=mysql-app.klutch.sh
DB_PORT=8000
DB_DATABASE=fusion
DB_USERNAME=fusion
DB_PASSWORD=your-secure-database-password
# Cache Configuration
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=database
# Redis Configuration (optional)
# CACHE_DRIVER=redis
# SESSION_DRIVER=redis
# QUEUE_CONNECTION=redis
# REDIS_HOST=redis-app.klutch.sh
# REDIS_PORT=8000
# REDIS_PASSWORD=null
# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@example.com
MAIL_FROM_NAME="${APP_NAME}"
# Filesystem
FILESYSTEM_DISK=local
# Fusion Settings
FUSION_MULTISITE=false
FUSION_MAINTENANCE=false

Step 7: Create .gitignore

Create a .gitignore file:

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode

Step 8: Create README.md

Document your deployment:

# Fusion CMS on Klutch.sh
Modern Laravel-based content management system.
## Quick Start
1. Deploy MySQL/MariaDB database on Klutch.sh
2. Configure `.env` with database credentials
3. Push this repository to GitHub
4. Deploy on Klutch.sh with HTTP traffic
5. Access admin panel at `/admin`
## Features
- Custom Content Types (Blueprints)
- Visual Page Builder
- Media Management
- Form Builder
- SEO Tools
- Role-Based Permissions
- Theme System
- API Support
## Configuration
See Klutch.sh dashboard for environment variables.
## Documentation
- [Fusion Documentation](https://beta.fusioncms.com/docs)
- [Laravel Documentation](https://laravel.com/docs)

Step 9: Generate Application Key

Generate a Laravel application key:

Terminal window
php artisan key:generate --show

Copy the generated key for use in environment variables.

Step 10: Push to GitHub

Initialize git and push your repository:

Terminal window
git init
git add .
git commit -m "Initial Fusion CMS deployment setup"
git branch -M main
git remote add origin https://github.com/your-username/fusion-cms.git
git push -u origin main

Deploying the Database

Fusion requires a MySQL or MariaDB database. Deploy the database first before deploying Fusion.

    1. Follow our MariaDB deployment guide to set up a database server

    2. Configure the MariaDB deployment with:

      • TCP Traffic on port 8000
      • Persistent Volume: /var/lib/mysql with at least 5GB
      • Environment Variables:
        • MYSQL_ROOT_PASSWORD: Strong root password
        • MYSQL_DATABASE: fusion
        • MYSQL_USER: fusion
        • MYSQL_PASSWORD: Strong user password
    3. Note the connection details:

      • Host: your-mariadb-app.klutch.sh
      • Port: 8000
      • Database: fusion
      • Username: fusion
      • Password: Your configured password

Option 2: Deploy MySQL on Klutch.sh

    1. Follow our MySQL deployment guide to set up a database server

    2. Configure with similar settings as MariaDB above

Option 3: Use External Managed Database

You can also use external managed database services:


Deploying Fusion on Klutch.sh

Step 1: Create New App

    1. Log in to the Klutch.sh dashboard

    2. Create a new project or select an existing one

    3. Create a new app and configure it:

      • Repository: Select your Fusion GitHub repository
      • Branch: Choose the branch to deploy (e.g., main or production)
      • Traffic Type: Select HTTP (Fusion runs as a web application)
      • Internal Port: Set to 80 (Nginx listens on port 80)

Step 2: Configure Persistent Volumes

Fusion requires persistent storage for uploads, cache, and logs.

    1. In your app settings, navigate to the Volumes section

    2. Add a volume for storage:

      • Mount Path: /var/www/html/storage
      • Size: 10GB (adjust based on expected media uploads)
    3. Add a volume for public uploads:

      • Mount Path: /var/www/html/public/storage
      • Size: 5GB

Step 3: Configure Environment Variables

Set essential environment variables for your Fusion deployment:

    1. In your app settings, navigate to the Environment Variables section

    2. Add the following variables (mark sensitive values as secrets):

      Application Configuration:

      Terminal window
      APP_NAME=Fusion
      APP_ENV=production
      APP_KEY=your-generated-application-key
      APP_DEBUG=false
      APP_URL=https://example-app.klutch.sh

      Database Configuration:

      Terminal window
      DB_CONNECTION=mysql
      DB_HOST=your-mariadb-app.klutch.sh
      DB_PORT=8000
      DB_DATABASE=fusion
      DB_USERNAME=fusion
      DB_PASSWORD=your-database-password

      Cache & Session:

      Terminal window
      CACHE_DRIVER=file
      SESSION_DRIVER=file
      QUEUE_CONNECTION=database

      Mail Configuration:

      Terminal window
      MAIL_MAILER=smtp
      MAIL_HOST=smtp.mailtrap.io
      MAIL_PORT=2525
      MAIL_USERNAME=your-mail-username
      MAIL_PASSWORD=your-mail-password
      MAIL_ENCRYPTION=tls
      MAIL_FROM_ADDRESS=noreply@example.com
      MAIL_FROM_NAME=Fusion

Important: Use the application key generated earlier. The key must be base64 encoded and prefixed with base64:.

Step 4: Deploy Your Application

    1. Click Deploy to start the build process

    2. Klutch.sh will:

      • Pull your GitHub repository
      • Detect the Dockerfile automatically
      • Build the Fusion container image
      • Deploy it with your configured volumes and environment variables
    3. Monitor the build logs for any errors

    4. Once deployed, your Fusion CMS will be available at https://example-app.klutch.sh

    5. Initial deployment may take 5-10 minutes for database migrations and setup


Initial Setup and Installation

After deployment, complete the Fusion installation:

Step 1: Run Database Migrations

The Dockerfile should automatically run migrations, but if needed, you can run them manually:

Terminal window
# Access your container
docker exec -it your-container-id bash
# Run migrations
php artisan migrate --force
# Seed the database (optional)
php artisan db:seed

Create a symbolic link for public storage:

Terminal window
php artisan storage:link

Step 3: Access Installation Wizard

    1. Navigate to https://example-app.klutch.sh in your browser

    2. You should see the Fusion installation wizard

    3. Follow the wizard steps:

      • Database connection verification
      • Admin account creation
      • Site settings configuration
    4. Create your admin account:

      • Name: Your full name
      • Email: Your email address
      • Password: Strong password (minimum 12 characters)
    5. Configure site settings:

      • Site Name: Your website name
      • Site Description: Brief description
      • Timezone: Select your timezone
    6. Click Complete Installation

Step 4: Access Admin Panel

    1. Navigate to https://example-app.klutch.sh/admin

    2. Log in with your admin credentials

    3. You should see the Fusion admin dashboard


Creating Your First Content

Let’s create a blog to demonstrate Fusion’s blueprint system:

Step 1: Create a Blueprint

Blueprints define content types:

    1. In the admin panel, navigate to SystemBlueprints

    2. Click Create Blueprint

    3. Configure the blueprint:

      • Name: Blog Post
      • Handle: blog_post (auto-generated)
      • Description: Blog post content type
      • Icon: Select an icon
      • Type: Entry
    4. Click Create Blueprint

Step 2: Add Fields to Blueprint

    1. In the blueprint editor, click Add Section

    2. Name the section: Content

    3. Add fields to the section:

      Title Field:

      • Type: Text
      • Name: Title
      • Handle: title
      • Required: Yes
      • Help Text: Post title

      Excerpt Field:

      • Type: Textarea
      • Name: Excerpt
      • Handle: excerpt
      • Required: No
      • Help Text: Short description for previews

      Body Field:

      • Type: Rich Text
      • Name: Body
      • Handle: body
      • Required: Yes
      • Help Text: Main post content

      Featured Image:

      • Type: Media
      • Name: Featured Image
      • Handle: featured_image
      • Required: No
      • Allowed Types: image

      Published Date:

      • Type: Date
      • Name: Published At
      • Handle: published_at
      • Required: Yes
    4. Click Save Blueprint

Step 3: Create an Entry

    1. Navigate to ContentBlog Posts (the menu item is auto-created)

    2. Click Create Blog Post

    3. Fill in the form:

      • Title: Welcome to Fusion CMS
      • Excerpt: Fusion makes content management easy and flexible
      • Body: Write your post content using the rich text editor
      • Featured Image: Upload an image
      • Published At: Select today’s date
    4. Click Publish to make the post live

    5. Click Save Draft to save without publishing

Step 4: Display Content on Frontend

Create a Blade template to display blog posts:

Create resources/themes/default/blog/index.blade.php:

@extends('layouts.app')
@section('content')
<div class="container mx-auto px-4 py-8">
<h1 class="text-4xl font-bold mb-8">Blog</h1>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
@foreach($posts as $post)
<article class="bg-white rounded-lg shadow-md overflow-hidden">
@if($post->featured_image)
<img src="{{ $post->featured_image->url }}" alt="{{ $post->title }}" class="w-full h-48 object-cover">
@endif
<div class="p-6">
<h2 class="text-2xl font-semibold mb-2">
<a href="{{ route('blog.show', $post->slug) }}" class="hover:text-blue-600">
{{ $post->title }}
</a>
</h2>
<p class="text-gray-600 text-sm mb-4">
{{ $post->published_at->format('F j, Y') }}
</p>
@if($post->excerpt)
<p class="text-gray-700 mb-4">{{ $post->excerpt }}</p>
@endif
<a href="{{ route('blog.show', $post->slug) }}" class="text-blue-600 hover:text-blue-800 font-medium">
Read More
</a>
</div>
</article>
@endforeach
</div>
{{ $posts->links() }}
</div>
@endsection

Create resources/themes/default/blog/show.blade.php:

@extends('layouts.app')
@section('content')
<article class="container mx-auto px-4 py-8 max-w-4xl">
@if($post->featured_image)
<img src="{{ $post->featured_image->url }}" alt="{{ $post->title }}" class="w-full h-96 object-cover rounded-lg mb-8">
@endif
<h1 class="text-5xl font-bold mb-4">{{ $post->title }}</h1>
<div class="text-gray-600 mb-8">
Published on {{ $post->published_at->format('F j, Y') }}
</div>
<div class="prose prose-lg max-w-none">
{!! $post->body !!}
</div>
<div class="mt-12 pt-8 border-t">
<a href="{{ route('blog.index') }}" class="text-blue-600 hover:text-blue-800 font-medium">
Back to Blog
</a>
</div>
</article>
@endsection

Add routes in routes/web.php:

use App\Http\Controllers\BlogController;
Route::get('/blog', [BlogController::class, 'index'])->name('blog.index');
Route::get('/blog/{slug}', [BlogController::class, 'show'])->name('blog.show');

Create controller app/Http/Controllers/BlogController.php:

<?php
namespace App\Http\Controllers;
use Fusion\Models\Entry;
class BlogController extends Controller
{
public function index()
{
$posts = Entry::where('blueprint', 'blog_post')
->where('status', 'published')
->orderBy('published_at', 'desc')
->paginate(12);
return view('blog.index', compact('posts'));
}
public function show($slug)
{
$post = Entry::where('blueprint', 'blog_post')
->where('slug', $slug)
->where('status', 'published')
->firstOrFail();
return view('blog.show', compact('post'));
}
}

Page Builder

Fusion includes a visual page builder for creating layouts:

Creating a Landing Page

    1. Navigate to ContentPages

    2. Click Create Page

    3. Configure the page:

      • Title: Home
      • Slug: home (or / for homepage)
      • Status: Published
    4. Click Page Builder tab

    5. Add components:

      • Hero Section: Banner with call-to-action
      • Features Grid: Highlight key features
      • Content Block: Rich text content
      • Call to Action: Button or form
    6. Customize each component:

      • Edit text and images
      • Adjust colors and spacing
      • Configure buttons and links
    7. Click Save & Publish

Available Components

Fusion includes these default components:

  • Hero: Large banner with background image
  • Text Block: Rich text content
  • Image: Single image with caption
  • Gallery: Image grid
  • Video: Embedded video player
  • Button: Call-to-action button
  • Form: Embedded custom form
  • Spacer: Vertical spacing
  • Divider: Horizontal line
  • Custom HTML: Raw HTML

Form Builder

Create custom forms for contact, surveys, or registrations:

Creating a Contact Form

    1. Navigate to ContentForms

    2. Click Create Form

    3. Configure the form:

      • Name: Contact Form
      • Handle: contact
      • Email Recipients: contact@example.com
      • Confirmation Message: Thank you for contacting us!
    4. Add form fields:

      Name Field:

      • Type: Text
      • Label: Your Name
      • Required: Yes
      • Validation: Minimum 2 characters

      Email Field:

      • Type: Email
      • Label: Email Address
      • Required: Yes
      • Validation: Valid email format

      Subject Field:

      • Type: Select
      • Label: Subject
      • Options: General Inquiry, Support, Sales
      • Required: Yes

      Message Field:

      • Type: Textarea
      • Label: Message
      • Required: Yes
      • Validation: Minimum 10 characters
    5. Configure email notification:

      • Subject: New Contact Form Submission
      • Reply To: Use form email field
      • Email Template: Customize message
    6. Click Save Form

Embedding Forms

In Blade Templates:

@fusion('form', ['handle' => 'contact'])

In Page Builder:

Add a Form component and select the contact form.

Form Submissions:

View submissions in ContentFormsSubmissions.


Media Management

Fusion provides powerful media management:

Uploading Media

    1. Navigate to ContentMedia

    2. Click Upload or drag files to upload

    3. Supported formats:

      • Images: JPG, PNG, GIF, SVG, WebP
      • Documents: PDF, DOC, DOCX, XLS, XLSX
      • Videos: MP4, MOV, AVI (uploaded to storage)
      • Audio: MP3, WAV
    4. Organize files into folders:

      • Create folders for different content types
      • Move files between folders
      • Bulk operations available

Image Transformations

Fusion automatically generates responsive images:

<!-- Original image -->
<img src="{{ $media->url }}" alt="{{ $media->alt }}">
<!-- Resized image -->
<img src="{{ $media->url(['width' => 800]) }}" alt="{{ $media->alt }}">
<!-- Thumbnail -->
<img src="{{ $media->url(['width' => 300, 'height' => 200, 'fit' => 'crop']) }}" alt="{{ $media->alt }}">
<!-- Responsive srcset -->
<img
src="{{ $media->url(['width' => 800]) }}"
srcset="
{{ $media->url(['width' => 400]) }} 400w,
{{ $media->url(['width' => 800]) }} 800w,
{{ $media->url(['width' => 1200]) }} 1200w
"
sizes="(max-width: 800px) 100vw, 800px"
alt="{{ $media->alt }}"
>

Theme Customization

Fusion uses Blade templates for theming:

Theme Structure

resources/themes/your-theme/
├── layouts/
│ ├── app.blade.php # Main layout
│ └── admin.blade.php # Admin layout
├── partials/
│ ├── header.blade.php
│ ├── footer.blade.php
│ └── navigation.blade.php
├── pages/
│ ├── home.blade.php
│ └── about.blade.php
├── blog/
│ ├── index.blade.php
│ └── show.blade.php
└── components/
└── button.blade.php

Creating a Custom Theme

    1. Create theme directory:

      Terminal window
      mkdir -p resources/themes/mytheme
    2. Create main layout layouts/app.blade.php:

      <!DOCTYPE html>
      <html lang="{{ app()->getLocale() }}">
      <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>@yield('title', config('app.name'))</title>
      @vite(['resources/css/app.css', 'resources/js/app.js'])
      </head>
      <body>
      @include('partials.header')
      <main>
      @yield('content')
      </main>
      @include('partials.footer')
      </body>
      </html>
    3. Activate theme in admin:

      • Navigate to SettingsTheme
      • Select your custom theme
      • Click Save

User Management and Permissions

Fusion includes a robust user and role system:

Creating Roles

    1. Navigate to SystemRoles

    2. Click Create Role

    3. Configure the role:

      • Name: Editor
      • Handle: editor
      • Description: Can create and edit content
    4. Set permissions:

      • Content: Create, read, update entries
      • Media: Upload and manage media
      • Forms: View submissions
      • Pages: Create and edit pages
    5. Click Save Role

Creating Users

    1. Navigate to SystemUsers

    2. Click Create User

    3. Configure the user:

      • Name: Full name
      • Email: Email address
      • Password: Strong password
      • Roles: Assign roles
      • Status: Active
    4. Click Save User


Caching and Performance

Enable Redis Caching

For improved performance, deploy Redis and configure Fusion to use it:

    1. Deploy Redis on Klutch.sh (see Redis guide)

    2. Update environment variables:

      Terminal window
      CACHE_DRIVER=redis
      SESSION_DRIVER=redis
      QUEUE_CONNECTION=redis
      REDIS_HOST=redis-app.klutch.sh
      REDIS_PORT=8000
    3. Update config/database.php:

      'redis' => [
      'client' => 'phpredis',
      'default' => [
      'host' => env('REDIS_HOST', '127.0.0.1'),
      'port' => env('REDIS_PORT', 6379),
      'database' => 0,
      ],
      ],
    4. Clear and reconfigure cache:

      Terminal window
      php artisan config:cache
      php artisan route:cache
      php artisan view:cache

Optimize Application

    1. Enable OPcache: Already configured in Dockerfile

    2. Cache Configuration:

      Terminal window
      php artisan config:cache
    3. Cache Routes:

      Terminal window
      php artisan route:cache
    4. Cache Views:

      Terminal window
      php artisan view:cache
    5. Optimize Autoloader:

      Terminal window
      composer install --optimize-autoloader --no-dev

SEO Configuration

Fusion includes built-in SEO tools:

Per-Page SEO

    1. Edit any page or entry

    2. Navigate to SEO tab

    3. Configure:

      • Meta Title: Custom title tag
      • Meta Description: Page description
      • Meta Keywords: Comma-separated keywords
      • Open Graph Image: Social sharing image
      • Robots: Index/noindex, follow/nofollow
    4. Preview how page appears in search results

    5. Click Save

Global SEO Settings

    1. Navigate to SettingsSEO

    2. Configure:

      • Site Title: Default title
      • Title Template: {title} | {site_name}
      • Meta Description: Default description
      • Twitter Card: Configure social sharing
      • Google Analytics: Add tracking ID
      • Verification Tags: Google, Bing verification
    3. Click Save Settings

Generate Sitemap

Terminal window
php artisan fusion:sitemap

Sitemap available at: https://example-app.klutch.sh/sitemap.xml


API and Headless CMS

Fusion can be used as a headless CMS:

Enable API

    1. Navigate to SettingsAPI

    2. Enable API access

    3. Configure:

      • API Prefix: /api
      • Rate Limiting: 60 requests per minute
      • Authentication: Token-based
    4. Generate API token:

      • Navigate to SystemAPI Tokens
      • Click Create Token
      • Set permissions
      • Copy token

API Endpoints

Get all blog posts:

Terminal window
curl https://example-app.klutch.sh/api/entries/blog_post \
-H "Authorization: Bearer your-api-token"

Get single post:

Terminal window
curl https://example-app.klutch.sh/api/entries/blog_post/post-slug \
-H "Authorization: Bearer your-api-token"

Response:

{
"data": {
"id": 1,
"title": "Welcome to Fusion CMS",
"slug": "welcome-to-fusion-cms",
"excerpt": "Fusion makes content management easy",
"body": "<p>Full content here...</p>",
"featured_image": {
"url": "https://example-app.klutch.sh/storage/images/hero.jpg"
},
"published_at": "2024-01-15T10:00:00Z"
}
}

Custom Domain Configuration

Step 1: Configure Domain in Klutch.sh

    1. In the Klutch.sh dashboard, navigate to your app settings

    2. Go to the Domains section

    3. Add your custom domain (e.g., www.yourdomain.com)

    4. Klutch.sh will provide DNS records to configure

Step 2: Update DNS Records

    1. Log in to your domain registrar

    2. Add the DNS records provided by Klutch.sh:

      • CNAME record pointing to your Klutch.sh app
    3. Wait for DNS propagation (up to 48 hours)

    4. Klutch.sh will automatically provision SSL certificates

Step 3: Update Fusion Configuration

    1. Update the APP_URL environment variable to your custom domain

    2. Redeploy the application

    3. Clear cache:

      Terminal window
      php artisan config:clear
      php artisan cache:clear

Security Best Practices

Application Security

    1. Use Strong APP_KEY:

      • Generate with php artisan key:generate
      • Never commit to version control
      • Rotate periodically
    2. Disable Debug Mode in Production:

      Terminal window
      APP_DEBUG=false
    3. Configure HTTPS:

      • Force HTTPS in production
      • Use secure cookies
      • Enable HSTS headers
    4. Implement CSP Headers:

      add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';" always;
    5. Rate Limiting:

      • Laravel includes rate limiting
      • Configure in app/Http/Kernel.php
      • Customize limits per route

User Security

    1. Strong Passwords:

      • Enforce minimum 12 characters
      • Require mixed case, numbers, symbols
      • Use Laravel’s password validation
    2. Two-Factor Authentication:

      • Install 2FA package
      • Require for admin accounts
      • Provide backup codes
    3. Role-Based Access:

      • Follow principle of least privilege
      • Regular permission audits
      • Revoke unused accounts

Database Security

    1. Use Prepared Statements:

      • Eloquent uses prepared statements automatically
      • Never concatenate user input into queries
    2. Encrypt Sensitive Data:

      • Use Laravel’s encryption
      • Encrypt database backups
      • Secure credential storage
    3. Regular Backups:

      • Automated daily backups
      • Test restoration procedures
      • Store backups off-site

Backup and Maintenance

Database Backup

    1. Manual Backup:

      Terminal window
      mysqldump -h mariadb-app.klutch.sh -P 8000 -u fusion -p fusion > fusion-backup.sql
    2. Automated Backups:

      • Configure database backup schedule
      • Store backups in cloud storage (S3, DigitalOcean Spaces)
      • Retain backups for 30+ days
    3. Laravel Backup Package:

      Terminal window
      composer require spatie/laravel-backup
      php artisan backup:run

File Backup

    1. Storage Directory:

      • Backup /var/www/html/storage regularly
      • Include uploaded media
      • Backup database snapshots
    2. Configuration Backup:

      • Store environment variables securely
      • Version control all code changes
      • Document custom configurations

Updates and Maintenance

    1. Update Fusion:

      Terminal window
      composer update fusioncms/fusioncms
      php artisan migrate
      php artisan config:clear
    2. Update Dependencies:

      Terminal window
      composer update
      npm update
      npm run build
    3. Clear Caches:

      Terminal window
      php artisan config:clear
      php artisan cache:clear
      php artisan route:clear
      php artisan view:clear
    4. Run Health Checks:

      Terminal window
      php artisan fusion:check

Troubleshooting Common Issues

Application Won’t Start

    1. Check Logs:

      • View application logs in Klutch.sh dashboard
      • Check storage/logs/laravel.log
      • Review Nginx error logs
    2. Verify Environment Variables:

      • Ensure all required variables are set
      • Check APP_KEY is set correctly
      • Verify database credentials
    3. Check Permissions:

      Terminal window
      chmod -R 775 storage bootstrap/cache
      chown -R www-data:www-data storage bootstrap/cache

Database Connection Errors

    1. Test Connection:

      Terminal window
      mysql -h mariadb-app.klutch.sh -P 8000 -u fusion -p
    2. Verify Credentials:

      • Check DB_HOST, DB_PORT, DB_DATABASE
      • Verify DB_USERNAME and DB_PASSWORD
      • Ensure database exists
    3. Check Firewall:

      • Ensure TCP traffic enabled on database
      • Verify network connectivity

500 Internal Server Error

    1. Enable Debug Mode Temporarily:

      Terminal window
      APP_DEBUG=true
    2. Check Error Logs:

      • Review storage/logs/laravel.log
      • Check PHP-FPM logs
      • Review Nginx error logs
    3. Common Causes:

      • Missing APP_KEY
      • Incorrect file permissions
      • Missing Composer dependencies
      • Syntax errors in code

Admin Panel Not Loading

    1. Clear Cache:

      Terminal window
      php artisan config:clear
      php artisan cache:clear
      php artisan view:clear
    2. Rebuild Frontend Assets:

      Terminal window
      npm run build
    3. Check Database Migrations:

      Terminal window
      php artisan migrate:status
      php artisan migrate --force

Production Deployment Checklist

Before going live with Fusion:

  • Database deployed and accessible
  • Persistent volumes configured (10GB+ for /var/www/html/storage)
  • All environment variables set correctly
  • APP_KEY generated and set
  • APP_DEBUG set to false
  • APP_ENV set to production
  • HTTPS working correctly (automatic via Klutch.sh)
  • Custom domain configured (optional)
  • Database migrations run successfully
  • Storage link created (php artisan storage:link)
  • Admin account created
  • File permissions set correctly
  • Caching configured (Redis recommended)
  • Configuration cached (php artisan config:cache)
  • Routes cached (php artisan route:cache)
  • Views cached (php artisan view:cache)
  • Queue workers running via Supervisor
  • Scheduled tasks configured
  • Backup strategy implemented
  • Mail configuration tested
  • Security headers configured
  • Rate limiting enabled
  • Error monitoring set up
  • Performance optimizations applied
  • SEO settings configured
  • Sitemap generated
  • SSL certificates verified

Resources and Further Reading


Conclusion

Deploying Fusion CMS on Klutch.sh provides a powerful, modern content management solution built on Laravel’s solid foundation. With automatic HTTPS, persistent storage, straightforward database connectivity, and the flexibility to scale resources as needed, you can focus on creating great content and building custom features rather than managing infrastructure.

This guide covered everything from initial deployment to advanced features like custom blueprints, page building, form creation, theme customization, API integration, and production best practices. Whether you’re building a simple blog, a complex corporate website, or a custom application with CMS capabilities, Fusion on Klutch.sh provides the tools, flexibility, and reliability you need.

Remember to keep your system updated, implement proper backups, follow security best practices, and optimize for performance to ensure your CMS runs smoothly. For additional help or questions, refer to the resources above or engage with the Fusion and Laravel communities.

Happy content managing!