Skip to content

Deploying OSSN

Introduction

OSSN (Open Source Social Network) is a feature-rich social networking platform that allows you to build your own social network similar to Facebook. It provides all the essential social networking features including user profiles, friend connections, groups, messaging, photos, and a news feed.

Built with PHP, OSSN offers a clean, responsive interface and an extensible architecture through components and themes. It’s designed for organizations, communities, or anyone who wants to run their own private social network with full control over data and privacy.

Key highlights of OSSN:

  • User Profiles: Customizable user profiles with photos and information
  • Friends System: Friend requests, connections, and activity feeds
  • Groups: Public and private groups with discussions
  • Messaging: Private messaging between users
  • Photo Sharing: Photo albums and image uploads
  • News Feed: Activity stream showing updates from connections
  • Notifications: Real-time notifications for activities
  • Comments and Likes: Social interactions on posts
  • Privacy Controls: Granular privacy settings for users
  • Component System: Extend functionality with add-ons
  • Theme Support: Customizable appearance
  • Open Source: GPL-2.0 license with active development

This guide walks through deploying OSSN on Klutch.sh using Docker.

Why Deploy OSSN on Klutch.sh

Deploying OSSN on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh handles the PHP/MySQL deployment automatically.

Persistent Storage: Attach persistent volumes for user data and uploads.

HTTPS by Default: Automatic SSL certificates for secure social networking.

GitHub Integration: Version-controlled deployments through your repository.

Scalable Resources: Allocate CPU and memory based on your community size.

Environment Variable Management: Securely store database credentials.

Custom Domains: Use your own domain for your social network.

Always-On Availability: Your social network remains accessible 24/7.

Prerequisites

Before deploying OSSN on Klutch.sh, ensure you have:

Understanding OSSN Architecture

OSSN uses a traditional LAMP-style architecture:

PHP Application: Core application handling all business logic and rendering.

MySQL Database: Stores users, posts, relationships, and all application data.

File Storage: User uploads including profile pictures and shared photos.

Component System: Modular add-ons for extending functionality.

Theme Engine: Customizable templates for appearance changes.

Deploying OSSN on Klutch.sh

    Create Your GitHub Repository

    Create a new GitHub repository for your OSSN deployment configuration.

    Create the Dockerfile

    Create a Dockerfile in your repository root:

    FROM php:8.1-apache
    # Install dependencies
    RUN apt-get update && apt-get install -y \
    libpng-dev \
    libjpeg-dev \
    libfreetype6-dev \
    libzip-dev \
    unzip \
    curl \
    && rm -rf /var/lib/apt/lists/*
    # Configure PHP extensions
    RUN docker-php-ext-configure gd --with-freetype --with-jpeg && \
    docker-php-ext-install gd mysqli zip pdo pdo_mysql
    # Enable Apache mod_rewrite
    RUN a2enmod rewrite
    # Configure PHP
    RUN { \
    echo 'upload_max_filesize = 100M'; \
    echo 'post_max_size = 100M'; \
    echo 'memory_limit = 256M'; \
    echo 'max_execution_time = 300'; \
    } > /usr/local/etc/php/conf.d/ossn.ini
    # Download OSSN
    WORKDIR /var/www/html
    RUN curl -L https://github.com/nicksellen/ossn/archive/refs/heads/master.zip -o ossn.zip && \
    unzip ossn.zip && \
    mv ossn-master/* . && \
    rm -rf ossn-master ossn.zip
    # Set permissions
    RUN chown -R www-data:www-data /var/www/html && \
    chmod -R 755 /var/www/html
    # Create data directory
    RUN mkdir -p /var/ossn_data && \
    chown www-data:www-data /var/ossn_data
    EXPOSE 80

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project.

    Create a New App

    Within your project, create a new app and connect your GitHub repository.

    Configure HTTP Traffic

    In the deployment settings:

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

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    MYSQL_HOSTYour database host
    MYSQL_DATABASEossn
    MYSQL_USERDatabase username
    MYSQL_PASSWORDDatabase password

    Attach Persistent Volumes

    Add persistent storage:

    Mount PathRecommended SizePurpose
    /var/www/html5 GBOSSN installation
    /var/ossn_data50 GBUser uploads and data

    Deploy Your Application

    Click Deploy to start the build process.

    Complete Installation Wizard

    Access your OSSN instance and complete setup:

    1. Navigate to https://your-app.klutch.sh
    2. Follow the installation wizard
    3. Enter database credentials
    4. Create admin account

Initial Configuration

Site Configuration

After installation, configure your network:

  1. Log in as administrator
  2. Go to Administrator Dashboard
  3. Configure site name and settings
  4. Set up default privacy options

Email Configuration

Set up email notifications:

  1. Navigate to Site Settings
  2. Configure SMTP settings
  3. Test email delivery
  4. Enable notification types

Enabling Components

Extend functionality:

  1. Go to Components section
  2. Browse available components
  3. Enable desired features
  4. Configure component settings

Customizing OSSN

Theme Customization

Change the appearance:

  1. Navigate to Themes
  2. Browse available themes
  3. Install and activate themes
  4. Customize colors and styles

Custom Pages

Create additional content:

  1. Use the pages component
  2. Create About, Terms, Privacy pages
  3. Add custom navigation links

Privacy Settings

Configure network privacy:

  1. Set registration requirements
  2. Configure default privacy levels
  3. Enable/disable features for users
  4. Set content moderation rules

Managing Your Network

User Management

Administer users:

  1. View all registered users
  2. Manage user roles
  3. Handle user reports
  4. Moderate content

Content Moderation

Keep your network safe:

  1. Enable content reporting
  2. Review reported content
  3. Take moderation actions
  4. Configure automated filters

Groups Administration

Manage groups:

  1. View all groups
  2. Approve group requests
  3. Moderate group content
  4. Set group policies

Production Best Practices

Performance Optimization

  • Enable PHP OPcache
  • Configure MySQL query caching
  • Use CDN for static assets
  • Optimize images on upload

Security Recommendations

  • Keep OSSN and components updated
  • Use strong admin passwords
  • Enable HTTPS (automatic on Klutch.sh)
  • Regular security audits
  • Configure rate limiting

Backup Strategy

  1. Database Backups: Regular MySQL dumps
  2. File Backups: Back up /var/ossn_data
  3. Configuration: Document all settings
  4. Test Restores: Verify backup integrity

Troubleshooting Common Issues

Installation Fails

  • Verify database connectivity
  • Check file permissions
  • Review PHP error logs
  • Ensure extensions installed

Upload Issues

  • Check PHP upload limits
  • Verify data directory permissions
  • Check available disk space
  • Review error logs

Performance Problems

  • Increase PHP memory limit
  • Optimize database
  • Enable caching
  • Check server resources

Additional Resources

Conclusion

Deploying OSSN on Klutch.sh provides a complete social networking platform with full control over your data and community. Whether building a private network for your organization or a public community platform, OSSN offers the features users expect from modern social networks while maintaining privacy and independence from major platforms.